ci(esp_security): Add config to enable FPGA-related tests

This commit is contained in:
harshal.patil
2024-10-03 15:17:22 +05:30
parent 9e3a846356
commit e12c261b1b
7 changed files with 28 additions and 10 deletions
@@ -0,0 +1,9 @@
menu "ESP Security Tests"
config ESP_SECURITY_ENABLE_FPGA_TESTS
bool "Allow enabling the esp_security tests that require burning efuses"
default y if IDF_ENV_FPGA
default n
help
This includes the esp_security tests that actually require burning some efuses.
It is better to run these tests on an FPGA to avoid mistakenly burning eFuses.
endmenu
@@ -255,7 +255,7 @@ TEST_CASE("Digital Signature Blocking HMAC key out of range", "[hw_crypto] [ds]"
TEST_ASSERT_EQUAL(ESP_ERR_INVALID_ARG, esp_ds_sign(message, &ds_data, HMAC_KEY0 - 1, signature_data));
}
#if CONFIG_IDF_ENV_FPGA
#if CONFIG_ESP_SECURITY_ENABLE_FPGA_TESTS
static void burn_hmac_keys(void)
{
@@ -435,4 +435,4 @@ TEST_CASE("Digital Signature Invalid Data (FPGA only)", "[hw_crypto] [ds]")
}
}
#endif // CONFIG_IDF_ENV_FPGA
#endif // CONFIG_ESP_SECURITY_ENABLE_FPGA_TESTS
@@ -10,7 +10,7 @@
#include "esp_log.h"
#include "esp_hmac.h"
#if CONFIG_IDF_ENV_FPGA
#if CONFIG_ESP_SECURITY_ENABLE_FPGA_TESTS
/* Allow testing varying message lengths (truncating the same message)
for various results */
@@ -1297,7 +1297,7 @@ TEST_CASE("HMAC 'upstream' wait lock", "[hw_crypto]")
}
}
#endif // CONFIG_IDF_ENV_FPGA
#endif // CONFIG_ESP_SECURITY_ENABLE_FPGA_TESTS
/**
* This test is just a parameter test and does not write any keys to efuse.