From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: devel@edk2.groups.io
Cc: Jiewen Yao <jiewen.yao@intel.com>,
Jian J Wang <jian.j.wang@intel.com>,
Xiaoyu Lu <xiaoyux.lu@intel.com>,
Guomin Jiang <guomin.jiang@intel.com>
Subject: [Patch v2][edk2-stable202011 4/4] CryptoPkg/Test/UnitTest/Library/BaseCryptLib: Fix MD5 Hash tests
Date: Tue, 24 Nov 2020 21:07:58 -0800 [thread overview]
Message-ID: <20201125050758.1507-5-michael.d.kinney@intel.com> (raw)
In-Reply-To: <20201125050758.1507-1-michael.d.kinney@intel.com>
Only include MD5 unit tests if ENABLE_MD5_DEPRECATED_INTERFACES
is defined.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
CryptoPkg/Test/UnitTest/Library/BaseCryptLib/HashTests.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/CryptoPkg/Test/UnitTest/Library/BaseCryptLib/HashTests.c b/CryptoPkg/Test/UnitTest/Library/BaseCryptLib/HashTests.c
index bc47c5736246..24919053324a 100644
--- a/CryptoPkg/Test/UnitTest/Library/BaseCryptLib/HashTests.c
+++ b/CryptoPkg/Test/UnitTest/Library/BaseCryptLib/HashTests.c
@@ -21,10 +21,11 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *HashData = "abc";
//
// Result for MD5("abc"). (From "A.5 Test suite" of IETF RFC1321)
//
+#ifdef ENABLE_MD5_DEPRECATED_INTERFACES
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 Md5Digest[MD5_DIGEST_SIZE] = {
0x90, 0x01, 0x50, 0x98, 0x3c, 0xd2, 0x4f, 0xb0, 0xd6, 0x96, 0x3f, 0x7d, 0x28, 0xe1, 0x7f, 0x72
-
};
+#endif
//
// Result for SHA-1("abc"). (From "A.1 SHA-1 Example" of NIST FIPS 180-2)
@@ -107,7 +108,9 @@ typedef struct {
VOID *HashCtx;
} HASH_TEST_CONTEXT;
+#ifdef ENABLE_MD5_DEPRECATED_INTERFACES
HASH_TEST_CONTEXT mMd5TestCtx = {MD5_DIGEST_SIZE, Md5GetContextSize, Md5Init, Md5Update, Md5Final, Md5HashAll, Md5Digest};
+#endif
HASH_TEST_CONTEXT mSha1TestCtx = {SHA1_DIGEST_SIZE, Sha1GetContextSize, Sha1Init, Sha1Update, Sha1Final, Sha1HashAll, Sha1Digest};
HASH_TEST_CONTEXT mSha256TestCtx = {SHA256_DIGEST_SIZE, Sha256GetContextSize, Sha256Init, Sha256Update, Sha256Final, Sha256HashAll, Sha256Digest};
HASH_TEST_CONTEXT mSha384TestCtx = {SHA384_DIGEST_SIZE, Sha384GetContextSize, Sha384Init, Sha384Update, Sha384Final, Sha384HashAll, Sha384Digest};
@@ -187,7 +190,9 @@ TEST_DESC mHashTest[] = {
//
// -----Description----------------Class---------------------Function---------------Pre------------------Post------------Context
//
+#ifdef ENABLE_MD5_DEPRECATED_INTERFACES
{"TestVerifyMd5()", "CryptoPkg.BaseCryptLib.Hash", TestVerifyHash, TestVerifyHashPreReq, TestVerifyHashCleanUp, &mMd5TestCtx},
+#endif
{"TestVerifySha1()", "CryptoPkg.BaseCryptLib.Hash", TestVerifyHash, TestVerifyHashPreReq, TestVerifyHashCleanUp, &mSha1TestCtx},
{"TestVerifySha256()", "CryptoPkg.BaseCryptLib.Hash", TestVerifyHash, TestVerifyHashPreReq, TestVerifyHashCleanUp, &mSha256TestCtx},
{"TestVerifySha384()", "CryptoPkg.BaseCryptLib.Hash", TestVerifyHash, TestVerifyHashPreReq, TestVerifyHashCleanUp, &mSha384TestCtx},
--
2.29.2.windows.2
next prev parent reply other threads:[~2020-11-25 5:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 5:07 [Patch v2][edk2-stable202011 0/4] Address EDK II CI Failures Michael D Kinney
2020-11-25 5:07 ` [Patch v2][edk2-stable202011 1/4] .azurepipelines/templates/pr-gate-steps.yml: Fetch target branch Michael D Kinney
2020-11-25 5:07 ` [Patch v2][edk2-stable202011 2/4] .azurepipelines/templates/platform-build-run-steps.yml: " Michael D Kinney
2020-11-25 5:07 ` [Patch v2][edk2-stable202011 3/4] OvmfPkg/PlatformCI/.azurepiplines: Use stable release of QEMU Michael D Kinney
2020-11-25 8:01 ` [edk2-devel] " Philippe Mathieu-Daudé
2020-11-25 16:23 ` Michael D Kinney
2021-01-08 9:43 ` chocolatey.org instability [was: OvmfPkg/PlatformCI/.azurepiplines: Use stable release of QEMU] Laszlo Ersek
2020-11-25 14:11 ` [Patch v2][edk2-stable202011 3/4] OvmfPkg/PlatformCI/.azurepiplines: Use stable release of QEMU Laszlo Ersek
2020-11-25 14:57 ` [edk2-devel] " Rebecca Cran
2020-11-25 16:20 ` Michael D Kinney
2020-11-25 19:35 ` Rebecca Cran
2020-12-01 1:55 ` Michael D Kinney
2020-11-25 5:07 ` Michael D Kinney [this message]
2020-11-25 7:31 ` [edk2-devel] [Patch v2][edk2-stable202011 4/4] CryptoPkg/Test/UnitTest/Library/BaseCryptLib: Fix MD5 Hash tests Gao, Zhichao
2020-11-25 16:39 ` Michael D Kinney
2020-11-25 8:27 ` Yao, Jiewen
2020-11-25 5:11 ` [edk2-devel] [Patch v2][edk2-stable202011 0/4] Address EDK II CI Failures Michael D Kinney
2020-11-25 5:31 ` 回复: " gaoliming
2020-11-25 18:16 ` Michael D Kinney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201125050758.1507-5-michael.d.kinney@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox