@@ -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,18 +2102,19 @@ 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" );
21142114 hsm_ret = wh_Server_CertVerify (
21152115 & hsmServerCtx , cert_chain , cert_chain_size , hsmNvmIdCertRootCA ,
2116- WH_CERT_FLAGS_CACHE_LEAF_PUBKEY , & g_certLeafKeyId );
2116+ WH_CERT_FLAGS_CACHE_LEAF_PUBKEY , WH_NVM_FLAGS_USAGE_VERIFY ,
2117+ & g_certLeafKeyId );
21172118 if (hsm_ret == WH_ERROR_OK ) {
21182119 cert_verify_result = 0 ;
21192120 }
0 commit comments