mirror of
https://github.com/ipxe/ipxe
synced 2025-12-30 13:11:11 +03:00
[crypto] Upgrade AES and RSA code to upstream axTLS version 1.4.5
All axTLS files are now vanilla versions of the upstream axTLS files, with one minor exception: the unused "ctx" parameter of bi_int_divide() has been marked with "__unused" to avoid a compilation error. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -155,6 +155,11 @@ int x509_rsa_public_key ( const struct asn1_cursor *certificate,
|
||||
DBG_HDA ( 0, certificate->data, certificate->len );
|
||||
return -ENOTSUP;
|
||||
}
|
||||
if ( modulus.len && ( ! *( ( uint8_t * ) modulus.data ) ) ) {
|
||||
/* Skip positive sign byte */
|
||||
modulus.data++;
|
||||
modulus.len--;
|
||||
}
|
||||
memcpy ( &exponent, &pubkey, sizeof ( exponent ) );
|
||||
rc = ( asn1_skip ( &exponent, ASN1_INTEGER ), /* modulus */
|
||||
asn1_enter ( &exponent, ASN1_INTEGER ) /* publicExponent */ );
|
||||
@@ -163,6 +168,11 @@ int x509_rsa_public_key ( const struct asn1_cursor *certificate,
|
||||
DBG_HDA ( 0, certificate->data, certificate->len );
|
||||
return -ENOTSUP;
|
||||
}
|
||||
if ( exponent.len && ( ! *( ( uint8_t * ) exponent.data ) ) ) {
|
||||
/* Skip positive sign byte */
|
||||
exponent.data++;
|
||||
exponent.len--;
|
||||
}
|
||||
|
||||
/* Allocate space and copy out modulus and exponent */
|
||||
rsa_pubkey->modulus = malloc ( modulus.len + exponent.len );
|
||||
|
||||
Reference in New Issue
Block a user