crypto: Fix the NULL_HMAC finalizer

The current implementation leaves the digest buffer partially
uninitialized.

Reported by:	syzkaller
Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35547
This commit is contained in:
Mark Johnston 2022-07-01 11:04:15 -04:00
parent b72f1f4516
commit 8179db52c2

View File

@ -135,6 +135,5 @@ null_update(void *ctx, const void *buf, u_int len)
static void
null_final(uint8_t *buf, void *ctx)
{
if (buf != (uint8_t *) 0)
bzero(buf, 12);
bzero(buf, NULL_HASH_LEN);
}