mirror of
https://github.com/espressif/mbedtls.git
synced 2025-05-09 19:31:18 +08:00
test: pake: fail in case the opaque key is destroyed unexpectedly
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
parent
785116a5be
commit
d75c5c4405
@ -3338,8 +3338,14 @@ exit:
|
|||||||
psa_key_attributes_t check_attributes = PSA_KEY_ATTRIBUTES_INIT;
|
psa_key_attributes_t check_attributes = PSA_KEY_ATTRIBUTES_INIT;
|
||||||
|
|
||||||
/* Verify that the key is still valid before destroying it */
|
/* Verify that the key is still valid before destroying it */
|
||||||
if( psa_get_key_attributes( ecjpake_pw_slot, &check_attributes ) ==
|
if( psa_get_key_attributes( ecjpake_pw_slot, &check_attributes ) !=
|
||||||
PSA_SUCCESS )
|
PSA_SUCCESS )
|
||||||
|
{
|
||||||
|
if( ret == 0 )
|
||||||
|
ret = 1;
|
||||||
|
mbedtls_printf( "The EC J-PAKE password key has unexpectedly been already destroyed\n" );
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
psa_destroy_key( ecjpake_pw_slot );
|
psa_destroy_key( ecjpake_pw_slot );
|
||||||
}
|
}
|
||||||
|
@ -4448,8 +4448,14 @@ exit:
|
|||||||
psa_key_attributes_t check_attributes = PSA_KEY_ATTRIBUTES_INIT;
|
psa_key_attributes_t check_attributes = PSA_KEY_ATTRIBUTES_INIT;
|
||||||
|
|
||||||
/* Verify that the key is still valid before destroying it */
|
/* Verify that the key is still valid before destroying it */
|
||||||
if( psa_get_key_attributes( ecjpake_pw_slot, &check_attributes ) ==
|
if( psa_get_key_attributes( ecjpake_pw_slot, &check_attributes ) !=
|
||||||
PSA_SUCCESS )
|
PSA_SUCCESS )
|
||||||
|
{
|
||||||
|
if( ret == 0 )
|
||||||
|
ret = 1;
|
||||||
|
mbedtls_printf( "The EC J-PAKE password key has unexpectedly been already destroyed\n" );
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
psa_destroy_key( ecjpake_pw_slot );
|
psa_destroy_key( ecjpake_pw_slot );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user