mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-27 06:35:22 +00:00
Reverting comments deleted in previous PR
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
This commit is contained in:
parent
7871c2e736
commit
18cddc08c7
@ -1000,6 +1000,13 @@ psa_status_t psa_wipe_key_slot( psa_key_slot_t *slot )
|
||||
{
|
||||
psa_status_t status = psa_remove_key_data_from_memory( slot );
|
||||
|
||||
/*
|
||||
* As the return error code may not be handled in case of multiple errors,
|
||||
* do our best to report an unexpected lock counter: if available call
|
||||
* MBEDTLS_TEST_HOOK_TEST_ASSERT that may terminate execution (if called as
|
||||
* part of the execution of a test suite this will stop the test suite
|
||||
* execution).
|
||||
*/
|
||||
if( slot->lock_count != 1 )
|
||||
{
|
||||
MBEDTLS_TEST_HOOK_TEST_ASSERT( slot->lock_count == 1 );
|
||||
|
@ -412,6 +412,13 @@ psa_status_t psa_unlock_key_slot( psa_key_slot_t *slot )
|
||||
return( PSA_SUCCESS );
|
||||
}
|
||||
|
||||
/*
|
||||
* As the return error code may not be handled in case of multiple errors,
|
||||
* do our best to report if the lock counter is equal to zero: if available
|
||||
* call MBEDTLS_TEST_HOOK_TEST_ASSERT that may terminate execution (if called
|
||||
* as part of the execution of a unit test suite this will stop the test
|
||||
* suite execution).
|
||||
*/
|
||||
MBEDTLS_TEST_HOOK_TEST_ASSERT( slot->lock_count > 0 );
|
||||
return( PSA_ERROR_CORRUPTION_DETECTED );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user