]> git.proxmox.com Git - mirror_edk2.git/commit
CryptoPkg/BaseCryptLib: replace HmacXxxInit API with HmacXxxSetKey
authorJian J Wang <jian.j.wang@intel.com>
Fri, 17 Jan 2020 03:05:40 +0000 (11:05 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 20 Jan 2020 16:41:23 +0000 (16:41 +0000)
commita23fdff6fb99bcf7ac226f0a1095c0bdd26b0468
tree8b118eed37c0759aff3004320895318277e57bbc
parent5cd3d4bc43e543caf5f78baaacced8aaf04c1d91
CryptoPkg/BaseCryptLib: replace HmacXxxInit API with HmacXxxSetKey

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1792

HmacXxxInit() is supposed to be initialize user supplied buffer as HMAC
context, as well as user supplied key. Currently it has no real use cases.

Due to BZ1792, the user has no way to get correct size of context buffer
after it's fixed, and then cannot make use of HmacXxxInit to initialize
it.

So it's decided to replace it with HmacXxxSetKey to keep the functionality
of supplying a key to HMAC, but drop all other initialization works. The
user can still get HMAC context via HmacXxxNew interface, which hides the
details about the context.

Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Xiaoyu Lu <xiaoyux.lu@intel.com>
CryptoPkg/Include/Library/BaseCryptLib.h
CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacMd5.c
CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacMd5Null.c
CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1.c
CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1Null.c
CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c
CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacMd5Null.c
CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacSha1Null.c
CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacSha256Null.c