From 814dca7069138a38b4cf1066820d9ca69d5ef18d Mon Sep 17 00:00:00 2001 From: John Durkop Date: Mon, 5 Oct 2020 06:31:12 -0700 Subject: [PATCH] Fix unit tests when MBEDTLS_PSA_CRYPTO_CONFIG is enabled This change fixes the decrypt cipher setup function to return the appropriate error code of PSA_ERROR_NOT_SUPPORTED instead of PSA_ERROR_BAD_STATE for invalid locations when the setup call is made. Signed-off-by: John Durkop --- library/psa_crypto_driver_wrappers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/psa_crypto_driver_wrappers.c b/library/psa_crypto_driver_wrappers.c index 140bab626..dedbf54bf 100644 --- a/library/psa_crypto_driver_wrappers.c +++ b/library/psa_crypto_driver_wrappers.c @@ -664,7 +664,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup( #endif /* PSA_CRYPTO_DRIVER_TEST */ default: /* Key is declared with a lifetime not known to us */ - return( PSA_ERROR_BAD_STATE ); + return( PSA_ERROR_NOT_SUPPORTED ); } #else /* PSA_CRYPTO_DRIVER_PRESENT */ (void)slot;