mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-05-11 06:28:17 +02:00
Fix memory leak when importing an RSA key that is too large
This commit is contained in:
committed by
itayzafrir
parent
46f1fd7afd
commit
1ae051409f
@@ -514,7 +514,10 @@ psa_status_t psa_import_key( psa_key_slot_t key,
|
||||
mbedtls_rsa_context *rsa = mbedtls_pk_rsa( pk );
|
||||
size_t bits = mbedtls_rsa_get_bitlen( rsa );
|
||||
if( bits > PSA_VENDOR_RSA_MAX_KEY_BITS )
|
||||
return( PSA_ERROR_NOT_SUPPORTED );
|
||||
{
|
||||
status = PSA_ERROR_NOT_SUPPORTED;
|
||||
break;
|
||||
}
|
||||
slot->data.rsa = rsa;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user