Skip to content

Commit 32eb850

Browse files
committed
Merge branch 'ci/tee_flash_prot_failures' into 'master'
ci(esp_tee): Remove incorrect error checks for TEE flash protection tests Closes IDFCI-3299, IDFCI-4947, IDFCI-4092, IDFCI-4093, and IDF-14283 See merge request espressif/esp-idf!43140
2 parents 4be7070 + e27e0eb commit 32eb850

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

components/esp_tee/subproject/components/tee_sec_storage/tee_sec_storage.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,12 @@ esp_err_t esp_tee_sec_storage_ecdsa_sign_pbkdf2(const esp_tee_sec_storage_pbkdf2
643643
return ESP_ERR_INVALID_ARG;
644644
}
645645

646-
hmac_key_id_t key_id = (hmac_key_id_t)(CONFIG_SECURE_TEE_PBKDF2_EFUSE_HMAC_KEY_ID);
647-
if (key_id < 0 || key_id >= HMAC_KEY_MAX) {
646+
int cfg_key_id = (int)CONFIG_SECURE_TEE_PBKDF2_EFUSE_HMAC_KEY_ID;
647+
if (cfg_key_id < 0 || cfg_key_id >= HMAC_KEY_MAX) {
648648
return ESP_ERR_INVALID_ARG;
649649
}
650650

651+
hmac_key_id_t key_id = (hmac_key_id_t)cfg_key_id;
651652
esp_efuse_block_t blk = (esp_efuse_block_t)(EFUSE_BLK_KEY0 + key_id);
652653
if (esp_efuse_get_key_purpose(blk) != ESP_EFUSE_KEY_PURPOSE_HMAC_UP) {
653654
ESP_LOGE(TAG, "HMAC key is not burnt in the specified eFuse block ID");

components/esp_tee/test_apps/tee_test_fw/main/test_esp_tee_flash_prot.c

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ __attribute__((unused)) static const uint32_t mmu_op_fail_seq[8] = {[0 ... 7] =
4949
} while (0)
5050
#endif
5151

52-
#if SOC_TEE_FLASH_OP_FAIL_FAULT
53-
#define CHECK_FLASH_OP_FAIL(err) TEST_ESP_ERR(ESP_FAIL, err)
54-
#else
55-
#define CHECK_FLASH_OP_FAIL(err) do { (void)(err); esp_restart(); } while (0)
56-
#endif
57-
5852
static const char *TAG = "test_esp_tee_flash_prot";
5953

6054
static void set_boot_count_in_nvs(uint8_t boot_count)
@@ -147,24 +141,21 @@ static void test_esp_partition_api_r(const esp_partition_t *part)
147141
TEST_ASSERT_NOT_NULL(part);
148142
uint8_t buf_r[128];
149143
memset(buf_r, 0x00, sizeof(buf_r));
150-
esp_err_t err = esp_partition_read(part, 0x00, buf_r, sizeof(buf_r));
151-
CHECK_FLASH_OP_FAIL(err);
144+
esp_partition_read(part, 0x00, buf_r, sizeof(buf_r));
152145
}
153146

154147
static void test_esp_partition_api_w(const esp_partition_t *part)
155148
{
156149
TEST_ASSERT_NOT_NULL(part);
157150
uint8_t buf_w[128];
158151
memset(buf_w, 0xA5, sizeof(buf_w));
159-
esp_err_t err = esp_partition_write(part, 0x00, buf_w, sizeof(buf_w));
160-
CHECK_FLASH_OP_FAIL(err);
152+
esp_partition_write(part, 0x00, buf_w, sizeof(buf_w));
161153
}
162154

163155
static void test_esp_partition_api_e(const esp_partition_t *part)
164156
{
165157
TEST_ASSERT_NOT_NULL(part);
166-
esp_err_t err = esp_partition_erase_range(part, 0x00, SPI_FLASH_SEC_SIZE);
167-
CHECK_FLASH_OP_FAIL(err);
158+
esp_partition_erase_range(part, 0x00, SPI_FLASH_SEC_SIZE);
168159
}
169160

170161
static void test_esp_partition_api(void)
@@ -269,22 +260,19 @@ static void test_esp_flash_api_r(uint32_t paddr)
269260
{
270261
uint8_t buf_r[128];
271262
memset(buf_r, 0x00, sizeof(buf_r));
272-
esp_err_t err = esp_flash_read(NULL, buf_r, paddr, sizeof(buf_r));
273-
CHECK_FLASH_OP_FAIL(err);
263+
esp_flash_read(NULL, buf_r, paddr, sizeof(buf_r));
274264
}
275265

276266
static void test_esp_flash_api_w(uint32_t paddr)
277267
{
278268
uint8_t buf_w[128];
279269
memset(buf_w, 0xA5, sizeof(buf_w));
280-
esp_err_t err = esp_flash_write(NULL, buf_w, paddr, sizeof(buf_w));
281-
CHECK_FLASH_OP_FAIL(err);
270+
esp_flash_write(NULL, buf_w, paddr, sizeof(buf_w));
282271
}
283272

284273
static void test_esp_flash_api_e(uint32_t paddr)
285274
{
286-
esp_err_t err = esp_flash_erase_region(NULL, paddr, SPI_FLASH_SEC_SIZE);
287-
CHECK_FLASH_OP_FAIL(err);
275+
esp_flash_erase_region(NULL, paddr, SPI_FLASH_SEC_SIZE);
288276
}
289277

290278
static void test_esp_flash_api(void)

0 commit comments

Comments
 (0)