Commit graph

35 commits

Author SHA1 Message Date
Michael G.A. Holland
2b842a2081 CryptoPkg/BaseCryptLib: Add SLH-DSA Support
Created SLH-DSA API functions to configure public and private keys for
SLH-DSA algorithm.  This will allow users to sign and verify with
SLH-DSA.  Unit tests were added to confirm operation of the API.

Signed-off-by: Michael G.A. Holland <michael.holland@intel.com>
2026-07-21 09:17:50 +00:00
Michael G.A. Holland
5309cdb92c CryptoPkg/BaseCryptLib: EdDsa updates
Include validation checks for Context and ContextSize in
sign and verify functions.
Returned FALSE for EdDsaGeneratePubKey.
Updated ReadMe to show EdDsa support

Signed-off-by: Michael G.A. Holland <michael.holland@intel.com>
2026-07-20 03:23:22 +00:00
Michael G.A. Holland
0f07c187d0 CryptoPkg/BaseCryptLib: Add ML-DSA Support
Created ML-DSA API functions to configure public and private keys for
ML-DSA algorithm.  This will allow users to sign and verify with ML-DSA.
Unit tests were add to confirm operation of the API.

Signed-off-by: Michael G.A. Holland <michael.holland@intel.com>
2026-07-14 03:26:52 +00:00
Michael G.A. Holland
7bd23c60e8 CryptoPkg/BaseCryptLib: Add ED448 verification and signature fcns
Implemented signature and verification functions for ED448;
  Updated documentation and unit tests to cover new verification functions

Signed-off-by: Michael G.A. Holland <michael.holland@intel.com>
2026-07-01 01:26:24 +00:00
Baraneedharan Anbazhagan
b3fdc0994d CryptoPkg: Add digest-based RSA-PSS sign and verify APIs
Add RsaPssSignDigest() and RsaPssVerifyDigest() to BaseCryptLib for
signing/verifying precomputed digests. Provide OpenSSL/MbedTLS/Null
implementations, expose via EDKII_CRYPTO_PROTOCOL (v24), and add PCD
controls for independent service enabling. Include unit tests.

Signed-off-by: Anbazhagan Baraneedharan <anbazhagan@hp.com>
2026-04-07 12:26:54 +00:00
Michael Kubacki
0f42cae11c CryptoPkg: Replace include guards with #pragma once
Replace traditional `#ifndef`/`#define`/`#endif` include guards with
`#pragma` once.

`#pragma once` is a widely supported preprocessor directive that
prevents header files from being included multiple times. It is
supported by all toolchains used to build edk2: GCC, Clang/LLVM, and
MSVC.

Does not include updates to OpenSSL generated header files checked
into the repo. Those in `CryptoPkg\Library\OpensslLib\OpensslGen\`.

Compared to macro-based include guards, `#pragma once`:

- Eliminates the risk of macro name collisions or copy/paste errors
  where two headers inadvertently use the same guard macro.
- Eliminate inconsistency in the way include guard macros are named
  (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.).
- Reduces boilerplate (three lines replaced by one).
- Avoids polluting the macro namespace with guard symbols.
- Can improve build times as the preprocessor can skip re-opening the
  file entirely, rather than re-reading it to find the matching
  `#endif` ("multiple-include optimization").
  - Note that some compilers may already optimize traditional include
    guards, by recognzining the idiomatic pattern.

This change is made acknowledging that overall portability of the
code will technically be reduced, as `#pragma once` is not part of the
C/C++ standards.

However, this is considered acceptable given:

1. edk2 already defines a subset of supported compilers in
   BaseTools/Conf/tools_def.template, all of which have supported
   `#pragma once` for over two decades.
2. There have been concerns raised to the project about inconsistent
   include guard naming and potential macro collisions.

Approximate compiler support dates:

- MSVC: Supported since Visual C++ 4.2 (1996)
- GCC: Supported since 3.4 (2004)
  (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html)
- Clang (LLVM based): Since initial release in 2007

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-02-23 21:01:28 +00:00
Longhaox Lee
51e2c18a53 CryptoPkg/BaseCryptLibUnitTest: Separate MbedTls UnitTest Library.
Separate Unit test functions for MbedTls.

BaseCryptLibMbedTls does not support all Crypto services
So deprecate below function for MbedTls Unit test:

TestVerifyEKUsWith3CertsInSignature()
TestVerifyEKUsWith2CertsInSignature()
TestNoEKUsInSignature()
TestVerifyRsaCertPkcs1SignVerify
TestVerifyPkcs7SignVerifyNonSelfIssued()
TestVerifyDhGenerateKey()
Pkcs1v2Decrypt
Pkcs1v2EncryptDecrypt
RsaOaepEncrypt (Interface)
RsaOaepEncrypt (NoSeed)
RsaOaepEncrypt (Seeded)
RsaOaepDecrypt
RsaOaepEncryptDecrypt
RsaOaepEncryptPkcs1v2Decrypt
Pkcs1v2EncryptRsaOaepDecrypt
RsaOaepEncrypt (MdDefaultMgf1Default)
RsaOaepDecrypt (MdDefaultMgf1Default)
RsaOaepEncryptDecrypt (MdDefaultMgf1Default)
RsaOaepEncrypt (MdSha1Bgf1Sha1
RsaOaepDecrypt (MdSha1Bgf1Sha1)
RsaOaepEncryptDecrypt (MdSha1Bgf1Sha1)
RsaOaepEncrypt (MdSha256Bgf1Sha256)
RsaOaepDecrypt (MdSha256Bgf1Sha256)
RsaOaepEncryptDecrypt (MdSha256Bgf1Sha256)
TestVerifyBn()
TestVerifyEcKey()
TestPkcs7Attached()
TestPkcs7Detached()
TestVerifyPkcs7ContentData()

REF: https://github.com/tianocore/edk2/issues/11605
Signed-off-by: Longhaox Lee <longhaox.lee@intel.com>
2025-11-24 13:10:50 +00:00
Longhaox Lee
3e55bab1a5 CryptoPkg: Unit test for Pkcs7GetAttachedContent()
MbebTls no support signature with content data.
test would be fail in below test case:
TestPkcs7Attached
TestPkcs7Detached
TestVerifyPkcs7ContentData

REF: https://github.com/tianocore/edk2/issues/11605
Signed-off-by: Longhaox Lee <longhaox.lee@intel.com>
2025-11-24 13:10:50 +00:00
Philipp Schuster
f7cba3671e CryptoPkg: fix various typos
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
2025-11-21 21:49:59 +00:00
Yi Li
31402d2a31 CryptoPkg: Add Unit Test Host of Mbedtls CryptoLib
Currently BaseCryptLibMbedTls does not support all Crypto services,
so the following case will fail:
TestVerifyEKUsWith3CertsInSignature()
TestVerifyEKUsWith2CertsInSignature()
TestNoEKUsInSignature()
TestVerifyRsaCertPkcs1SignVerify
TestVerifyPkcs7SignVerifyNonSelfIssued()
TestVerifyDhGenerateKey()
Pkcs1v2Decrypt
Pkcs1v2EncryptDecrypt
RsaOaepEncrypt (Interface)
RsaOaepEncrypt (NoSeed)
RsaOaepEncrypt (Seeded)
RsaOaepDecrypt
RsaOaepEncryptDecrypt
RsaOaepEncryptPkcs1v2Decrypt
Pkcs1v2EncryptRsaOaepDecrypt
RsaOaepEncrypt (MdDefaultMgf1Default)
RsaOaepDecrypt (MdDefaultMgf1Default)
RsaOaepEncryptDecrypt (MdDefaultMgf1Default)
RsaOaepEncrypt (MdSha1Bgf1Sha1
RsaOaepDecrypt (MdSha1Bgf1Sha1)
RsaOaepEncryptDecrypt (MdSha1Bgf1Sha1)
RsaOaepEncrypt (MdSha256Bgf1Sha256)
RsaOaepDecrypt (MdSha256Bgf1Sha256)
RsaOaepEncryptDecrypt (MdSha256Bgf1Sha256)
TestVerifyBn()
TestVerifyEcKey()

Signed-off-by: Yi Li <yi1.li@intel.com>
2025-08-26 10:01:25 +00:00
Yi Li
dc9cdf6c90 CryptoPkg: Add PKCS7 test case for partial certificate chains
This case uses a non-self-issued certificate as the signing
certificate and CA.
BaseCryptLib can pass this case (X509_V_FLAG_PARTIAL_CHAIN ​​enabled).
BaseCryptLibMbedTls cannot, because Mbedtls certificate chain
validation lacks support for partial certificate chains currently.

Signed-off-by: Yi Li <yi1.li@intel.com>
2025-08-26 10:01:25 +00:00
Oliver Smith-Denny
2e85d12685 CryptoPkg: Resolve CodeQL Errors
This patch updates several CodeQL errors for potential null pointer
access and unguarded header conclusion across production and test
code that have been flagged in the build/security tab in GitHub.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-04-21 02:14:50 +00:00
Michael D Kinney
deee46d276 CryptoPkg/Library/OpensslLib: Fix CLANG compatibility issues
Update the CryptoPkg to support CLANGPDB and CLANGDWARF from
both Windows and Linux host environments.

* Add PcdOpensslLibAssemblySourceStyleNasm to select the correct
  optimized assembly source style for OpensslLib for IA32/X64.
  NASM style is for MSFT and CLANGPDB. GAS style is for GCC.
  Use this PCD in OpensslLibAccel.inf and OpensslLibFullAccel.inf
  to select between .nasm and .S files.
* Add intrinsic functions required by CLANG IA32/X64 builds.
  * __ashlti3
  * __lshrdi3
* Disable warning -Wno-error=unused-function for CLANG build
  compatibility
* Set -D OPENSSL_NO_INLINE_ASM for CLANG build compatibility
* Update TestBaseCryptLib to split out the implementation of
  main() into its own C file that is only use for host-based
  unit tests. This is due to CLANGPDB for host environments
  injecting a __main() call that can only be resolved in host
  based builds that link against host libraries.
* Update Configure.py to update IA32/X64 [Sources] sections
  with feature flag expressions using the new PCD
  PcdOpensslLibAssemblySourceStyleNasm.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-03-07 05:44:30 +00:00
Ard Biesheuvel
1815f35b87 CryptoPkg: Add unit testcase for SM3
SM3 needs to be tested so we can verify that alternative implementations
(such as the one I will be contributing to BaseCryptLibMbedTls) as well
as the reference implementation produce the expected value.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-09-23 06:11:25 +00:00
Gerd Hoffmann
94961b8817 CryptoPkg/Test: call ProcessLibraryConstructorList
Needed to properly initialize BaseRngLib.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-06-14 13:31:12 +00:00
Chris Ruffin
c98c14576f CryptoPkg/BaseCryptLibUnitTest: add unit test functions
Add unit test functions:
TestVerifyPkcs1v2EncryptInterface()
TestVerifyRsaOaepEncryptInterface()
TestVerifyEncrypt()
TestVerifyDecrypt()
TestVerifyEncryptDecrypt()

Signed-off-by: Chris Ruffin <v-chruffin@microsoft.com>
Cc: Chris Ruffin <cruffin@millcore.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yi Li <yi1.li@intel.com>
Cc: Wenxing Hou <wenxing.hou@intel.com>

Reviewed-by: Yi Li <yi1.li@intel.com>
2024-04-07 03:55:04 +00:00
Wenxing Hou
c5fedb030a CryptoPkg: Add MD5/SHA1/SHA2 functions based on Mbedtls
Add MD5/SHA1/SHA256/SHA384/SHA512 APIs.

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

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yi Li <yi1.li@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
Reviewed-by: Yi Li <yi1.li@intel.com>
2023-10-12 05:31:19 +00:00
Wenxing Hou
97f51f2e9b CryptoPkg: Add RSA functions based on Mbedtls
Add RSA APIs.

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

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yi Li <yi1.li@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
Reviewed-by: Yi Li <yi1.li@intel.com>
2023-10-12 05:31:19 +00:00
Wenxing Hou
731aa70881 CryptoPkg: Add HMAC functions based on Mbedtls
Add HMAC APIS.

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

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yi Li <yi1.li@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
2023-10-12 05:31:19 +00:00
Michael D Kinney
8487ec0ee7 CryptoPkg/Test: Simplify BaseCryptLib host based unit tests
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4130

Remove TestBaseCryptLibHostAccel.inf and instead use FILE_GUID
override in DSC file to run the same unit test INF against
OpensslLibFull.inf and OpensslLibFullAccel.inf

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>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2022-11-02 03:34:35 +00:00
Michael D Kinney
584b246e88 CryptoPkg: Fixed host-based unit tests
* Build host-based tests using OpensslLib instance with all services
  enabled.
* Build host-based tests using performance optimized OpensslLib instance
  with all services enabled.
* Remove unused PCD gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled
* Remove redundant and unnecessary [BuildOptions]
* Limit host-based unit tests to only IA32/X64

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>
Cc: Christopher Zurcher <christopher.zurcher@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2022-10-24 07:49:43 +00:00
Michael D Kinney
961fadf60c CryptoPkg/Test/UnitTest/Library/BaseCryptLib: Unit test fixes
* Update ImageTimeStampTest to return UNIT_TEST_PASSED instead of
  Status.  On success Status is TRUE(1), which was returning a unit
  test status of UNIT_TEST_ERROR_PREREQUISITE_NOT_MET.
* Update HmacTests to use the *Free() service from the HMAC family
  instead of FreePool().  Using FreePool() generates ASSERT() because
  the context being freed was not allocated using AllocatePool().

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>
Cc: Christopher Zurcher <christopher.zurcher@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2022-10-24 07:49:43 +00:00
Qi Zhang
e7d7f02c8e CryptoPkg: add Unit Test for X509 new function.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4082

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>
Signed-off-by: Qi Zhang <qi1.zhang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2022-10-12 06:38:15 +00:00
Qi Zhang
0371032289 CryptoPkg: add unit test for EC key interface.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4102

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>
Signed-off-by: Qi Zhang <qi1.zhang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2022-10-12 05:56:00 +00:00
Yi Li
d97ee3244d CryptoPkg/Test: Add unit test for CryptoEc
Add unit test for CryptoEc.

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>
Signed-off-by: Yi Li <yi1.li@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2022-09-26 07:03:56 +00:00
Yi Li
0c9d4ad788 CryptoPkg/Test: Add unit test for CryptoBn
Add unit test for CryptoBn.

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>
Signed-off-by: Yi Li <yi1.li@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2022-09-23 10:08:24 +00:00
Qi Zhang
5f403cdc6a CryptoPkg: add UnitTest for AeadAesGcm.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4036

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>
2022-09-23 08:24:42 +00:00
Qi Zhang
b19793a2ec CryptoPkg: add Hkdf UnitTest.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4033

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>
2022-09-23 07:35:08 +00:00
Qi Zhang
f3c69cb5a1 CryptoPkg: add Hmac Sha384 to host UnitTest.
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>
2022-09-23 06:55:58 +00:00
Gerd Hoffmann
f5508a91e3 CryptoPkg/UnitTest: fix DH testcase
openssl 3.0 wants at least 512 bytes, otherwise it throws an error:

error:0280007E:Diffie-Hellman routines::modulus too small

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
2022-04-12 14:39:01 +00:00
Zhihao Li
c1e662101a CryptoPkg: Add new hash algorithm ParallelHash256HashAll in BaseCryptLib.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3596

Parallel hash function ParallelHash256HashAll, as defined in NIST's
Special Publication 800-185, published December 2016. It utilizes
multi-process to calculate the digest.

Passed CI test.
Onprotocol version code passed test.

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>
Cc: Siyuan Fu <siyuan.fu@intel.com>

Signed-off-by: Zhihao Li <zhihao.li@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2022-03-18 06:49:18 +00:00
Michael Kubacki
7c34237831 CryptoPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the CryptoPkg package

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2021-12-07 17:24:28 +00:00
Sachin Agrawal
22ac5cc9d9 CryptoPkg: BaseCryptLib: Add RSA PSS verify support
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3314

This patch uses Openssl's EVP API's to perform RSASSA-PSS verification
of a binary blob.

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: Sachin Agrawal <sachin.agrawal@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2021-05-14 03:35:33 +00:00
Michael D Kinney
388f9a9355 CryptoPkg/Test/UnitTest/Library/BaseCryptLib: Fix MD5 Hash tests
Only include MD5 unit tests if ENABLE_MD5_DEPRECATED_INTERFACES
is defined and define ENABLE_MD5_DEPRECATED_INTERFACES for host
based unit tests so MD5 services are always tested.

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>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2020-11-25 17:54:11 +00:00
Matthew Carlson
694bfd6ff5 CryptoPkg: BaseCryptLib: Add unit tests (Host and Shell based)
This adds a new INF for BaseCryptLib suitable for
host based environments. It adds a host based unit test for
BaseCryptLib that can also be built as a shell based Unit Test.

In addition, this also adds a UnitTestHostCrtWrapper.c file, which provides
some of the functionality not provided by the default host based unit test
system that OpenSSL expects. This is used by UnitTestHostBaseCryptLib, a
version of the BaseCryptLib meant specifically for host based unit testing.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Signed-off-by: Matthew Carlson <matthewfcarlson@gmail.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2020-10-18 00:49:58 +00:00