Skip to content

Commit 7639b60

Browse files
committed
bootutil: Cut down allowed TLV list
For some of TLV types we exactly know which are expected. Signed-off-by: Dominik Ermel <[email protected]>
1 parent cfd876f commit 7639b60

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

boot/bootutil/src/image_validate.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -448,16 +448,15 @@ static int bootutil_check_for_pure(const struct image_header *hdr,
448448
* TLV section. All other TLV entries must be in the protected section.
449449
*/
450450
static const uint16_t allowed_unprot_tlvs[] = {
451-
IMAGE_TLV_KEYHASH,
452-
IMAGE_TLV_PUBKEY,
453-
IMAGE_TLV_SHA256,
454-
IMAGE_TLV_SHA384,
455-
IMAGE_TLV_SHA512,
456-
IMAGE_TLV_RSA2048_PSS,
457-
IMAGE_TLV_ECDSA224,
458-
IMAGE_TLV_ECDSA_SIG,
459-
IMAGE_TLV_RSA3072_PSS,
460-
IMAGE_TLV_ED25519,
451+
#if defined(EXPECTED_KEY_TLV)
452+
EXPECTED_KEY_TLV,
453+
#endif
454+
#if defined(EXPECTED_HASH_TLV)
455+
EXPECTED_HASH_TLV,
456+
#endif
457+
#if defined(EXPECTED_SIG_TLV)
458+
EXPECTED_SIG_TLV,
459+
#endif
461460
#if defined(MCUBOOT_SIGN_PURE)
462461
IMAGE_TLV_SIG_PURE,
463462
#endif

0 commit comments

Comments
 (0)