Skip to content

Commit 547dbb0

Browse files
committed
add wolfHSM verify key usage flags
1 parent 27c5f0e commit 547dbb0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/image.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,8 @@ static void wolfBoot_verify_signature_rsa(uint8_t key_slot,
486486
#else
487487
whKeyId hsmKeyId = WH_KEYID_ERASED;
488488
/* Cache the public key on the server */
489-
ret = wh_Client_KeyCache(&hsmClientCtx, 0, NULL, 0, pubkey, pubkey_sz,
490-
&hsmKeyId);
489+
ret = wh_Client_KeyCache(&hsmClientCtx, WH_NVM_FLAGS_USAGE_VERIFY, NULL, 0,
490+
pubkey, pubkey_sz, &hsmKeyId);
491491
if (ret != WH_ERROR_OK) {
492492
return;
493493
}
@@ -2102,12 +2102,12 @@ int wolfBoot_verify_authenticity(struct wolfBoot_image *img)
21022102
"verifying cert chain and caching leaf pubkey (using DMA)\n");
21032103
hsm_ret = wh_Client_CertVerifyDmaAndCacheLeafPubKey(
21042104
&hsmClientCtx, cert_chain, cert_chain_size, hsmNvmIdCertRootCA,
2105-
&g_certLeafKeyId, &cert_verify_result);
2105+
WH_NVM_FLAGS_USAGE_VERIFY, &g_certLeafKeyId, &cert_verify_result);
21062106
#else
21072107
wolfBoot_printf("verifying cert chain and caching leaf pubkey\n");
21082108
hsm_ret = wh_Client_CertVerifyAndCacheLeafPubKey(
21092109
&hsmClientCtx, cert_chain, cert_chain_size, hsmNvmIdCertRootCA,
2110-
&g_certLeafKeyId, &cert_verify_result);
2110+
WH_NVM_FLAGS_USAGE_VERIFY, &g_certLeafKeyId, &cert_verify_result);
21112111
#endif
21122112
#elif defined(WOLFBOOT_ENABLE_WOLFHSM_SERVER)
21132113
wolfBoot_printf("verifying cert chain and caching leaf pubkey\n");

0 commit comments

Comments
 (0)