Skip to content

Commit 4e1b719

Browse files
committed
Improve wc_HmacUpdate to return early if input length == 0. Fixes QAT issue with HKDF test.
1 parent 50c5028 commit 4e1b719

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

wolfcrypt/src/hmac.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,9 @@ int wc_HmacUpdate(Hmac* hmac, const byte* msg, word32 length)
814814
if (hmac == NULL || (msg == NULL && length > 0)) {
815815
return BAD_FUNC_ARG;
816816
}
817+
if (length == 0) {
818+
return 0; /* nothing to do, return success */
819+
}
817820

818821
#ifdef WOLF_CRYPTO_CB
819822
if (hmac->devId != INVALID_DEVID) {

0 commit comments

Comments
 (0)