Skip to content

Commit 16158b4

Browse files
author
Jiang Jiang Jian
committed
Merge branch 'ci/tee_flash_prot_failures_v5.5' into 'release/v5.5'
ci(esp_tee): Remove incorrect error checks for TEE flash protection tests (v5.5) See merge request espressif/esp-idf!43160
2 parents 621ab81 + a45758d commit 16158b4

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
@@ -48,12 +48,6 @@ __attribute__((unused)) static const uint32_t mmu_op_fail_seq[8] = {[0 ... 7] =
4848
} while (0)
4949
#endif
5050

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

5953
static void set_boot_count_in_nvs(uint8_t boot_count)
@@ -146,24 +140,21 @@ static void test_esp_partition_api_r(const esp_partition_t *part)
146140
TEST_ASSERT_NOT_NULL(part);
147141
uint8_t buf_r[128];
148142
memset(buf_r, 0x00, sizeof(buf_r));
149-
esp_err_t err = esp_partition_read(part, 0x00, buf_r, sizeof(buf_r));
150-
CHECK_FLASH_OP_FAIL(err);
143+
esp_partition_read(part, 0x00, buf_r, sizeof(buf_r));
151144
}
152145

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

162154
static void test_esp_partition_api_e(const esp_partition_t *part)
163155
{
164156
TEST_ASSERT_NOT_NULL(part);
165-
esp_err_t err = esp_partition_erase_range(part, 0x00, SPI_FLASH_SEC_SIZE);
166-
CHECK_FLASH_OP_FAIL(err);
157+
esp_partition_erase_range(part, 0x00, SPI_FLASH_SEC_SIZE);
167158
}
168159

169160
static void test_esp_partition_api(void)
@@ -267,22 +258,19 @@ static void test_esp_flash_api_r(uint32_t paddr)
267258
{
268259
uint8_t buf_r[128];
269260
memset(buf_r, 0x00, sizeof(buf_r));
270-
esp_err_t err = esp_flash_read(NULL, buf_r, paddr, sizeof(buf_r));
271-
CHECK_FLASH_OP_FAIL(err);
261+
esp_flash_read(NULL, buf_r, paddr, sizeof(buf_r));
272262
}
273263

274264
static void test_esp_flash_api_w(uint32_t paddr)
275265
{
276266
uint8_t buf_w[128];
277267
memset(buf_w, 0xA5, sizeof(buf_w));
278-
esp_err_t err = esp_flash_write(NULL, buf_w, paddr, sizeof(buf_w));
279-
CHECK_FLASH_OP_FAIL(err);
268+
esp_flash_write(NULL, buf_w, paddr, sizeof(buf_w));
280269
}
281270

282271
static void test_esp_flash_api_e(uint32_t paddr)
283272
{
284-
esp_err_t err = esp_flash_erase_region(NULL, paddr, SPI_FLASH_SEC_SIZE);
285-
CHECK_FLASH_OP_FAIL(err);
273+
esp_flash_erase_region(NULL, paddr, SPI_FLASH_SEC_SIZE);
286274
}
287275

288276
static void test_esp_flash_api(void)

0 commit comments

Comments
 (0)