Simplify cipher setup wrapper body

Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
Steven Cooreman 2020-09-09 14:32:44 +02:00
parent fb81aa5889
commit 150c99b884

View File

@ -545,8 +545,6 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
slot->data.key.bytes,
alg );
/* Declared with fallback == true */
if( status != PSA_ERROR_NOT_SUPPORTED )
{
if( status == PSA_SUCCESS )
operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID;
else
@ -556,12 +554,6 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
}
return( status );
}
else
{
mbedtls_free( operation->ctx );
operation->ctx = NULL;
}
#endif /* PSA_CRYPTO_DRIVER_TEST */
/* Fell through, meaning no accelerator supports this operation */
return( PSA_ERROR_NOT_SUPPORTED );
@ -632,8 +624,6 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
slot->data.key.bytes,
alg );
/* Declared with fallback == true */
if( status != PSA_ERROR_NOT_SUPPORTED )
{
if( status == PSA_SUCCESS )
operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID;
else
@ -643,12 +633,6 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
}
return( status );
}
else
{
mbedtls_free( operation->ctx );
operation->ctx = NULL;
}
#endif /* PSA_CRYPTO_DRIVER_TEST */
/* Fell through, meaning no accelerator supports this operation */
return( PSA_ERROR_NOT_SUPPORTED );