diff --git a/components/esp-tls/test_apps/main/app_main.c b/components/esp-tls/test_apps/main/app_main.c index 050d90b205..401a39d745 100644 --- a/components/esp-tls/test_apps/main/app_main.c +++ b/components/esp-tls/test_apps/main/app_main.c @@ -28,9 +28,11 @@ void setUp(void) { // Execute esp_sha operation to allocate internal SHA semaphore memory // which is considered as leaked otherwise +#if SOC_SHA_SUPPORTED const uint8_t input_buffer[64] = {0}; uint8_t output_buffer[64]; esp_sha(SHA_TYPE, input_buffer, sizeof(input_buffer), output_buffer); +#endif // SOC_SHA_SUPPORTED test_utils_record_free_mem(); TEST_ESP_OK(test_utils_set_leak_level(0, ESP_LEAK_TYPE_CRITICAL, ESP_COMP_LEAK_GENERAL)); TEST_ESP_OK(test_utils_set_leak_level(0, ESP_LEAK_TYPE_WARNING, ESP_COMP_LEAK_GENERAL)); diff --git a/components/mbedtls/test_apps/main/test_sha.c b/components/mbedtls/test_apps/main/test_sha.c index a40c70ee3d..cfc38ae4ae 100644 --- a/components/mbedtls/test_apps/main/test_sha.c +++ b/components/mbedtls/test_apps/main/test_sha.c @@ -33,6 +33,7 @@ are tested as part of mbedTLS tests. Only esp_sha() is different. #define TAG "sha_test" +#if SOC_SHA_SUPPORTED TEST_CASE("Test esp_sha()", "[hw_crypto]") { const size_t BUFFER_SZ = 32 * 1024 + 6; // NB: not an exact multiple of SHA block size @@ -136,3 +137,5 @@ TEST_CASE("Test esp_sha() function with long input", "[hw_crypto]") TEST_ASSERT_EQUAL_MEMORY_MESSAGE(sha512_espsha, sha512_mbedtls, sizeof(sha512_espsha), "SHA512 results should match"); #endif } + +#endif // SOC_SHA_SUPPORTED