Skip to content

Commit eb7c565

Browse files
committed
test(esp_security): Extend the key manager tests
1 parent ea322ee commit eb7c565

File tree

6 files changed

+1522
-1272
lines changed

6 files changed

+1522
-1272
lines changed

components/esp_security/test_apps/crypto_drivers/main/hmac_key.bin

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+

2+


components/esp_security/test_apps/crypto_drivers/main/hmac_test_cases.h

Lines changed: 1200 additions & 0 deletions
Large diffs are not rendered by default.

components/esp_security/test_apps/crypto_drivers/main/test_ds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ TEST_CASE("Digital Signature start HMAC key out of range", "[hw_crypto] [ds]")
184184
esp_ds_context_t *ctx;
185185
const char *message = "test";
186186

187-
TEST_ASSERT_EQUAL(ESP_ERR_INVALID_ARG, esp_ds_start_sign(message, &ds_data, HMAC_KEY5 + 1, &ctx));
187+
TEST_ASSERT_EQUAL(ESP_ERR_INVALID_ARG, esp_ds_start_sign(message, &ds_data, HMAC_KEY_MAX, &ctx));
188188
TEST_ASSERT_EQUAL(ESP_ERR_INVALID_ARG, esp_ds_start_sign(message, &ds_data, HMAC_KEY0 - 1, &ctx));
189189
}
190190

@@ -255,7 +255,7 @@ TEST_CASE("Digital Signature Blocking HMAC key out of range", "[hw_crypto] [ds]"
255255
const char *message = "test";
256256
uint8_t signature_data [128 * 4];
257257

258-
TEST_ASSERT_EQUAL(ESP_ERR_INVALID_ARG, esp_ds_sign(message, &ds_data, HMAC_KEY5 + 1, signature_data));
258+
TEST_ASSERT_EQUAL(ESP_ERR_INVALID_ARG, esp_ds_sign(message, &ds_data, HMAC_KEY_MAX, signature_data));
259259
TEST_ASSERT_EQUAL(ESP_ERR_INVALID_ARG, esp_ds_sign(message, &ds_data, HMAC_KEY0 - 1, signature_data));
260260
}
261261

0 commit comments

Comments
 (0)