Skip to content

Commit d01077d

Browse files
committed
Adfressed copilot's comments
1 parent 5176764 commit d01077d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

tools/unit-tests/unit-image.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,8 @@ START_TEST(test_sha_ops)
446446
#if defined(WOLFBOOT_SIGN_ECC256)
447447
ck_assert_mem_eq(hash, pubkey_digest, SHA256_DIGEST_SIZE);
448448
#else
449-
{
450-
uint8_t hash2[SHA256_DIGEST_SIZE];
451-
key_sha256(0, hash2);
452-
ck_assert_mem_eq(hash, hash2, SHA256_DIGEST_SIZE);
453-
}
449+
/* For non-ECC256 configurations we do not have a fixed expected digest. */
450+
(void)hash;
454451
#endif
455452
}
456453
END_TEST

tools/unit-tests/unit-keystore.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,15 @@
8989
}
9090
#endif
9191

92+
#if defined(KEYSTORE_ANY)
93+
#if UNIT_PUBKEY_SIZE > KEYSTORE_PUBKEY_SIZE
94+
#error Key algorithm mismatch. Remove old keys via 'make keysclean'
95+
#endif
96+
#else
9297
#if KEYSTORE_PUBKEY_SIZE != UNIT_PUBKEY_SIZE
9398
#error Key algorithm mismatch. Remove old keys via 'make keysclean'
9499
#endif
100+
#endif
95101

96102
#define NUM_PUBKEYS 1
97103
const KEYSTORE_SECTION struct keystore_slot PubKeys[NUM_PUBKEYS] = {

0 commit comments

Comments
 (0)