mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-18 19:27:41 +00:00
Destroy ecdh_psa_privkey on failure
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
130c4b5567
commit
e9f00445bc
@ -3181,6 +3181,8 @@ curve_matching_done:
|
||||
{
|
||||
ret = psa_ssl_status_to_mbedtls( status );
|
||||
MBEDTLS_SSL_DEBUG_RET( 1, "psa_export_public_key", ret );
|
||||
(void) psa_destroy_key( handshake->ecdh_psa_privkey );
|
||||
handshake->ecdh_psa_privkey = MBEDTLS_SVC_KEY_ID_INIT;
|
||||
return( ret );
|
||||
}
|
||||
|
||||
@ -3919,6 +3921,8 @@ static int ssl_parse_client_key_exchange( mbedtls_ssl_context *ssl )
|
||||
{
|
||||
ret = psa_ssl_status_to_mbedtls( status );
|
||||
MBEDTLS_SSL_DEBUG_RET( 1, "psa_raw_key_agreement", ret );
|
||||
(void) psa_destroy_key( handshake->ecdh_psa_privkey );
|
||||
handshake->ecdh_psa_privkey = MBEDTLS_SVC_KEY_ID_INIT;
|
||||
return( ret );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user