We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 299f39c commit 1e9cb7eCopy full SHA for 1e9cb7e
wolfcrypt/src/hmac.c
@@ -1042,11 +1042,14 @@ int wc_HmacFinal(Hmac* hmac, byte* hash)
1042
ret = wc_Stm32_Hmac_Final(&hmac->stmCtx, hmac->stmAlgo,
1043
(const byte*)hmac->ipad, hmac->stmKeyLen, hash,
1044
hmac->stmDigestSize);
1045
+ /* Re-run Phase 1 so HMAC is ready for next Update/Final cycle
1046
+ * (needed for PRF/HKDF loops that reuse the same key) */
1047
+ if (ret == 0) {
1048
+ ret = wc_Stm32_Hmac_SetKey(&hmac->stmCtx, hmac->macType,
1049
+ (const byte*)hmac->ipad, hmac->stmKeyLen);
1050
+ }
1051
wolfSSL_CryptHwMutexUnLock();
1052
}
- if (ret == 0) {
- hmac->innerHashKeyed = 0;
- }
1053
return ret;
1054
1055
#endif /* STM32_HASH && STM32_HMAC */
0 commit comments