Michael D Kinney
ea6d859b50
CryptoPkg/Library/OpensslLib: Combine all performance optimized INFs
...
* Remove IA32/X64 specific INF files for performance
optimized OpensslLib and combine into OpensslLibAccel.inf
and OpensslLibFullAccel.inf.
* Remove use of PcdOpensslEcEnabled and let the platform
select the EC feature by using either OpensslLibFull.inf
or OpensslLibFullAccel.inf.
* With PcdOpensslEcEnabled removed, roll back style of opensslconf.h
and remove opensslconf_generated.h. Move the choice to disable
EC/SM2 into OpensslLib INF files using OPENSSL_FLAGS define.
* Update OpensslLibContructor() API to be compatible with all
FW phases by using types from Base.h and using RETURN_STATUS
type and values instead of EFI_STATUS type and values.
* Add /wd4718 to VS2015x86 for IA32 and X64 to disable warning
for recursive call with no side effects. This is a false
positive warning that is not produced with VS2017 or VS2019.
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
dd00f92b2f
CryptoPkg/Library: Cleanup BaseCryptLib and TlsLib
...
* Move SysCall/inet_pton.c from BaseCryptLib to TlsLib. The functions
in this file are only used by TlsLib instances and not any CryptLib
instances.
* Fix type mismatch in call to FreePool() in TlsConfig.c
* Remove use of gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled from
TslLib and CryptLib instances
* Add missing *Null.c files to SecCryptLib.inf and RuntimeCryptLib.inf.
* Remove ARM and AARCH64 sections from SmmCryptLib.inf that does not
support those architectures.
* Add missing PrintLib dependencies to [LibraryClasses] sections of
CryptLib INF files
* Remove extra library classes from [LibraryClasses] sections of
CryptLib INF files
* Remove unnecessary warning disables from [BuildOptions] sections of
TlsLib and CryptLib INF files
* Remove RVCT support from SecCryptLib.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 >
Cc: Christopher Zurcher <christopher.zurcher@microsoft.com >
Cc: Rebecca Cran <quic_rcran@quicinc.com >
Cc: Ard Biesheuvel <ardb@kernel.org >
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
8f8372439d
CryptoPkg/Library/BaseCryptLib: Update internal functions/variables
...
* Update BaseCryptLib internal worker functions to be 'STATIC'
* Update BaseCryptLib internal working functions to not use EFIAPI
* Add GLOBAL_REMOVE_IF_UNREFERENCED to BaseCryptLib global variables
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
8437368c69
CryptoPkg/Library/BaseCryptLib: Add missing UNI file and fix format
...
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
Chao Li
c5f4b4fd03
CryptoPkg: Add LOONGARCH64 architecture for EDK2 CI.
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053
Add LOONGARCH64 architecture for EDK2 CI testing.
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: Chao Li <lichao@loongson.cn >
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com >
2022-10-14 02:16:33 +00:00
Qi Zhang
22745df666
CryptoPkg: add new X509 function to Crypto Service.
...
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
8ecae3d641
CryptoPkg: add new X509 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
69a50a249b
CryptoPkg: Add EC key interface to DXE and protocol
...
The implementation provide EC key interface for EFI
driver nad EFI BaseCrypt protocol.
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
Qi Zhang
f21a1d48fe
CryptoPkg: Add EC key retrieving and signature interface.
...
This patch is used to retrieve EC key from PEM and X509 and
carry out the EC-DSA signature and verify it.
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
8db4e9f9a0
CryptoPkg: Add new Tls APIs to DXE and protocol
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3892
The implementation provides new Tls library functions
for Crypto EFI Driver and Protocol.
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-10-10 06:29:51 +00:00
Yi Li
bb78d969b7
CryptoPkg: Extend Tls function library
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3892
1. TlsSetSignatureAlgoList(): Configure the list of TLS signature algorithms
that should be used as part of the TLS session establishment.
This is needed for some WLAN Supplicant connection establishment flows
that allow only specific TLS signature algorithms to be used, e.g.,
Authenticate and Key Managmenet (AKM) suites that are SUITE-B compliant.
2. TlsSetEcCurve(): Configure the Elliptic Curve that should be used for
TLS flows the use cipher suite with EC,
e.g., TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384.
This is needed for some WLAN Supplicant connection establishment flows
that allow only specific TLS signature algorithms to be used,
e.g., Authenticate and Key Managmenet (AKM) suites that are SUITE-B compliant.
3. TlsShutdown():
Shutdown the TLS connection without releasing the resources,
meaning a new connection can be started without calling TlsNew() and
without setting certificates etc.
4. TlsGetExportKey(): Derive keying material from a TLS connection using the
mechanism described in RFC 5705 and export the key material (needed
by EAP methods such as EAP-TTLS and EAP-PEAP).
5. TlsSetHostPrivateKeyEx(): This function adds the local private key
(PEM-encoded or PKCS#8 or DER-encoded private key) into the specified
TLS object for TLS negotiation. There is already a similar function
TlsSetHostPrivateKey(), the new Ex function introduces a new parameter
Password, set Password to NULL when useless.
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-10-10 06:29:51 +00:00
Yuan Yu
3c9e2f239a
CryptoPkg: Fix integer overflow
...
SECSPERDAY is 86400 which exceeds the limit of a UINT16 which is 65536.
Therefore DayRemainder cannot use UINT16. This patch makes it UINT32.
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org >
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Laszlo Ersek <lersek@redhat.com >
Cc: Anthony Perard <anthony.perard@citrix.com >
Cc: Julien Grall <julien@xen.org >
Signed-off-by: Yuan Yu <yuanyu@google.com >
Reviewed-by: Ard Biesheuvel <ardb+tianocore@kernel.org >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-10-10 00:58:26 +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
3b382f5b38
CryptoPkg: Add EC APIs to DXE and protocol
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3828
The implementation provides CryptEc library functions
for EFI Driveer and EFI BaseCrypt Protocol.
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
988e4d8f5e
CryptoPkg: Add EC support
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3828
This patch is used to add CryptEc library, which is wrapped
over OpenSSL.
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
0e7aa6bf9e
CryptoPkg: Fix pem heap-buffer-overflow due to BIO_snprintf()
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4075
Fake BIO_snprintf() does not actually print anything to buf,
it should return -1 as error.
0 will be considered a correct return value, the consumer may think that
the buf is valid and parse the buffer.
please refer to bugzilla link for details.
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 01:39:52 +00:00
Christopher Zurcher
a8e8c43a0e
CryptoPkg/OpensslLib: Update generated files for native X64
...
Cc: Yi Li <yi1.li@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 >
Signed-off-by: Christopher Zurcher <christopher.zurcher@microsoft.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-09-23 11:07:54 +00:00
Christopher Zurcher
4102950a21
CryptoPkg/OpensslLib: Commit the auto-generated assembly files for IA32
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3654
Adding the auto-generated assembly files for IA32 architectures.
Cc: Yi Li <yi1.li@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 >
Signed-off-by: Christopher Zurcher <christopher.zurcher@microsoft.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-09-23 11:07:54 +00:00
Christopher Zurcher
03f708090b
CryptoPkg/OpensslLib: Add native instruction support for IA32
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3654
Adding native instruction support for accelerated OpenSSL features for
IA32 architecture, following the pattern set by the previous commits for
X64 native support.
Cc: Yi Li <yi1.li@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 >
Signed-off-by: Christopher Zurcher <christopher.zurcher@microsoft.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-09-23 11:07:54 +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
Yi Li
42951543dd
CryptoPkg: Add BigNum API to DXE and protocol
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3828
The implementation provides CryptBn library functions
for EFI Driver and EFI BaseCrypt Protocol.
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
Yi Li
fd0ad0c346
CryptoPkg: Add BigNum support
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3828
This patch is used to add CryptBn library, which is wrapped
over OpenSSL.
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
022787f806
CryptoPkg: add AeadAesGcm to Crypto Service.
...
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
a23f76e184
CryptoPkg: add AeadAesGcm support.
...
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
e919c390e8
CryptoPkg: add new Hkdf api to Crypto Service.
...
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
11b24ef0d7
CryptoPkg: add new Hkdf api in Crypt Lib.
...
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
Qi Zhang
3f77ccb9c8
CryptoPkg: Add new hmac SHA api to Crypto Service.
...
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
Qi Zhang
cbb3b6b950
CryptoPkg: Update CryptLib inf as the file name changed.
...
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
Qi Zhang
0b1a1bdc30
CryptoPkg: Add HMAC-SHA384 cipher support.
...
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 >
2022-09-23 06:55:58 +00:00
Wenyi Xie
6f340acfb1
CryptoPkg/BaseCryptLib:Remove redundant init
...
CertCtx is used to be defined as a struct and ZeroMem is called to
init this struct. But now CertCtx is defined as a point, so use
ZeroMem (&CertCtx, sizeof (CertCtx)) is not correct any more.
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: Wenyi Xie <xiewenyi2@huawei.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-09-23 00:36:29 +00:00
Min Xu
b1567b2e15
CryptoPkg: Add SecCryptLib
...
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3853
This is the Cryptographic library instance for SEC. The motivation of
this library is to support SHA384 in SEC phase for Td guest. So only
Hash/CryptSha512.c is included which supports SHA384 and SHA512. Other
cryptographics are added with the null version, such as CryptMd5Null.c.
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: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Signed-off-by: Min Xu <min.m.xu@intel.com >
2022-06-03 11:41:36 +00:00
Rebecca Cran
e9eeb0ad2b
CryptoPkg: Remove RVCT support
...
RVCT is obsolete and no longer used.
Remove support for it.
Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com >
Reviewed-by: Ard Biesheuvel <ardb@kernel.org >
2022-05-13 14:58:54 +00:00
Yi Li
a332ffb6ef
CryptoPkg/openssl: update generated files
...
Run process_files.pl with the current openssl submodule version.
Signed-off-by: Yi Li <yi1.li@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 >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-05-11 00:04:39 +00:00
Yi Li
499b0d5fa5
CryptoPkg: Update process_files.pl to automatically add PCD config option
...
Recommend from Gerd:
(2) Keep the EC config option, but update process_files.pl to
automatically add the PcdEcEnabled config option handling
to the files it generates.
When remove 'no-ec' from openssl configure list, will automatically remove
'OPENSSL_NO_EC', 'OPENSSL_NO_ECDH', 'OPENSSL_NO_ECDSA', 'OPENSSL_NO_TLS1_3',
form header, and add '/ec/.', '/sm2/.' files to INF files.
Signed-off-by: Yi Li <yi1.li@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 >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-05-11 00:04:39 +00:00
Yi Li
f753c36209
CryptoPkg: Separate auto-generated openssl config and edk2 openssl config
...
Move auto-generated openssl config to openssl/opensslconf_generated,
And openssl/opensslconf.h will contain both edk2 conditional openssl
feature and openssl/opensslconf_generated.
Will make two part more clear.
New conditional feture code in opensslconf.h will look like:
/* Autogenerated conditional openssl feature list starts here */
[.....]
/* Autogenerated conditional openssl feature list ends here */
Signed-off-by: Yi Li <yi1.li@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 >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-05-11 00:04:39 +00:00
Yi Li
43613b2fe8
CryptoPkg: Rename PCD about openssl EC configuration
...
PcdOpensslXXXEnabled is a more appropriate choice.
Signed-off-by: Yi Li <yi1.li@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-05-11 00:04:39 +00:00
Yi Li
b06a007b64
CryptoPkg: Declare PcdEcEnabled in Library consuming OpensslLib
...
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3679
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3828
Tls/Base/Pei/Smm/RuntimeCryptLib.inf will use OpensslLib,
and the opensslconf.h in openssllib will use PcdEcEnabled,
but it is not declared in the inf file now,
it will cause warnings in some compilers.
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Jian J Wang <jian.j.wang@intel.com >
Signed-off-by: Yi Li <yi1.li@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-04-21 05:06:37 +00:00
Gerd Hoffmann
532bd4ec38
CryptoPkg/Crt: fix strcpy build on older VS compilers
...
Drop 'restrict' keyword which older visual studio compiler
versions complain about.
Fixes: fab6285a73
("CryptoPkg/CrtLibSupport: fix strcpy")
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-04-20 10:56:03 +00:00
Michael Kubacki
f3da13461c
CryptoPkg/TlsLibNull: Remove MU_CHANGE comment markers
...
MU_CHANGE tags are used in a different project (Project Mu) to
highlight deviations from Tianocore. Therefore, the comments are
not needed when the changes are present in a Tianocore repository.
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 Kubacki <michael.kubacki@microsoft.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-04-14 14:50:20 +00:00
yi1 li
0c901fcc20
CryptoPkg: Make EC source file config-able
...
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3679
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3828
Use PCD gEfiCryptoPkgTokenSpaceGuid.PcdEcEnabled to config-able
source files list in OpensslLib.inf and OpensslLibCrypto.inf.
If PcdEcEnabled equals to FALSE, this file will not be compiled.
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Jian J Wang <jian.j.wang@intel.com >
Signed-off-by: yi1 li <yi1.li@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-04-14 03:16:59 +00:00
yi1 li
efc39e65e5
CryptoPkg: Reconfigure OpensslLib to add EC algorithms
...
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3679
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3828
Reconfigure OpensslLib to add elliptic curve cipher algorithms.
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Jian J Wang <jian.j.wang@intel.com >
Signed-off-by: yi1 li <yi1.li@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-04-14 03:16:59 +00:00
yi1 li
1a49e2aa3c
CryptoPkg: Add instrinsics to support building ECC on IA32 windows
...
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3679
This dependency is needed to build openssl lib with ECC ciphers
under IA32 Windows and adds implementation for _allmul and _allshr
instrinsics.
It is taken from Project Mu:
microsoft/mu_basecore@b55b341
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Jian J Wang <jian.j.wang@intel.com >
Signed-off-by: yi1 li <yi1.li@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-04-14 03:16:59 +00:00
Gerd Hoffmann
fab6285a73
CryptoPkg/CrtLibSupport: fix strcpy
...
strcpy() returns a pointer to the destination string, AsciiStrCpyS()
does not. So a simple #define does not work. Create a function
instead.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com >
2022-04-12 14:39:01 +00:00
Gerd Hoffmann
03951e5645
CryptoPkg/CrtLibSupport: add off_t
...
Add typedef for off_t.
Will be needed by openssl 3.0.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com >
2022-04-12 14:39:01 +00:00
Gerd Hoffmann
fd5f347c84
CryptoPkg/CrtLibSupport: add MODULESDIR
...
Add dummy MODULESDIR #define
Will be needed by openssl 3.0.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com >
2022-04-12 14:39:01 +00:00
Gerd Hoffmann
2759e42fbc
CryptoPkg/CrtLibSupport: add UINT_MAX
...
Add define for UINT_MAX.
Will be needed by openssl 3.0.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com >
2022-04-12 14:39:01 +00:00
Gerd Hoffmann
58771f4b2d
CryptoPkg/CrtLibSupport: add INT_MIN
...
Add #define for INT_MIN.
Will be needed by openssl 3.0.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com >
2022-04-12 14:39:01 +00:00
Gerd Hoffmann
3b4b49cf00
CryptoPkg/CrtLibSupport: add strstr()
...
Add #define for strstr().
Will be needed by openssl 3.0.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com >
2022-04-12 14:39:01 +00:00