Fix transparent driver wrappers
Remove spurious "not supported" returns, and fix same issue that was encountered with internal implementations - operation needs to be marked as a type even if the initial call fails, otherwise cleanup won't get done. Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
parent
7bc45ebf13
commit
fe5480a4c2
1 changed files with 2 additions and 11 deletions
|
@ -1316,7 +1316,6 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(
|
||||||
key_buffer, key_buffer_size,
|
key_buffer, key_buffer_size,
|
||||||
alg );
|
alg );
|
||||||
/* Declared with fallback == true */
|
/* Declared with fallback == true */
|
||||||
if( status == PSA_SUCCESS )
|
|
||||||
operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID;
|
operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID;
|
||||||
|
|
||||||
if( status != PSA_ERROR_NOT_SUPPORTED )
|
if( status != PSA_ERROR_NOT_SUPPORTED )
|
||||||
|
@ -1367,7 +1366,6 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(
|
||||||
key_buffer, key_buffer_size,
|
key_buffer, key_buffer_size,
|
||||||
alg );
|
alg );
|
||||||
/* Declared with fallback == true */
|
/* Declared with fallback == true */
|
||||||
if( status == PSA_SUCCESS )
|
|
||||||
operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID;
|
operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID;
|
||||||
|
|
||||||
if( status != PSA_ERROR_NOT_SUPPORTED )
|
if( status != PSA_ERROR_NOT_SUPPORTED )
|
||||||
|
@ -1410,7 +1408,6 @@ psa_status_t psa_driver_wrapper_aead_set_nonce(
|
||||||
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
||||||
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
||||||
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
|
||||||
return( test_transparent_aead_set_nonce(
|
return( test_transparent_aead_set_nonce(
|
||||||
operation, nonce, nonce_length ) );
|
operation, nonce, nonce_length ) );
|
||||||
|
|
||||||
|
@ -1442,7 +1439,6 @@ psa_status_t psa_driver_wrapper_aead_set_lengths(
|
||||||
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
||||||
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
||||||
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
|
||||||
return( test_transparent_aead_set_lengths(
|
return( test_transparent_aead_set_lengths(
|
||||||
operation, ad_length, plaintext_length ) );
|
operation, ad_length, plaintext_length ) );
|
||||||
|
|
||||||
|
@ -1474,7 +1470,6 @@ psa_status_t psa_driver_wrapper_aead_update_ad(
|
||||||
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
||||||
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
||||||
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
|
||||||
return( test_transparent_aead_update_ad(
|
return( test_transparent_aead_update_ad(
|
||||||
operation, input, input_length ) );
|
operation, input, input_length ) );
|
||||||
|
|
||||||
|
@ -1510,7 +1505,6 @@ psa_status_t psa_driver_wrapper_aead_update(
|
||||||
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
||||||
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
||||||
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
|
||||||
return( test_transparent_aead_update(
|
return( test_transparent_aead_update(
|
||||||
operation, input, input_length, output, output_size,
|
operation, input, input_length, output, output_size,
|
||||||
output_length ) );
|
output_length ) );
|
||||||
|
@ -1551,7 +1545,6 @@ psa_status_t psa_driver_wrapper_aead_finish(
|
||||||
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
||||||
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
||||||
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
|
||||||
return( test_transparent_aead_finish(
|
return( test_transparent_aead_finish(
|
||||||
operation, ciphertext, ciphertext_size,
|
operation, ciphertext, ciphertext_size,
|
||||||
ciphertext_length, tag, tag_size, tag_length ) );
|
ciphertext_length, tag, tag_size, tag_length ) );
|
||||||
|
@ -1592,7 +1585,6 @@ psa_status_t psa_driver_wrapper_aead_verify(
|
||||||
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
||||||
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
||||||
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
|
||||||
return( test_transparent_aead_verify(
|
return( test_transparent_aead_verify(
|
||||||
operation, plaintext, plaintext_size,
|
operation, plaintext, plaintext_size,
|
||||||
plaintext_length, tag, tag_length ) );
|
plaintext_length, tag, tag_length ) );
|
||||||
|
@ -1626,7 +1618,6 @@ psa_status_t psa_driver_wrapper_aead_abort(
|
||||||
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
|
||||||
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
||||||
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID:
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
|
||||||
return( test_transparent_aead_abort( operation ) );
|
return( test_transparent_aead_abort( operation ) );
|
||||||
|
|
||||||
/* Add cases for opaque driver here */
|
/* Add cases for opaque driver here */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue