]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[crypto] Simplify internal HMAC API
authorMichael Brown <mcb30@ipxe.org>
Sun, 9 Oct 2022 14:14:41 +0000 (15:14 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 10 Oct 2022 11:21:54 +0000 (12:21 +0100)
commit007d3cb800fd0e4b01be8a76f0cce2c795cfc89b
treeb2c065f186542751e784f178a73da8066ab0dc06
parent88419b608d71247445de287c9f8bebbf5e33e0c8
[crypto] Simplify internal HMAC API

Simplify the internal HMAC API so that the key is provided only at the
point of calling hmac_init(), and the (potentially reduced) key is
stored as part of the context for later use by hmac_final().

This simplifies the calling code, and avoids the need for callers such
as TLS to allocate a potentially variable length block in order to
retain a copy of the unmodified key.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
16 files changed:
src/crypto/hmac.c
src/crypto/hmac_drbg.c
src/crypto/ntlm.c
src/crypto/sha1extra.c
src/include/ipxe/hmac.h
src/include/ipxe/md4.h
src/include/ipxe/md5.h
src/include/ipxe/sha1.h
src/include/ipxe/sha256.h
src/include/ipxe/sha512.h
src/net/80211/wpa_ccmp.c
src/net/80211/wpa_tkip.c
src/net/pccrc.c
src/net/tls.c
src/tests/hmac_test.c
src/tests/pccrc_test.c