Initialize status with CORRUPTION_DETECTED and update fallthrough

Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
Steven Cooreman 2021-03-08 12:13:21 +01:00
parent 5adf52c72d
commit 0eeb794a2e

View File

@ -1080,7 +1080,7 @@ psa_status_t psa_driver_wrapper_hash_compute(
size_t hash_size, size_t hash_size,
size_t *hash_length) size_t *hash_length)
{ {
psa_status_t status = PSA_ERROR_NOT_SUPPORTED; psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
/* Try accelerators first */ /* Try accelerators first */
#if defined(PSA_CRYPTO_DRIVER_TEST) #if defined(PSA_CRYPTO_DRIVER_TEST)
@ -1097,25 +1097,22 @@ psa_status_t psa_driver_wrapper_hash_compute(
if( status != PSA_ERROR_NOT_SUPPORTED ) if( status != PSA_ERROR_NOT_SUPPORTED )
return( status ); return( status );
#endif #endif
if( status == PSA_ERROR_NOT_SUPPORTED ) (void) status;
{ (void) alg;
(void) alg; (void) input;
(void) input; (void) input_length;
(void) input_length; (void) hash;
(void) hash; (void) hash_size;
(void) hash_size; (void) hash_length;
(void) hash_length;
return( PSA_ERROR_NOT_SUPPORTED ); return( PSA_ERROR_NOT_SUPPORTED );
}
return( status );
} }
psa_status_t psa_driver_wrapper_hash_setup( psa_status_t psa_driver_wrapper_hash_setup(
psa_hash_operation_t *operation, psa_hash_operation_t *operation,
psa_algorithm_t alg ) psa_algorithm_t alg )
{ {
psa_status_t status = PSA_ERROR_NOT_SUPPORTED; psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
/* Try setup on accelerators first */ /* Try setup on accelerators first */
#if defined(PSA_CRYPTO_DRIVER_TEST) #if defined(PSA_CRYPTO_DRIVER_TEST)