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 <john.durkop@fermatsoftware.com>
This commit is contained in:
John Durkop 2020-10-05 06:31:12 -07:00
parent 76228acfb9
commit 814dca7069

View File

@ -664,7 +664,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
#endif /* PSA_CRYPTO_DRIVER_TEST */ #endif /* PSA_CRYPTO_DRIVER_TEST */
default: default:
/* Key is declared with a lifetime not known to us */ /* 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 */ #else /* PSA_CRYPTO_DRIVER_PRESENT */
(void)slot; (void)slot;