Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CryptoPkg: Add HMAC-SHA384 cipher support. #3385

Merged
merged 5 commits into from
Sep 23, 2022
Merged

Conversation

jyao1
Copy link
Contributor

@jyao1 jyao1 commented Sep 23, 2022

HmacSha256 is already supported on Edk2. This patchset is to add
HmacSha384 support.

With this change, the size increase of BaseCyrptLib is about 7K bytes.
HmacSha384 function is verifed by the Host UnitTest.
And also it has been integratd in
https://github.com/tianocore/edk2-staging/tree/DeviceSecurity and been
verified.

All the code change is on the PR #3224.

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

V2: address the comments to V1 change.

Signed-off-by: Qi Zhang qi1.zhang@intel.com
Cc: Jiewen Yao jiewen.yao@intel.com
Cc: Jian J Wang jian.j.wang@intel.com
Cc: Xiaoyu Lu xiaoyu1.lu@intel.com
Cc: Guomin Jiang guomin.jiang@intel.com
Reviewed-by: Jiewen Yao jiewen.yao@intel.com

Qi Zhang (5):
CryptoPkg: Add new hmac definition to cryptlib
CryptoPkg: Add HMAC-SHA384 cipher support.
CryptoPkg: Update CryptLib inf as the file name changed.
CryptoPkg: Add new hmac SHA api to Crypto Service.
CryptoPkg: add Hmac Sha384 to host UnitTest.

CryptoPkg/CryptoPkg.dsc | 3 +
CryptoPkg/Driver/Crypto.c | 224 ++++++-
CryptoPkg/Include/Library/BaseCryptLib.h | 188 ++++++
.../Pcd/PcdCryptoServiceFamilyEnable.h | 13 +
.../Library/BaseCryptLib/BaseCryptLib.inf | 2 +-
.../Library/BaseCryptLib/Hmac/CryptHmac.c | 629 ++++++++++++++++++
.../Library/BaseCryptLib/Hmac/CryptHmacNull.c | 359 ++++++++++
.../BaseCryptLib/Hmac/CryptHmacSha256.c | 217 ------
.../BaseCryptLib/Hmac/CryptHmacSha256Null.c | 139 ----
.../Library/BaseCryptLib/PeiCryptLib.inf | 2 +-
.../Library/BaseCryptLib/RuntimeCryptLib.inf | 2 +-
.../Library/BaseCryptLib/SecCryptLib.inf | 2 +-
.../Library/BaseCryptLib/SmmCryptLib.inf | 2 +-
.../BaseCryptLib/UnitTestHostBaseCryptLib.inf | 2 +-
.../BaseCryptLibNull/BaseCryptLibNull.inf | 2 +-
.../BaseCryptLibNull/Hmac/CryptHmacNull.c | 359 ++++++++++
.../Hmac/CryptHmacSha256Null.c | 139 ----
.../BaseCryptLibOnProtocolPpi/CryptLib.c | 212 ++++++
CryptoPkg/Private/Protocol/Crypto.h | 200 +++++-
.../UnitTest/Library/BaseCryptLib/HmacTests.c | 19 +
20 files changed, 2211 insertions(+), 504 deletions(-)
create mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmac.c
create mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacNull.c
delete mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c
delete mode 100644 CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
create mode 100644 CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacNull.c
delete mode 100644 CryptoPkg/Library/BaseCryptLibNull/Hmac/CryptHmacSha256Null.c

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

Signed-off-by: Qi Zhang <qi1.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Rename file from CryptHmacSha256 to CryptHmac and
add HmacSha384 and HmacSha256All funcitons.

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

Signed-off-by: Qi Zhang <qi1.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4025

Signed-off-by: Qi Zhang <qi1.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4025

Signed-off-by: Qi Zhang <qi1.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4025

Signed-off-by: Qi Zhang <qi1.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
@jyao1 jyao1 added the push Auto push patch series in PR if all checks pass label Sep 23, 2022
@mergify mergify bot merged commit f3c69cb into tianocore:master Sep 23, 2022
@jyao1 jyao1 deleted the patch branch September 23, 2022 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
push Auto push patch series in PR if all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants