mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 15:15:43 +01:00
Simplify cipher setup wrapper body
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
parent
fb81aa5889
commit
150c99b884
@ -545,23 +545,15 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
|
|||||||
slot->data.key.bytes,
|
slot->data.key.bytes,
|
||||||
alg );
|
alg );
|
||||||
/* Declared with fallback == true */
|
/* Declared with fallback == true */
|
||||||
if( status != PSA_ERROR_NOT_SUPPORTED )
|
if( status == PSA_SUCCESS )
|
||||||
{
|
operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID;
|
||||||
if( status == PSA_SUCCESS )
|
|
||||||
operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mbedtls_free( operation->ctx );
|
|
||||||
operation->ctx = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return( status );
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mbedtls_free( operation->ctx );
|
mbedtls_free( operation->ctx );
|
||||||
operation->ctx = NULL;
|
operation->ctx = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return( status );
|
||||||
#endif /* PSA_CRYPTO_DRIVER_TEST */
|
#endif /* PSA_CRYPTO_DRIVER_TEST */
|
||||||
/* Fell through, meaning no accelerator supports this operation */
|
/* Fell through, meaning no accelerator supports this operation */
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
return( PSA_ERROR_NOT_SUPPORTED );
|
||||||
@ -632,23 +624,15 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
|
|||||||
slot->data.key.bytes,
|
slot->data.key.bytes,
|
||||||
alg );
|
alg );
|
||||||
/* Declared with fallback == true */
|
/* Declared with fallback == true */
|
||||||
if( status != PSA_ERROR_NOT_SUPPORTED )
|
if( status == PSA_SUCCESS )
|
||||||
{
|
operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID;
|
||||||
if( status == PSA_SUCCESS )
|
|
||||||
operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mbedtls_free( operation->ctx );
|
|
||||||
operation->ctx = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return( status );
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mbedtls_free( operation->ctx );
|
mbedtls_free( operation->ctx );
|
||||||
operation->ctx = NULL;
|
operation->ctx = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return( status );
|
||||||
#endif /* PSA_CRYPTO_DRIVER_TEST */
|
#endif /* PSA_CRYPTO_DRIVER_TEST */
|
||||||
/* Fell through, meaning no accelerator supports this operation */
|
/* Fell through, meaning no accelerator supports this operation */
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
return( PSA_ERROR_NOT_SUPPORTED );
|
||||||
|
Loading…
Reference in New Issue
Block a user