991515a058
CryptoPkg: remove BN and EC accel for size optimization
...
BN and EC have not been fully tested, and will greatly increase
the size of the Crypto driver(>150KB).
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
46226fb5d3
CryptoPkg: remove strcmp to syscall
...
In rare cases the platform may not provide the full IntrinsicLib.
But openssl30 build always require strcmp, provide this function by
moving it into CrtWrapper.c.
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
c0aeb92663
CryptoPkg: run configure.py to update all generated files
...
cd */edk2/CryptoPkg/Library/OpensslLib
python configure.py
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
dfa6147a79
CryptoPkg: add more dummy implement of openssl for size optimization
...
Add dummy implement of Encoder, Pkcs12 and sslserver.
OpenSSL libraries which don't need these features can include
these files to reduce the size of output.
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
2bead79cfc
CryptoPkg: add implemention of _ftol2_sse() to avoid build error
...
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
b2ff8e45db
CryptoPkg: add define of maximum unsigned size_t
...
Used by openssl30 source code.
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
4b5faa5775
CryptoPkg: add missing gcc instructions
...
Used when build IA32 CryptoPkg by gcc, the definition of the
instructions can be found at:
https://gcc.gnu.org/onlinedocs/gccint/Integer-library-routines.html
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
43e0ede26b
CryptoPkg: Enable memcpy sys call in RISCV64 build
...
When build Openssl30, compiler optimization may use memcpy()
for memory copy.
Need enable it in RISCV64 build also.
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
bdf3142eb7
CryptoPkg/TlsLib: use unsigned long for ErrorCode
...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
20193b20b5
CryptoPkg: disable C4133 warning in openssl libraries
...
Disable warning as error of C4133:
v3_genn.c(101): warning C4133: 'function': incompatible types
- from 'ASN1_TYPE *' to 'const ASN1_STRING *'.
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
bf1ff73c8c
CryptoPkg: Add instrinsics to support building openssl3 on IA32 windows
...
This dependency is needed to build openssl lib with openssl3
under IA32 Windows, so added implementation for _alldiv, _aulldiv,
_aullrem and _alldvrm instrinsics.
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
cea8e3b513
CryptoPkg: adapt 3.0 change in SslNull.c
...
Type of input params changed in openssl30.
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
ea7a37d352
CryptoPkg: use UEFI provider as default
...
Added UEFI provider which removed unused features to
optimize the size of openssl3.
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
9b9b331e0f
CryptoPkg: Move all UEFI implement of openssl to OpensslStub
...
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
5e1900f266
CryptoPkg/openssl: adapt EcSm2Null.c for openssl 3.0
...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
174a306ccd
CryptoPkg/openssl: store dummy update for openssl 3.0
...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
3af00aec7f
CryptoPkg/openssl: move compiler_flags to buildinf.c
...
Seems with openssl 3.0 this is used by multiple source files,
so we get duplicate symbol errors when linking. Fix that by
moving compiler_flags from header file to a source file.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
c638d1f672
CryptoPkg/openssl: adapt rand_pool.c to openssl 3.0 changes
...
Some functions have been renamed.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
eac38f74c4
CryptoPkg/TlsLib: ERR_GET_FUNC is gone
...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
2a6dc1211f
CryptoPkg/BaseCryptLib: drop BIO_* dummy functions
...
openssl 3.0 requires a functional BIO_sprintf() implementation.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
63c8d160ae
CryptoPkg/BaseCryptLib: adapt CryptSm3.c to openssl 3.0 changes.
...
Functions have been renamed.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
84158d0ebe
CryptoPkg/BaseCryptLib: no openssl deprecation warnings please
...
Stop using deprecated interfaces is left as exercise for another day.
So please don't warn for now so -Werror builds can work.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
ac492c3ead
CryptoPkg/openssl: UefiAsm.conf update for openssl 3.0
...
New naming convention for the configs: UEFI-${efiarch}-${compiler}.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
81f5aa0700
CryptoPkg/openssl: add openssl3 configure scripts
...
Rewrite the script to configure openssl 3.0 from scratch. It's two
scripts now:
* Tiny helper script, dumping the perl configdata as json.
* Actual configure.py script, written in python, which copies over
the generated files to openssl-gen and updates the OpensslLib*.inf
file lists and build flags.
The configuration workflow has changed a bit:
* All generated files are stored in the OpensslGen directory tree.
* For ec/no-ec builds two different header files are used. Default is
the ec variant, and the new EDK2_OPENSSL_NOEC define is used to
select the no-ec build. A five line wrapper include is used to pick
the one or the other.
* For non-accel builds -DOPENSSL_NO_ASM on the command line is used
(same as before).
* For configration defines the OPENSSL_FLAGS_$(variant) variable is
used, where variant is the architecture for the accelerated builds
and 'NOASM' for the non-accelerated builds.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
7cede6d5f4
CryptoPkg/openssl: update Openssl*.inf files for openssl 3.0
...
The configure workflow as changed, see the commit adding the configure
script for details. Adapt the *.inf files to the changes. The
configuration define handling has changed a bit. The new configure
script will build a single per-arch file list, which simplifies the
Accel configs.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
49a113a7a4
CryptoPkg/openssl: cleanup all openssl1.1.1 generated files and code
...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
9d6d237c3c
CryptoPkg/openssl: update submodule to openssl-3.0.9
...
Signed-off-by: Yi Li <yi1.li@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
Acked-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Ard Biesheuvel <ardb@kernel.org >
Tested-by: Brian J. Johnson <brian.johnson@hpe.com >
Tested-by: Kenneth Lautner <klautner@microsoft.com >
2023-08-09 07:10:31 +00:00
b2de9ec5a7
CryptoPkg/OpensslLib: Upgrade OpenSSL to 1.1.1u
...
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Signed-off-by: Sheng Wei <w.sheng@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2023-07-20 07:45:40 +00:00
9165a7e95e
CryptoPkg: Delete CLANG35 and CLANG38 build flags; add CLANGDWARF flags
...
Since CLANG35 and CLANG38 toolchains have been deleted from
tools_def.template, delete the build flags for them from CryptoPkg.
Since CLANGDWARF has replaced CLANG38, add build flags for it to the
CryptoPkg .inf files.
Signed-off-by: Rebecca Cran <rebecca@bsdio.com >
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com >
2023-05-10 10:58:16 +08:00
e3d2c08322
CryptoPkg: Enable DXE_CORE support in DxeCryptLib.inf
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4413
Make the DXE_CORE module able to call the crypto protocol,
which can reduce FV size on platforms using the Crypto Binaries.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Jiewen Yao <jiewen.yao@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 >
2023-04-19 03:59:33 +00:00
74ce342f18
CryptoPkg: Update code to be more C11 compliant by using __func__
...
__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among
others support, while __func__ was standardized in C99.
Since it's more standard, replace __FUNCTION__ with __func__ throughout
CryptoPkg.
Signed-off-by: Rebecca Cran <rebecca@bsdio.com >
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com >
Reviewed-by: Ard Biesheuvel <ardb@kernel.org >
2023-04-10 14:19:57 +00:00
84d77d9bf5
CryptoPkg: Fix conditionally uninitialized variable
...
Fixes CodeQL alerts for CWE-457:
https://cwe.mitre.org/data/definitions/457.html
Checks the return value from `ASN1_get_object()` to verify values
set by the function are valid.
Note that the function returns literal `0x80`:
`return (0x80);`
That is used to check the return value is as the case in other areas
of the code.
Cc: Erich McMillan <emcmillan@microsoft.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Michael Kubacki <mikuback@linux.microsoft.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Co-authored-by: Erich McMillan <emcmillan@microsoft.com >
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com >
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com >
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com >
2023-04-03 15:29:08 +00:00
410ca0ff94
CryptoPkg/Library: add -Wno-unused-but-set-variable for openssl
...
The GCC warning fix is not in 1.1.1x. Ignore the warning type
-Wno-unused-but-set-variable with GCC compiler in the build option.
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Jian J Wang <jian.j.wang@intel.com >
Signed-off-by: Gang Chen <gang.c.chen@intel.com >
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com >
2023-03-17 07:57:10 +00:00
4ca4041b0d
CryptoPkg/OpensslLib: Upgrade OpenSSL to 1.1.1t
...
Upgrade openssl to 1.1.1t
Pick up bugfixes from the latest openssl release.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com >
Cc: Guomin Jiang <guomin.jiang@intel.com >
Signed-off-by: Sheng Wei <w.sheng@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2023-03-10 05:46:27 +00:00
f335d91a3b
CryptoPkg/BaseCryptLib: avoid using SHA512()
...
In openssl 3.0 SHA512() goes through the provider logic,
requiring a huge amount of openssl code. The individual
functions do not, so use them instead.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2023-03-07 09:59:50 +00:00
5a6455e04c
CryptoPkg/BaseCryptLib: avoid using SHA384()
...
In openssl 3.0 SHA384() goes through the provider logic,
requiring a huge amount of openssl code. The individual
functions do not, so use them instead.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2023-03-07 09:59:50 +00:00
7fc183df71
CryptoPkg/BaseCryptLib: avoid using SHA256()
...
In openssl 3.0 SHA256() goes through the provider logic,
requiring a huge amount of openssl code. The individual
functions do not, so use them instead.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2023-03-07 09:59:50 +00:00
437ed29f27
CryptoPkg/BaseCryptLib: avoid using SHA1()
...
In openssl 3.0 SHA1() goes through the provider logic,
requiring a huge amount of openssl code. The individual
functions do not, so use them instead.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2023-03-07 09:59:50 +00:00
d0ff1cae3a
CryptoPkg/Library: Reinstate ARM/AARCH64 sections in SmmCryptLib.inf
...
These sections were removed mistakenly. SmmCryptLib.inf supports these
architectures.
Signed-off-by: Jake Garver <jake@nvidia.com >
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2023-01-26 08:59:29 +00:00
39ba0f8dfc
CryptoPkg: Need to enable crypto functions
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3992
V1: Enable CryptAes for PEI phase. Enable CryptHkdf for SMM phase.
Update Readme.md
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 >
Cc: Nishant C Mistry <nishant.c.mistry@intel.com >
Signed-off-by: Jian J Wang <jian.j.wang@intel.com >
Signed-off-by: Nishant C Mistry <nishant.c.mistry@intel.com >
Signed-off-by: Judah Vang <judah.vang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-12-20 01:39:32 +00:00
7de1c71dd2
CryptoPkg/BaseCryptLib:time overflow
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4167
In CrtLibSupport.h, time_t is defined as INT32, and its maximum value
is 2147483647. That is, the corresponding maximum timestamp is
2038-01-19 11:14:07. Therefore, overflow occurs when the test time
exceeds 2038-01-19 11:14:07. So change the type of time_t to INT64 and
also change the type of variables in function gmtime which calculated
with time_t.
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: Zihong Yi <yizihong@huawei.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-12-03 09:01:38 +00:00
5d5be45bd1
CryptPkg: Enable CryptoPkg BaseCryptLib ParallelHash for PEI and DXE
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4097
The BaseCryptLib in the CryptoPkg currently supports ParallelHash
algorithm for SMM. The MP Services PPI and MP Services Protocol
could be used to enable ParallelHash in PEI and DXE
versions of the BaseCryptLib.
Cc: Jiewen Yao <jiewen.yao@intel.com >
Cc: Jian J Wang <jian.j.wang@intel.com >
Signed-off-by: Zhihao Li <zhihao.li@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-12-02 14:12:51 +00:00
a8a78ef194
CryptoPkg/OpensslLib: Upgrade OpenSSL to 1.1.1s
...
Upgrade openssl to 1.1.1s.
Pick up bugfixes from the latest openssl release, which include
some GCC build warnings cleaning up.
Cc: Jian J Wang <jian.j.wang@intel.com >
Cc: Jiewen Yao <jiewen.yao@intel.com >
Signed-off-by: Gang Chen <gang.c.chen@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-12-01 09:29:57 +00:00
50bee4cc12
CryptoPkg: Sha1 functions causing build errors
...
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3991
Fix build issue when DiSABLE_SHA1_DEPRECATED_INTERFACES
is defined. Percolate the #ifndef DiSABLE_SHA1_DEPRECATED_INTERFACES
to all the Sha1 functions.
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 >
Cc: Nishant C Mistry <nishant.c.mistry@intel.com >
Signed-off-by: Jian J Wang <jian.j.wang@intel.com >
Signed-off-by: Nishant C Mistry <nishant.c.mistry@intel.com >
Signed-off-by: Judah Vang <judah.vang@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-11-08 03:15:13 +00:00
4fcd5d2620
CryptoPkg/Library/OpensslLib: update auto-generated files
...
Update OpensslLib INF files to match results from running
process_files.pl to auto-generate the INF files.
* OpensslLib.inf
* OpensslLibAccel.inf
* OpensslLibCrypto.inf
* OpensslLibFull.inf
* OpensslLibFullAccel.inf
These INF files are generated by running the following
perl scripts:
* process_files.pl
* process_files.pl X64
* process_files.pl X64Gcc
* process_files.pl IA32
* process_files.pl IA32Gcc
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: Michael D Kinney <michael.d.kinney@intel.com >
Signed-off-by: Yi Li <yi1.li@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-10-24 07:49:43 +00:00
0882d6a32d
CryptoPkg/Library/OpensslLib: Add generated flag to Accel INF
...
Update OpensslLibAccel.inf and OpensslLibFullAccel.inf to include
flags used by process_files.pl to generate OpensslLib INF files.
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: Michael D Kinney <michael.d.kinney@intel.com >
Signed-off-by: Yi Li <yi1.li@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-10-24 07:49:43 +00:00
d79295b5c5
CryptoPkg/Library/OpensslLib: Update process_files.pl INF generation
...
Update process_files.pl to generate all OpensslLib INF files.
* OpensslLib.inf
* OpensslLibAccel.inf
* OpensslLibCrypto.inf
* OpensslLibFull.inf
* 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 >
Cc: Christopher Zurcher <christopher.zurcher@microsoft.com >
Cc: Michael D Kinney <michael.d.kinney@intel.com >
Signed-off-by: Yi Li <yi1.li@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-10-24 07:49:43 +00:00
3b46a1e243
Revert "CryptoPkg: Update process_files.pl to auto add PCD config option"
...
This reverts commit 499b0d5fa5
.
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: Michael D Kinney <michael.d.kinney@intel.com >
Signed-off-by: Yi Li <yi1.li@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
2022-10-24 07:49:43 +00:00
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
a57b4c11a5
CryptoPkg/Library/OpensslLib: Remove PrintLib from INF files
...
The OpensslLib instances do not directly use any PrintLib services.
Remove PrintLib from [LibraryClasses] sections of all OpensslLib
INF files.
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