aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Rodgman <dave.rodgman@arm.com>2023-09-28 17:48:51 +0100
committerDave Rodgman <dave.rodgman@arm.com>2023-09-28 18:14:53 +0100
commit932925262067d65802196c69bd81c16fa70a2713 (patch)
tree6c8b7d326a32a8a681df8d77b9a953c87f34db5a
parent90330a4a2d0722c52d94b379fbd6423e002199b7 (diff)
downloadmbedtls-932925262067d65802196c69bd81c16fa70a2713.tar.gz
Fix IAR statement is unreachable warning
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
-rw-r--r--scripts/data_files/driver_templates/psa_crypto_driver_wrappers.h.jinja52
1 files changed, 22 insertions, 30 deletions
diff --git a/scripts/data_files/driver_templates/psa_crypto_driver_wrappers.h.jinja b/scripts/data_files/driver_templates/psa_crypto_driver_wrappers.h.jinja
index 3d116b396..e48963cb6 100644
--- a/scripts/data_files/driver_templates/psa_crypto_driver_wrappers.h.jinja
+++ b/scripts/data_files/driver_templates/psa_crypto_driver_wrappers.h.jinja
@@ -525,7 +525,13 @@ static inline psa_status_t psa_driver_wrapper_sign_hash_start(
size_t key_buffer_size, psa_algorithm_t alg,
const uint8_t *hash, size_t hash_length )
{
- psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
+ ( void ) operation;
+ ( void ) key_buffer;
+ ( void ) key_buffer_size;
+ ( void ) alg;
+ ( void ) hash;
+ ( void ) hash_length;
+
psa_key_location_t location =
PSA_KEY_LIFETIME_GET_LOCATION(
attributes->core.lifetime );
@@ -558,18 +564,8 @@ static inline psa_status_t psa_driver_wrapper_sign_hash_start(
default:
/* Key is declared with a lifetime not known to us */
- ( void ) status;
return( PSA_ERROR_INVALID_ARGUMENT );
}
-
- ( void ) operation;
- ( void ) key_buffer;
- ( void ) key_buffer_size;
- ( void ) alg;
- ( void ) hash;
- ( void ) hash_length;
-
- return( status );
}
static inline psa_status_t psa_driver_wrapper_sign_hash_complete(
@@ -625,8 +621,15 @@ static inline psa_status_t psa_driver_wrapper_verify_hash_start(
const uint8_t *hash, size_t hash_length,
const uint8_t *signature, size_t signature_length )
{
+ ( void ) operation;
+ ( void ) key_buffer;
+ ( void ) key_buffer_size;
+ ( void ) alg;
+ ( void ) hash;
+ ( void ) hash_length;
+ ( void ) signature;
+ ( void ) signature_length;
- psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(
attributes->core.lifetime );
@@ -660,20 +663,8 @@ static inline psa_status_t psa_driver_wrapper_verify_hash_start(
default:
/* Key is declared with a lifetime not known to us */
- ( void ) status;
return( PSA_ERROR_INVALID_ARGUMENT );
}
-
- ( void ) operation;
- ( void ) key_buffer;
- ( void ) key_buffer_size;
- ( void ) alg;
- ( void ) hash;
- ( void ) hash_length;
- ( void ) signature;
- ( void ) signature_length;
-
- return( status );
}
static inline psa_status_t psa_driver_wrapper_verify_hash_complete(
@@ -2724,6 +2715,7 @@ static inline psa_status_t psa_driver_wrapper_pake_setup(
case PSA_KEY_LOCATION_LOCAL_STORAGE:
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
+ status = PSA_ERROR_NOT_SUPPORTED;
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
status = mbedtls_test_transparent_pake_setup(
@@ -2741,9 +2733,8 @@ static inline psa_status_t psa_driver_wrapper_pake_setup(
inputs );
if( status == PSA_SUCCESS )
operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID;
- return status;
#endif
- return( PSA_ERROR_NOT_SUPPORTED );
+ return status;
/* Add cases for opaque driver here */
default:
/* Key is declared with a lifetime not known to us */
@@ -2761,6 +2752,11 @@ static inline psa_status_t psa_driver_wrapper_pake_output(
size_t output_size,
size_t *output_length )
{
+ (void) step;
+ (void) output;
+ (void) output_size;
+ (void) output_length;
+
switch( operation->id )
{
#if defined(MBEDTLS_PSA_BUILTIN_PAKE)
@@ -2778,10 +2774,6 @@ static inline psa_status_t psa_driver_wrapper_pake_output(
#endif /* PSA_CRYPTO_DRIVER_TEST */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
default:
- (void) step;
- (void) output;
- (void) output_size;
- (void) output_length;
return( PSA_ERROR_INVALID_ARGUMENT );
}
}