Simplify cipher setup wrapper body
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
diff --git a/library/psa_crypto_driver_wrappers.c b/library/psa_crypto_driver_wrappers.c
index dea9cb5..268b47c 100644
--- a/library/psa_crypto_driver_wrappers.c
+++ b/library/psa_crypto_driver_wrappers.c
@@ -545,23 +545,15 @@
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
- {
- mbedtls_free( operation->ctx );
- operation->ctx = NULL;
- }
-
- return( status );
- }
+ if( status == PSA_SUCCESS )
+ operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID;
else
{
mbedtls_free( operation->ctx );
operation->ctx = NULL;
}
+
+ return( status );
#endif /* PSA_CRYPTO_DRIVER_TEST */
/* Fell through, meaning no accelerator supports this operation */
return( PSA_ERROR_NOT_SUPPORTED );
@@ -632,23 +624,15 @@
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
- {
- mbedtls_free( operation->ctx );
- operation->ctx = NULL;
- }
-
- return( status );
- }
+ if( status == PSA_SUCCESS )
+ operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID;
else
{
mbedtls_free( operation->ctx );
operation->ctx = NULL;
}
+
+ return( status );
#endif /* PSA_CRYPTO_DRIVER_TEST */
/* Fell through, meaning no accelerator supports this operation */
return( PSA_ERROR_NOT_SUPPORTED );