Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielinux committed Oct 28, 2024
1 parent 5128ea7 commit 81cb46d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/unit-tests/unit-image.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

#define ENCRYPT_KEY "123456789abcdef0123456789abcdef0123456789abcdef"
#define KEYSTORE_PUBKEY_SIZE KEYSTORE_PUBKEY_SIZE_ECC256
#define WOLFBOOT_SIGN_PRIMARY_ECC256

#include <stdio.h>
#include <check.h>
Expand Down Expand Up @@ -289,17 +290,17 @@ START_TEST(test_verify_signature)
test_img.fw_size = test_img_len;
test_img.fw_base = 0;

wolfBoot_verify_signature(0, NULL, NULL);
wolfBoot_verify_signature_ecc(0, NULL, NULL);
ck_assert_int_eq(verify_called, 0);

ecc_init_fail = 1;
wolfBoot_verify_signature(0, NULL, pubkey);
wolfBoot_verify_signature_ecc(0, NULL, pubkey);
ck_assert_int_eq(verify_called, 0);

ecc_init_fail = 0;
verify_called = 0;
ecc_import_fail = 1;
wolfBoot_verify_signature(0, NULL, pubkey);
wolfBoot_verify_signature_ecc(0, NULL, pubkey);
ck_assert_int_eq(verify_called, 0);

ecc_init_fail = 0;
Expand All @@ -309,7 +310,7 @@ START_TEST(test_verify_signature)
ext_flash_erase(0, 2 * WOLFBOOT_SECTOR_SIZE);
ext_flash_write(0, test_img_v200000000_signed_bin,
test_img_len);
wolfBoot_verify_signature(0, &test_img, pubkey);
wolfBoot_verify_signature_ecc(0, &test_img, pubkey);
ck_assert_int_eq(verify_called, 1);
}
END_TEST
Expand Down

0 comments on commit 81cb46d

Please sign in to comment.