diff --git a/components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c b/components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c index fafd0a463e..26e61d962f 100644 --- a/components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c +++ b/components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c @@ -919,7 +919,6 @@ psa_status_t psa_generate_random( uint8_t *output, return( ( psa_status_t ) err_call ); } -#if ( defined(MBEDTLS_ENTROPY_NV_SEED) && defined(MBEDTLS_PSA_HAS_ITS_IO) ) /****************************************************************/ /* PSA_ENTROPY_INJECT */ /****************************************************************/ @@ -942,7 +941,6 @@ psa_status_t mbedtls_psa_inject_entropy( const unsigned char *seed, return( ( psa_status_t ) err_call ); } -#endif /****************************************************************/ /* PSA Generator */ /****************************************************************/ diff --git a/components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c b/components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c index 5a9daa54da..7632d00c56 100755 --- a/components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c +++ b/components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c @@ -1115,13 +1115,13 @@ static void psa_key_management_operation( void ) psa_reply( msg.handle, status ); } -#if defined(MBEDTLS_ENTROPY_NV_SEED) static void psa_entropy_operation( void ) { psa_msg_t msg = { 0 }; psa_status_t status = PSA_SUCCESS; psa_get( PSA_ENTROPY_INJECT, &msg ); +#if ( defined(MBEDTLS_ENTROPY_NV_SEED) && defined(MBEDTLS_PSA_HAS_ITS_IO) ) switch ( msg.type ) { case PSA_IPC_CONNECT: @@ -1162,9 +1162,12 @@ static void psa_entropy_operation( void ) break; } } +#else + status = PSA_ERROR_NOT_SUPPORTED; +#endif /* MBEDTLS_ENTROPY_NV_SEED && MBEDTLS_PSA_HAS_ITS_IO*/ psa_reply( msg.handle, status ); } -#endif + static void psa_rng_operation( void ) { @@ -1424,11 +1427,9 @@ void part_main(void *ptr) { psa_crypto_generator_operations( ); } -#if defined(MBEDTLS_ENTROPY_NV_SEED) if( signals & PSA_ENTROPY_INJECT ) { psa_entropy_operation( ); } -#endif /* MBEDTLS_ENTROPY_NV_SEED */ } }