mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-22 11:11:08 +00:00
Add a length check in rsa_get_pubkey()
This commit is contained in:
parent
56a487a17f
commit
c13c0d4524
|
@ -518,6 +518,10 @@ static int x509_get_rsapubkey( unsigned char **p,
|
||||||
( ret = asn1_get_mpi( p, end, &rsa->E ) ) != 0 )
|
( ret = asn1_get_mpi( p, end, &rsa->E ) ) != 0 )
|
||||||
return( POLARSSL_ERR_X509_CERT_INVALID_PUBKEY + ret );
|
return( POLARSSL_ERR_X509_CERT_INVALID_PUBKEY + ret );
|
||||||
|
|
||||||
|
if( *p != end )
|
||||||
|
return( POLARSSL_ERR_X509_CERT_INVALID_PUBKEY +
|
||||||
|
POLARSSL_ERR_ASN1_LENGTH_MISMATCH );
|
||||||
|
|
||||||
if( ( ret = rsa_check_pubkey( rsa ) ) != 0 )
|
if( ( ret = rsa_check_pubkey( rsa ) ) != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue