Topics

[PATCH v2 1/2] CryptoPkg/OpensslLib: Add native instruction support for X64


Zurcher, Christopher J
 

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2507

Adding OpensslLibX64.inf and modifying process_files.pl to process this
file and generate the necessary assembly files.
ApiHooks.c contains a stub function for a Windows API call.
uefi-asm.conf contains the limited assembly configurations for OpenSSL.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyux.lu@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Christopher J Zurcher <christopher.j.zurcher@...>
---
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibX64.inf | 656 +++++++++++++++=
+++++
CryptoPkg/Library/Include/openssl/opensslconf.h | 3 -
CryptoPkg/Library/OpensslLib/ApiHooks.c | 18 +
CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c | 34 +
CryptoPkg/Library/OpensslLib/process_files.pl | 223 +++++--
CryptoPkg/Library/OpensslLib/uefi-asm.conf | 15 +
8 files changed, 903 insertions(+), 50 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Librar=
y/OpensslLib/OpensslLib.inf
index dbbe5386a1..bd62d86936 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -16,7 +16,7 @@
VERSION_STRING =3D 1.0=0D
LIBRARY_CLASS =3D OpensslLib=0D
DEFINE OPENSSL_PATH =3D openssl=0D
- DEFINE OPENSSL_FLAGS =3D -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT =
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE=0D
+ DEFINE OPENSSL_FLAGS =3D -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT =
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DOPENSSL_NO_ASM=0D
=0D
#=0D
# VALID_ARCHITECTURES =3D IA32 X64 ARM AARCH64=0D
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/=
Library/OpensslLib/OpensslLibCrypto.inf
index 616ccd9f62..2b7324a990 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -16,7 +16,7 @@
VERSION_STRING =3D 1.0=0D
LIBRARY_CLASS =3D OpensslLib=0D
DEFINE OPENSSL_PATH =3D openssl=0D
- DEFINE OPENSSL_FLAGS =3D -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT =
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE=0D
+ DEFINE OPENSSL_FLAGS =3D -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT =
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DOPENSSL_NO_ASM=0D
=0D
#=0D
# VALID_ARCHITECTURES =3D IA32 X64 ARM AARCH64=0D
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf b/CryptoPkg/Lib=
rary/OpensslLib/OpensslLibX64.inf
new file mode 100644
index 0000000000..825eea0254
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
@@ -0,0 +1,656 @@
+## @file=0D
+# This module provides OpenSSL Library implementation.=0D
+#=0D
+# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>=
=0D
+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>=0D
+# SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+#=0D
+##=0D
+=0D
+[Defines]=0D
+ INF_VERSION =3D 0x00010005=0D
+ BASE_NAME =3D OpensslLibX64=0D
+ MODULE_UNI_FILE =3D OpensslLib.uni=0D
+ FILE_GUID =3D 18125E50-0117-4DD0-BE54-4784AD995FEF=
=0D
+ MODULE_TYPE =3D BASE=0D
+ VERSION_STRING =3D 1.0=0D
+ LIBRARY_CLASS =3D OpensslLib=0D
+ DEFINE OPENSSL_PATH =3D openssl=0D
+ DEFINE OPENSSL_FLAGS =3D -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT =
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE=0D
+ DEFINE OPENSSL_FLAGS_CONFIG =3D -DOPENSSL_CPUID_OBJ -DSHA1_ASM -DSHA2=
56_ASM -DSHA512_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM=0D
+ CONSTRUCTOR =3D OpensslLibConstructor=0D
+=0D
+#=0D
+# VALID_ARCHITECTURES =3D X64=0D
+#=0D
+=0D
+[Sources]=0D
+ OpensslLibConstructor.c=0D
+ $(OPENSSL_PATH)/e_os.h=0D
+ $(OPENSSL_PATH)/ms/uplink.h=0D
+# Autogenerated files list starts here=0D
+ X64/crypto/aes/aesni-mb-x86_64.nasm=0D
+ X64/crypto/aes/aesni-sha1-x86_64.nasm=0D
+ X64/crypto/aes/aesni-sha256-x86_64.nasm=0D
+ X64/crypto/aes/aesni-x86_64.nasm=0D
+ X64/crypto/aes/vpaes-x86_64.nasm=0D
+ X64/crypto/modes/ghash-x86_64.nasm=0D
+ X64/crypto/sha/sha1-mb-x86_64.nasm=0D
+ X64/crypto/sha/sha1-x86_64.nasm=0D
+ X64/crypto/sha/sha256-mb-x86_64.nasm=0D
+ X64/crypto/sha/sha256-x86_64.nasm=0D
+ X64/crypto/sha/sha512-x86_64.nasm=0D
+ X64/crypto/x86_64cpuid.nasm=0D
+ $(OPENSSL_PATH)/crypto/aes/aes_cbc.c=0D
+ $(OPENSSL_PATH)/crypto/aes/aes_cfb.c=0D
+ $(OPENSSL_PATH)/crypto/aes/aes_core.c=0D
+ $(OPENSSL_PATH)/crypto/aes/aes_ige.c=0D
+ $(OPENSSL_PATH)/crypto/aes/aes_misc.c=0D
+ $(OPENSSL_PATH)/crypto/aes/aes_ofb.c=0D
+ $(OPENSSL_PATH)/crypto/aes/aes_wrap.c=0D
+ $(OPENSSL_PATH)/crypto/aria/aria.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_digest.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_dup.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_gentm.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_int.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_mbstr.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_object.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_octet.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_print.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_sign.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_strex.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_strnid.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_time.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_type.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_utctm.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_utf8.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/a_verify.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/asn1_err.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/asn1_par.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/asn_mime.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/asn_moid.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/asn_mstbl.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/asn_pack.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/evp_asn1.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/f_int.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/f_string.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/i2d_pr.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/i2d_pu.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/n_pkey.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/nsseq.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/p5_pbe.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/p5_scrypt.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/t_bitst.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/t_pkey.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/t_spki.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/tasn_dec.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/tasn_enc.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/tasn_fre.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/tasn_new.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/tasn_scn.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/x_algor.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/x_bignum.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/x_info.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/x_int64.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/x_long.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/x_pkey.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/x_sig.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/x_spki.c=0D
+ $(OPENSSL_PATH)/crypto/asn1/x_val.c=0D
+ $(OPENSSL_PATH)/crypto/async/arch/async_null.c=0D
+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.c=0D
+ $(OPENSSL_PATH)/crypto/async/arch/async_win.c=0D
+ $(OPENSSL_PATH)/crypto/async/async.c=0D
+ $(OPENSSL_PATH)/crypto/async/async_err.c=0D
+ $(OPENSSL_PATH)/crypto/async/async_wait.c=0D
+ $(OPENSSL_PATH)/crypto/bio/b_addr.c=0D
+ $(OPENSSL_PATH)/crypto/bio/b_dump.c=0D
+ $(OPENSSL_PATH)/crypto/bio/b_sock.c=0D
+ $(OPENSSL_PATH)/crypto/bio/b_sock2.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bf_buff.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bf_lbuf.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bf_nbio.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bf_null.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bio_cb.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bio_err.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bio_lib.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bio_meth.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bss_acpt.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bss_bio.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bss_conn.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bss_dgram.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bss_fd.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bss_file.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bss_log.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bss_mem.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bss_null.c=0D
+ $(OPENSSL_PATH)/crypto/bio/bss_sock.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_add.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_asm.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_blind.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_const.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_ctx.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_depr.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_dh.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_div.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_err.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_exp.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_exp2.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_gcd.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_gf2m.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_intern.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_kron.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_lib.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_mod.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_mont.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_mpi.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_mul.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_nist.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_prime.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_print.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_rand.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_recp.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_shift.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_sqr.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_sqrt.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_srp.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_word.c=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_x931p.c=0D
+ $(OPENSSL_PATH)/crypto/buffer/buf_err.c=0D
+ $(OPENSSL_PATH)/crypto/buffer/buffer.c=0D
+ $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c=0D
+ $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c=0D
+ $(OPENSSL_PATH)/crypto/cmac/cmac.c=0D
+ $(OPENSSL_PATH)/crypto/comp/c_zlib.c=0D
+ $(OPENSSL_PATH)/crypto/comp/comp_err.c=0D
+ $(OPENSSL_PATH)/crypto/comp/comp_lib.c=0D
+ $(OPENSSL_PATH)/crypto/conf/conf_api.c=0D
+ $(OPENSSL_PATH)/crypto/conf/conf_def.c=0D
+ $(OPENSSL_PATH)/crypto/conf/conf_err.c=0D
+ $(OPENSSL_PATH)/crypto/conf/conf_lib.c=0D
+ $(OPENSSL_PATH)/crypto/conf/conf_mall.c=0D
+ $(OPENSSL_PATH)/crypto/conf/conf_mod.c=0D
+ $(OPENSSL_PATH)/crypto/conf/conf_sap.c=0D
+ $(OPENSSL_PATH)/crypto/conf/conf_ssl.c=0D
+ $(OPENSSL_PATH)/crypto/cpt_err.c=0D
+ $(OPENSSL_PATH)/crypto/cryptlib.c=0D
+ $(OPENSSL_PATH)/crypto/ctype.c=0D
+ $(OPENSSL_PATH)/crypto/cversion.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_ameth.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_asn1.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_check.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_depr.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_err.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_gen.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_kdf.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_key.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_lib.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_meth.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_prn.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c=0D
+ $(OPENSSL_PATH)/crypto/dso/dso_dl.c=0D
+ $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c=0D
+ $(OPENSSL_PATH)/crypto/dso/dso_err.c=0D
+ $(OPENSSL_PATH)/crypto/dso/dso_lib.c=0D
+ $(OPENSSL_PATH)/crypto/dso/dso_openssl.c=0D
+ $(OPENSSL_PATH)/crypto/dso/dso_vms.c=0D
+ $(OPENSSL_PATH)/crypto/dso/dso_win32.c=0D
+ $(OPENSSL_PATH)/crypto/ebcdic.c=0D
+ $(OPENSSL_PATH)/crypto/err/err.c=0D
+ $(OPENSSL_PATH)/crypto/err/err_prn.c=0D
+ $(OPENSSL_PATH)/crypto/evp/bio_b64.c=0D
+ $(OPENSSL_PATH)/crypto/evp/bio_enc.c=0D
+ $(OPENSSL_PATH)/crypto/evp/bio_md.c=0D
+ $(OPENSSL_PATH)/crypto/evp/bio_ok.c=0D
+ $(OPENSSL_PATH)/crypto/evp/c_allc.c=0D
+ $(OPENSSL_PATH)/crypto/evp/c_alld.c=0D
+ $(OPENSSL_PATH)/crypto/evp/cmeth_lib.c=0D
+ $(OPENSSL_PATH)/crypto/evp/digest.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_aes.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_aria.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_bf.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_camellia.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_cast.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_chacha20_poly1305.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_des.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_des3.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_idea.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_null.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_old.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_rc2.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_rc4.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_rc5.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_seed.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_sm4.c=0D
+ $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c=0D
+ $(OPENSSL_PATH)/crypto/evp/encode.c=0D
+ $(OPENSSL_PATH)/crypto/evp/evp_cnf.c=0D
+ $(OPENSSL_PATH)/crypto/evp/evp_enc.c=0D
+ $(OPENSSL_PATH)/crypto/evp/evp_err.c=0D
+ $(OPENSSL_PATH)/crypto/evp/evp_key.c=0D
+ $(OPENSSL_PATH)/crypto/evp/evp_lib.c=0D
+ $(OPENSSL_PATH)/crypto/evp/evp_pbe.c=0D
+ $(OPENSSL_PATH)/crypto/evp/evp_pkey.c=0D
+ $(OPENSSL_PATH)/crypto/evp/m_md2.c=0D
+ $(OPENSSL_PATH)/crypto/evp/m_md4.c=0D
+ $(OPENSSL_PATH)/crypto/evp/m_md5.c=0D
+ $(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c=0D
+ $(OPENSSL_PATH)/crypto/evp/m_mdc2.c=0D
+ $(OPENSSL_PATH)/crypto/evp/m_null.c=0D
+ $(OPENSSL_PATH)/crypto/evp/m_ripemd.c=0D
+ $(OPENSSL_PATH)/crypto/evp/m_sha1.c=0D
+ $(OPENSSL_PATH)/crypto/evp/m_sha3.c=0D
+ $(OPENSSL_PATH)/crypto/evp/m_sigver.c=0D
+ $(OPENSSL_PATH)/crypto/evp/m_wp.c=0D
+ $(OPENSSL_PATH)/crypto/evp/names.c=0D
+ $(OPENSSL_PATH)/crypto/evp/p5_crpt.c=0D
+ $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c=0D
+ $(OPENSSL_PATH)/crypto/evp/p_dec.c=0D
+ $(OPENSSL_PATH)/crypto/evp/p_enc.c=0D
+ $(OPENSSL_PATH)/crypto/evp/p_lib.c=0D
+ $(OPENSSL_PATH)/crypto/evp/p_open.c=0D
+ $(OPENSSL_PATH)/crypto/evp/p_seal.c=0D
+ $(OPENSSL_PATH)/crypto/evp/p_sign.c=0D
+ $(OPENSSL_PATH)/crypto/evp/p_verify.c=0D
+ $(OPENSSL_PATH)/crypto/evp/pbe_scrypt.c=0D
+ $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c=0D
+ $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c=0D
+ $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c=0D
+ $(OPENSSL_PATH)/crypto/ex_data.c=0D
+ $(OPENSSL_PATH)/crypto/getenv.c=0D
+ $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c=0D
+ $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c=0D
+ $(OPENSSL_PATH)/crypto/hmac/hmac.c=0D
+ $(OPENSSL_PATH)/crypto/init.c=0D
+ $(OPENSSL_PATH)/crypto/kdf/hkdf.c=0D
+ $(OPENSSL_PATH)/crypto/kdf/kdf_err.c=0D
+ $(OPENSSL_PATH)/crypto/kdf/scrypt.c=0D
+ $(OPENSSL_PATH)/crypto/kdf/tls1_prf.c=0D
+ $(OPENSSL_PATH)/crypto/lhash/lh_stats.c=0D
+ $(OPENSSL_PATH)/crypto/lhash/lhash.c=0D
+ $(OPENSSL_PATH)/crypto/md5/md5_dgst.c=0D
+ $(OPENSSL_PATH)/crypto/md5/md5_one.c=0D
+ $(OPENSSL_PATH)/crypto/mem.c=0D
+ $(OPENSSL_PATH)/crypto/mem_dbg.c=0D
+ $(OPENSSL_PATH)/crypto/mem_sec.c=0D
+ $(OPENSSL_PATH)/crypto/modes/cbc128.c=0D
+ $(OPENSSL_PATH)/crypto/modes/ccm128.c=0D
+ $(OPENSSL_PATH)/crypto/modes/cfb128.c=0D
+ $(OPENSSL_PATH)/crypto/modes/ctr128.c=0D
+ $(OPENSSL_PATH)/crypto/modes/cts128.c=0D
+ $(OPENSSL_PATH)/crypto/modes/gcm128.c=0D
+ $(OPENSSL_PATH)/crypto/modes/ocb128.c=0D
+ $(OPENSSL_PATH)/crypto/modes/ofb128.c=0D
+ $(OPENSSL_PATH)/crypto/modes/wrap128.c=0D
+ $(OPENSSL_PATH)/crypto/modes/xts128.c=0D
+ $(OPENSSL_PATH)/crypto/o_dir.c=0D
+ $(OPENSSL_PATH)/crypto/o_fips.c=0D
+ $(OPENSSL_PATH)/crypto/o_fopen.c=0D
+ $(OPENSSL_PATH)/crypto/o_init.c=0D
+ $(OPENSSL_PATH)/crypto/o_str.c=0D
+ $(OPENSSL_PATH)/crypto/o_time.c=0D
+ $(OPENSSL_PATH)/crypto/objects/o_names.c=0D
+ $(OPENSSL_PATH)/crypto/objects/obj_dat.c=0D
+ $(OPENSSL_PATH)/crypto/objects/obj_err.c=0D
+ $(OPENSSL_PATH)/crypto/objects/obj_lib.c=0D
+ $(OPENSSL_PATH)/crypto/objects/obj_xref.c=0D
+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c=0D
+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c=0D
+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c=0D
+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c=0D
+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c=0D
+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c=0D
+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c=0D
+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c=0D
+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c=0D
+ $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c=0D
+ $(OPENSSL_PATH)/crypto/pem/pem_all.c=0D
+ $(OPENSSL_PATH)/crypto/pem/pem_err.c=0D
+ $(OPENSSL_PATH)/crypto/pem/pem_info.c=0D
+ $(OPENSSL_PATH)/crypto/pem/pem_lib.c=0D
+ $(OPENSSL_PATH)/crypto/pem/pem_oth.c=0D
+ $(OPENSSL_PATH)/crypto/pem/pem_pk8.c=0D
+ $(OPENSSL_PATH)/crypto/pem/pem_pkey.c=0D
+ $(OPENSSL_PATH)/crypto/pem/pem_sign.c=0D
+ $(OPENSSL_PATH)/crypto/pem/pem_x509.c=0D
+ $(OPENSSL_PATH)/crypto/pem/pem_xaux.c=0D
+ $(OPENSSL_PATH)/crypto/pem/pvkfmt.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_init.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_key.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_sbag.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c=0D
+ $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c=0D
+ $(OPENSSL_PATH)/crypto/rand/drbg_ctr.c=0D
+ $(OPENSSL_PATH)/crypto/rand/drbg_lib.c=0D
+ $(OPENSSL_PATH)/crypto/rand/rand_egd.c=0D
+ $(OPENSSL_PATH)/crypto/rand/rand_err.c=0D
+ $(OPENSSL_PATH)/crypto/rand/rand_lib.c=0D
+ $(OPENSSL_PATH)/crypto/rand/rand_unix.c=0D
+ $(OPENSSL_PATH)/crypto/rand/rand_vms.c=0D
+ $(OPENSSL_PATH)/crypto/rand/rand_win.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_chk.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_err.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_lib.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_meth.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_mp.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_none.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_ossl.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_saos.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_sign.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c=0D
+ $(OPENSSL_PATH)/crypto/sha/keccak1600.c=0D
+ $(OPENSSL_PATH)/crypto/sha/sha1_one.c=0D
+ $(OPENSSL_PATH)/crypto/sha/sha1dgst.c=0D
+ $(OPENSSL_PATH)/crypto/sha/sha256.c=0D
+ $(OPENSSL_PATH)/crypto/sha/sha512.c=0D
+ $(OPENSSL_PATH)/crypto/siphash/siphash.c=0D
+ $(OPENSSL_PATH)/crypto/siphash/siphash_ameth.c=0D
+ $(OPENSSL_PATH)/crypto/siphash/siphash_pmeth.c=0D
+ $(OPENSSL_PATH)/crypto/sm3/m_sm3.c=0D
+ $(OPENSSL_PATH)/crypto/sm3/sm3.c=0D
+ $(OPENSSL_PATH)/crypto/sm4/sm4.c=0D
+ $(OPENSSL_PATH)/crypto/stack/stack.c=0D
+ $(OPENSSL_PATH)/crypto/threads_none.c=0D
+ $(OPENSSL_PATH)/crypto/threads_pthread.c=0D
+ $(OPENSSL_PATH)/crypto/threads_win.c=0D
+ $(OPENSSL_PATH)/crypto/txt_db/txt_db.c=0D
+ $(OPENSSL_PATH)/crypto/ui/ui_err.c=0D
+ $(OPENSSL_PATH)/crypto/ui/ui_lib.c=0D
+ $(OPENSSL_PATH)/crypto/ui/ui_null.c=0D
+ $(OPENSSL_PATH)/crypto/ui/ui_openssl.c=0D
+ $(OPENSSL_PATH)/crypto/ui/ui_util.c=0D
+ $(OPENSSL_PATH)/crypto/uid.c=0D
+ $(OPENSSL_PATH)/crypto/x509/by_dir.c=0D
+ $(OPENSSL_PATH)/crypto/x509/by_file.c=0D
+ $(OPENSSL_PATH)/crypto/x509/t_crl.c=0D
+ $(OPENSSL_PATH)/crypto/x509/t_req.c=0D
+ $(OPENSSL_PATH)/crypto/x509/t_x509.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_att.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_cmp.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_d2.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_def.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_err.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_ext.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_lu.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_meth.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_obj.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_r2x.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_req.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_set.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_trs.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_txt.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_v3.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_vfy.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_vpm.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509cset.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509name.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509rset.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509spki.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x509type.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x_all.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x_attrib.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x_crl.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x_exten.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x_name.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x_pubkey.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x_req.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x_x509.c=0D
+ $(OPENSSL_PATH)/crypto/x509/x_x509a.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/pcy_map.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/pcy_node.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_akey.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_alt.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_conf.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_crld.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_enum.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_extku.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_genn.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_info.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_int.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_lib.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_pci.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_pku.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_prn.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_purp.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_skey.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_tlsf.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3err.c=0D
+ $(OPENSSL_PATH)/crypto/arm_arch.h=0D
+ $(OPENSSL_PATH)/crypto/mips_arch.h=0D
+ $(OPENSSL_PATH)/crypto/ppc_arch.h=0D
+ $(OPENSSL_PATH)/crypto/s390x_arch.h=0D
+ $(OPENSSL_PATH)/crypto/sparc_arch.h=0D
+ $(OPENSSL_PATH)/crypto/vms_rms.h=0D
+ $(OPENSSL_PATH)/crypto/aes/aes_local.h=0D
+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h=0D
+ $(OPENSSL_PATH)/crypto/asn1/asn1_local.h=0D
+ $(OPENSSL_PATH)/crypto/asn1/charmap.h=0D
+ $(OPENSSL_PATH)/crypto/asn1/standard_methods.h=0D
+ $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h=0D
+ $(OPENSSL_PATH)/crypto/async/async_local.h=0D
+ $(OPENSSL_PATH)/crypto/async/arch/async_null.h=0D
+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.h=0D
+ $(OPENSSL_PATH)/crypto/async/arch/async_win.h=0D
+ $(OPENSSL_PATH)/crypto/bio/bio_local.h=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_local.h=0D
+ $(OPENSSL_PATH)/crypto/bn/bn_prime.h=0D
+ $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h=0D
+ $(OPENSSL_PATH)/crypto/comp/comp_local.h=0D
+ $(OPENSSL_PATH)/crypto/conf/conf_def.h=0D
+ $(OPENSSL_PATH)/crypto/conf/conf_local.h=0D
+ $(OPENSSL_PATH)/crypto/dh/dh_local.h=0D
+ $(OPENSSL_PATH)/crypto/dso/dso_local.h=0D
+ $(OPENSSL_PATH)/crypto/evp/evp_local.h=0D
+ $(OPENSSL_PATH)/crypto/hmac/hmac_local.h=0D
+ $(OPENSSL_PATH)/crypto/lhash/lhash_local.h=0D
+ $(OPENSSL_PATH)/crypto/md5/md5_local.h=0D
+ $(OPENSSL_PATH)/crypto/modes/modes_local.h=0D
+ $(OPENSSL_PATH)/crypto/objects/obj_dat.h=0D
+ $(OPENSSL_PATH)/crypto/objects/obj_local.h=0D
+ $(OPENSSL_PATH)/crypto/objects/obj_xref.h=0D
+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h=0D
+ $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h=0D
+ $(OPENSSL_PATH)/crypto/rand/rand_local.h=0D
+ $(OPENSSL_PATH)/crypto/rsa/rsa_local.h=0D
+ $(OPENSSL_PATH)/crypto/sha/sha_local.h=0D
+ $(OPENSSL_PATH)/crypto/siphash/siphash_local.h=0D
+ $(OPENSSL_PATH)/crypto/sm3/sm3_local.h=0D
+ $(OPENSSL_PATH)/crypto/store/store_local.h=0D
+ $(OPENSSL_PATH)/crypto/ui/ui_local.h=0D
+ $(OPENSSL_PATH)/crypto/x509/x509_local.h=0D
+ $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h=0D
+ $(OPENSSL_PATH)/crypto/x509v3/pcy_local.h=0D
+ $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h=0D
+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h=0D
+ $(OPENSSL_PATH)/ssl/bio_ssl.c=0D
+ $(OPENSSL_PATH)/ssl/d1_lib.c=0D
+ $(OPENSSL_PATH)/ssl/d1_msg.c=0D
+ $(OPENSSL_PATH)/ssl/d1_srtp.c=0D
+ $(OPENSSL_PATH)/ssl/methods.c=0D
+ $(OPENSSL_PATH)/ssl/packet.c=0D
+ $(OPENSSL_PATH)/ssl/pqueue.c=0D
+ $(OPENSSL_PATH)/ssl/record/dtls1_bitmap.c=0D
+ $(OPENSSL_PATH)/ssl/record/rec_layer_d1.c=0D
+ $(OPENSSL_PATH)/ssl/record/rec_layer_s3.c=0D
+ $(OPENSSL_PATH)/ssl/record/ssl3_buffer.c=0D
+ $(OPENSSL_PATH)/ssl/record/ssl3_record.c=0D
+ $(OPENSSL_PATH)/ssl/record/ssl3_record_tls13.c=0D
+ $(OPENSSL_PATH)/ssl/s3_cbc.c=0D
+ $(OPENSSL_PATH)/ssl/s3_enc.c=0D
+ $(OPENSSL_PATH)/ssl/s3_lib.c=0D
+ $(OPENSSL_PATH)/ssl/s3_msg.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_asn1.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_cert.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_ciph.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_conf.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_err.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_init.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_lib.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_mcnf.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_rsa.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_sess.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_stat.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_txt.c=0D
+ $(OPENSSL_PATH)/ssl/ssl_utst.c=0D
+ $(OPENSSL_PATH)/ssl/statem/extensions.c=0D
+ $(OPENSSL_PATH)/ssl/statem/extensions_clnt.c=0D
+ $(OPENSSL_PATH)/ssl/statem/extensions_cust.c=0D
+ $(OPENSSL_PATH)/ssl/statem/extensions_srvr.c=0D
+ $(OPENSSL_PATH)/ssl/statem/statem.c=0D
+ $(OPENSSL_PATH)/ssl/statem/statem_clnt.c=0D
+ $(OPENSSL_PATH)/ssl/statem/statem_dtls.c=0D
+ $(OPENSSL_PATH)/ssl/statem/statem_lib.c=0D
+ $(OPENSSL_PATH)/ssl/statem/statem_srvr.c=0D
+ $(OPENSSL_PATH)/ssl/t1_enc.c=0D
+ $(OPENSSL_PATH)/ssl/t1_lib.c=0D
+ $(OPENSSL_PATH)/ssl/t1_trce.c=0D
+ $(OPENSSL_PATH)/ssl/tls13_enc.c=0D
+ $(OPENSSL_PATH)/ssl/tls_srp.c=0D
+ $(OPENSSL_PATH)/ssl/packet_local.h=0D
+ $(OPENSSL_PATH)/ssl/ssl_cert_table.h=0D
+ $(OPENSSL_PATH)/ssl/ssl_local.h=0D
+ $(OPENSSL_PATH)/ssl/record/record.h=0D
+ $(OPENSSL_PATH)/ssl/record/record_local.h=0D
+ $(OPENSSL_PATH)/ssl/statem/statem.h=0D
+ $(OPENSSL_PATH)/ssl/statem/statem_local.h=0D
+# Autogenerated files list ends here=0D
+ buildinf.h=0D
+ rand_pool_noise.h=0D
+ ossl_store.c=0D
+ rand_pool.c=0D
+=0D
+[Sources.X64]=0D
+ rand_pool_noise_tsc.c=0D
+ ApiHooks.c=0D
+=0D
+[Packages]=0D
+ MdePkg/MdePkg.dec=0D
+ CryptoPkg/CryptoPkg.dec=0D
+=0D
+[LibraryClasses]=0D
+ BaseLib=0D
+ DebugLib=0D
+ TimerLib=0D
+ PrintLib=0D
+=0D
+[BuildOptions]=0D
+ #=0D
+ # Disables the following Visual Studio compiler warnings brought by open=
ssl source,=0D
+ # so we do not break the build with /WX option:=0D
+ # C4090: 'function' : different 'const' qualifiers=0D
+ # C4132: 'object' : const object should be initialized (tls13_enc.c)=0D
+ # C4210: nonstandard extension used: function given file scope=0D
+ # C4244: conversion from type1 to type2, possible loss of data=0D
+ # C4245: conversion from type1 to type2, signed/unsigned mismatch=0D
+ # C4267: conversion from size_t to type, possible loss of data=0D
+ # C4306: 'identifier' : conversion from 'type1' to 'type2' of greater =
size=0D
+ # C4310: cast truncates constant value=0D
+ # C4389: 'operator' : signed/unsigned mismatch (xxxx)=0D
+ # C4700: uninitialized local variable 'name' used. (conf_sap.c(71))=0D
+ # C4702: unreachable code=0D
+ # C4706: assignment within conditional expression=0D
+ # C4819: The file contains a character that cannot be represented in t=
he current code page=0D
+ #=0D
+ MSFT:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAG=
S) $(OPENSSL_FLAGS_CONFIG) /wd4090 /wd4132 /wd4210 /wd4244 /wd4245 /wd4267 =
/wd4306 /wd4310 /wd4700 /wd4389 /wd4702 /wd4706 /wd4819=0D
+=0D
+ INTEL:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPEN=
SSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /w=0D
+=0D
+ #=0D
+ # Suppress the following build warnings in openssl so we don't break the=
build with -Werror=0D
+ # -Werror=3Dmaybe-uninitialized: there exist some other paths for whic=
h the variable is not initialized.=0D
+ # -Werror=3Dformat: Check calls to printf and scanf, etc., to make sur=
e that the arguments supplied have=0D
+ # types appropriate to the format string specified.=0D
+ # -Werror=3Dunused-but-set-variable: Warn whenever a local variable is=
assigned to, but otherwise unused (aside from its declaration).=0D
+ #=0D
+ GCC:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSS=
L_FLAGS_CONFIG) -Wno-error=3Dmaybe-uninitialized -Wno-error=3Dformat -Wno-f=
ormat -Wno-error=3Dunused-but-set-variable -DNO_MSABI_VA_FUNCS=0D
+=0D
+ # suppress the following warnings in openssl so we don't break the build=
with warnings-as-errors:=0D
+ # 1295: Deprecated declaration <entity> - give arg types=0D
+ # 550: <entity> was set but never used=0D
+ # 1293: assignment in condition=0D
+ # 111: statement is unreachable (invariably "break;" after "return X;" =
in case statement)=0D
+ # 68: integer conversion resulted in a change of sign ("if (Status =3D=
=3D -1)")=0D
+ # 177: <entity> was declared but never referenced=0D
+ # 223: function <entity> declared implicitly=0D
+ # 144: a value of type <type> cannot be used to initialize an entity of=
type <type>=0D
+ # 513: a value of type <type> cannot be assigned to an entity of type <=
type>=0D
+ # 188: enumerated type mixed with another type (i.e. passing an integer=
as an enum without a cast)=0D
+ # 1296: Extended constant initialiser used=0D
+ # 128: loop is not reachable - may be emitted inappropriately if code f=
ollows a conditional return=0D
+ # from the function that evaluates to true at compile time=0D
+ # 546: transfer of control bypasses initialization - may be emitted ina=
ppropriately if the uninitialized=0D
+ # variable is never referenced after the jump=0D
+ # 1: ignore "#1-D: last line of file ends without a newline"=0D
+ # 3017: <entity> may be used before being set (NOTE: This was fixed in O=
penSSL 1.1 HEAD with=0D
+ # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be drop=
ped then.)=0D
+ XCODE:*_*_X64_CC_FLAGS =3D -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FL=
AGS) $(OPENSSL_FLAGS_CONFIG) -w -std=3Dc99 -Wno-error=3Duninitialized=0D
diff --git a/CryptoPkg/Library/Include/openssl/opensslconf.h b/CryptoPkg/Li=
brary/Include/openssl/opensslconf.h
index 3a2544ea5c..e8f73c4d10 100644
--- a/CryptoPkg/Library/Include/openssl/opensslconf.h
+++ b/CryptoPkg/Library/Include/openssl/opensslconf.h
@@ -112,9 +112,6 @@ extern "C" {
#ifndef OPENSSL_NO_ASAN=0D
# define OPENSSL_NO_ASAN=0D
#endif=0D
-#ifndef OPENSSL_NO_ASM=0D
-# define OPENSSL_NO_ASM=0D
-#endif=0D
#ifndef OPENSSL_NO_ASYNC=0D
# define OPENSSL_NO_ASYNC=0D
#endif=0D
diff --git a/CryptoPkg/Library/OpensslLib/ApiHooks.c b/CryptoPkg/Library/Op=
ensslLib/ApiHooks.c
new file mode 100644
index 0000000000..58cff16838
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/ApiHooks.c
@@ -0,0 +1,18 @@
+/** @file=0D
+ OpenSSL Library API hooks.=0D
+=0D
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>=0D
+SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+=0D
+**/=0D
+=0D
+#include <Uefi.h>=0D
+=0D
+VOID *=0D
+__imp_RtlVirtualUnwind (=0D
+ VOID * Args=0D
+ )=0D
+{=0D
+ return NULL;=0D
+}=0D
+=0D
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c b/CryptoP=
kg/Library/OpensslLib/OpensslLibConstructor.c
new file mode 100644
index 0000000000..ef20d2b84e
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
@@ -0,0 +1,34 @@
+/** @file=0D
+ Constructor to initialize CPUID data for OpenSSL assembly operations.=0D
+=0D
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>=0D
+SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+=0D
+**/=0D
+=0D
+#include <Uefi.h>=0D
+=0D
+extern void OPENSSL_cpuid_setup (void);=0D
+=0D
+/**=0D
+ Constructor routine for OpensslLib.=0D
+=0D
+ The constructor calls an internal OpenSSL function which fetches a local=
copy=0D
+ of the hardware capability flags, used to enable native crypto instructi=
ons.=0D
+=0D
+ @param None=0D
+=0D
+ @retval EFI_SUCCESS The construction succeeded.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+EFIAPI=0D
+OpensslLibConstructor (=0D
+ VOID=0D
+ )=0D
+{=0D
+ OPENSSL_cpuid_setup ();=0D
+=0D
+ return EFI_SUCCESS;=0D
+}=0D
+=0D
diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl b/CryptoPkg/Libr=
ary/OpensslLib/process_files.pl
index 57ce195394..472f59bc8e 100755
--- a/CryptoPkg/Library/OpensslLib/process_files.pl
+++ b/CryptoPkg/Library/OpensslLib/process_files.pl
@@ -9,9 +9,63 @@
# do not need to do this, since the results are stored in the EDK2=0D
# git repository for them.=0D
#=0D
+# Due to the script wrapping required to process the OpenSSL=0D
+# configuration data, each native architecture must be processed=0D
+# individually by the maintainer (in addition to the standard version):=0D
+# ./process_files.pl=0D
+# ./process_files.pl X64=0D
+# ./process_files.pl [Arch]=0D
+=0D
use strict;=0D
use Cwd;=0D
use File::Copy;=0D
+use File::Basename;=0D
+use File::Path qw(make_path remove_tree);=0D
+use Text::Tabs;=0D
+=0D
+#=0D
+# OpenSSL perlasm generator script does not transfer the copyright header=
=0D
+#=0D
+sub copy_license_header=0D
+{=0D
+ my @args =3D split / /, shift; #Separate args by spaces=0D
+ my $source =3D $args[1]; #Source file is second (after "perl"=
)=0D
+ my $target =3D pop @args; #Target file is always last=0D
+ chop ($target); #Remove newline char=0D
+=0D
+ my $temp_file_name =3D "license.tmp";=0D
+ open (my $source_file, "<" . $source) || die $source;=0D
+ open (my $target_file, "<" . $target) || die $target;=0D
+ open (my $temp_file, ">" . $temp_file_name) || die $temp_file_name;=0D
+=0D
+ #Add "generated file" warning=0D
+ $source =3D~ s/^..//; #Remove leading "./"=0D
+ print ($temp_file "; WARNING: do not edit!\r\n");=0D
+ print ($temp_file "; Generated from $source\r\n");=0D
+ print ($temp_file ";\r\n");=0D
+=0D
+ #Copy source file header to temp file=0D
+ while (my $line =3D <$source_file>) {=0D
+ next if ($line =3D~ /#!/); #Ignore shebang line=0D
+ $line =3D~ s/#/;/; #Fix comment character for assembly=
=0D
+ $line =3D~ s/\s+$/\r\n/; #Trim trailing whitepsace, fixup lin=
e endings=0D
+ print ($temp_file $line);=0D
+ last if ($line =3D~ /http/); #Last line of copyright header conta=
ins a web link=0D
+ }=0D
+ print ($temp_file "\r\n");=0D
+ #Retrieve generated assembly contents=0D
+ while (my $line =3D <$target_file>) {=0D
+ $line =3D~ s/\s+$/\r\n/; #Trim trailing whitepsace, fixup lin=
e endings=0D
+ print ($temp_file expand ($line)); #expand() replaces tabs with s=
paces=0D
+ }=0D
+=0D
+ close ($source_file);=0D
+ close ($target_file);=0D
+ close ($temp_file);=0D
+=0D
+ move ($temp_file_name, $target) ||=0D
+ die "Cannot replace \"" . $target . "\"!";=0D
+}=0D
=0D
#=0D
# Find the openssl directory name for use lib. We have to do this=0D
@@ -21,10 +75,41 @@ use File::Copy;
#=0D
my $inf_file;=0D
my $OPENSSL_PATH;=0D
+my $uefi_config;=0D
+my $extension;=0D
+my $arch;=0D
my @inf;=0D
=0D
BEGIN {=0D
$inf_file =3D "OpensslLib.inf";=0D
+ $uefi_config =3D "UEFI";=0D
+ $arch =3D shift;=0D
+=0D
+ if (defined $arch) {=0D
+ if (uc ($arch) eq "X64") {=0D
+ $arch =3D "X64";=0D
+ $inf_file =3D "OpensslLibX64.inf";=0D
+ $uefi_config =3D "UEFI-x86_64";=0D
+ $extension =3D "nasm";=0D
+ } else {=0D
+ die "Unsupported architecture \"" . $arch . "\"!";=0D
+ }=0D
+ if ($extension eq "nasm") {=0D
+ if (`nasm -v 2>&1`) {=0D
+ #Presence of nasm executable will trigger inclusion of AVX=
instructions=0D
+ die "\nCannot run assembly generators with NASM in path!\n=
\n";=0D
+ }=0D
+ }=0D
+=0D
+ # Prepare assembly folder=0D
+ if (-d $arch) {=0D
+ remove_tree ($arch, {safe =3D> 1}) ||=0D
+ die "Cannot clean assembly folder \"" . $arch . "\"!";=0D
+ } else {=0D
+ mkdir $arch ||=0D
+ die "Cannot create assembly folder \"" . $arch . "\"!";=0D
+ }=0D
+ }=0D
=0D
# Read the contents of the inf file=0D
open( FD, "<" . $inf_file ) ||=0D
@@ -47,9 +132,9 @@ BEGIN {
# Configure UEFI=0D
system(=0D
"./Configure",=0D
- "UEFI",=0D
+ "--config=3D../uefi-asm.conf",=0D
+ "$uefi_config",=0D
"no-afalgeng",=0D
- "no-asm",=0D
"no-async",=0D
"no-autoerrinit",=0D
"no-autoload-config",=0D
@@ -129,23 +214,53 @@ BEGIN {
# Retrieve file lists from OpenSSL configdata=0D
#=0D
use configdata qw/%unified_info/;=0D
+use configdata qw/%config/;=0D
+use configdata qw/%target/;=0D
+=0D
+#=0D
+# Collect build flags from configdata=0D
+#=0D
+my $flags =3D "";=0D
+foreach my $f (@{$config{lib_defines}}) {=0D
+ $flags .=3D " -D$f";=0D
+}=0D
=0D
my @cryptofilelist =3D ();=0D
my @sslfilelist =3D ();=0D
+my @asmfilelist =3D ();=0D
+my @asmbuild =3D ();=0D
foreach my $product ((@{$unified_info{libraries}},=0D
@{$unified_info{engines}})) {=0D
foreach my $o (@{$unified_info{sources}->{$product}}) {=0D
foreach my $s (@{$unified_info{sources}->{$o}}) {=0D
- next if ($unified_info{generate}->{$s});=0D
- next if $s =3D~ "crypto/bio/b_print.c";=0D
-=0D
# No need to add unused files in UEFI.=0D
# So it can reduce porting time, compile time, library size.=0D
+ next if $s =3D~ "crypto/bio/b_print.c";=0D
next if $s =3D~ "crypto/rand/randfile.c";=0D
next if $s =3D~ "crypto/store/";=0D
next if $s =3D~ "crypto/err/err_all.c";=0D
next if $s =3D~ "crypto/aes/aes_ecb.c";=0D
=0D
+ if ($unified_info{generate}->{$s}) {=0D
+ if (defined $arch) {=0D
+ my $buildstring =3D "perl";=0D
+ foreach my $arg (@{$unified_info{generate}->{$s}}) {=0D
+ if ($arg =3D~ ".pl") {=0D
+ $buildstring .=3D " ./openssl/$arg";=0D
+ } elsif ($arg =3D~ "PERLASM_SCHEME") {=0D
+ $buildstring .=3D " $target{perlasm_scheme}";=
=0D
+ } elsif ($arg =3D~ "LIB_CFLAGS") {=0D
+ $buildstring .=3D "$flags";=0D
+ }=0D
+ }=0D
+ ($s, my $path, undef) =3D fileparse($s, qr/\.[^.]*/);=
=0D
+ $buildstring .=3D " ./$arch/$path$s.$extension";=0D
+ make_path ("./$arch/$path");=0D
+ push @asmbuild, "$buildstring\n";=0D
+ push @asmfilelist, " $arch/$path$s.$extension\r\n";=0D
+ }=0D
+ next;=0D
+ }=0D
if ($product =3D~ "libssl") {=0D
push @sslfilelist, ' $(OPENSSL_PATH)/' . $s . "\r\n";=0D
next;=0D
@@ -183,15 +298,31 @@ foreach (@headers){
}=0D
=0D
=0D
+#=0D
+# Generate assembly files=0D
+#=0D
+if (@asmbuild) {=0D
+ print "\n--> Generating assembly files ... ";=0D
+ foreach my $buildstring (@asmbuild) {=0D
+ system ("$buildstring");=0D
+ copy_license_header ($buildstring);=0D
+ }=0D
+ print "Done!";=0D
+}=0D
+=0D
#=0D
# Update OpensslLib.inf with autogenerated file list=0D
#=0D
my @new_inf =3D ();=0D
my $subbing =3D 0;=0D
-print "\n--> Updating OpensslLib.inf ... ";=0D
+print "\n--> Updating $inf_file ... ";=0D
foreach (@inf) {=0D
+ if ($_ =3D~ "DEFINE OPENSSL_FLAGS_CONFIG") {=0D
+ push @new_inf, " DEFINE OPENSSL_FLAGS_CONFIG =3D" . $flags . "=
\r\n";=0D
+ next;=0D
+ }=0D
if ( $_ =3D~ "# Autogenerated files list starts here" ) {=0D
- push @new_inf, $_, @cryptofilelist, @sslfilelist;=0D
+ push @new_inf, $_, @asmfilelist, @cryptofilelist, @sslfilelist;=0D
$subbing =3D 1;=0D
next;=0D
}=0D
@@ -216,49 +347,51 @@ rename( $new_inf_file, $inf_file ) ||
die "rename $inf_file";=0D
print "Done!";=0D
=0D
-#=0D
-# Update OpensslLibCrypto.inf with auto-generated file list (no libssl)=0D
-#=0D
-$inf_file =3D "OpensslLibCrypto.inf";=0D
-=0D
-# Read the contents of the inf file=0D
-@inf =3D ();=0D
-@new_inf =3D ();=0D
-open( FD, "<" . $inf_file ) ||=0D
- die "Cannot open \"" . $inf_file . "\"!";=0D
-@inf =3D (<FD>);=0D
-close(FD) ||=0D
- die "Cannot close \"" . $inf_file . "\"!";=0D
+if (!defined $arch) {=0D
+ #=0D
+ # Update OpensslLibCrypto.inf with auto-generated file list (no libssl=
)=0D
+ #=0D
+ $inf_file =3D "OpensslLibCrypto.inf";=0D
=0D
-$subbing =3D 0;=0D
-print "\n--> Updating OpensslLibCrypto.inf ... ";=0D
-foreach (@inf) {=0D
- if ( $_ =3D~ "# Autogenerated files list starts here" ) {=0D
- push @new_inf, $_, @cryptofilelist;=0D
- $subbing =3D 1;=0D
- next;=0D
- }=0D
- if ( $_ =3D~ "# Autogenerated files list ends here" ) {=0D
- push @new_inf, $_;=0D
- $subbing =3D 0;=0D
- next;=0D
+ # Read the contents of the inf file=0D
+ @inf =3D ();=0D
+ @new_inf =3D ();=0D
+ open( FD, "<" . $inf_file ) ||=0D
+ die "Cannot open \"" . $inf_file . "\"!";=0D
+ @inf =3D (<FD>);=0D
+ close(FD) ||=0D
+ die "Cannot close \"" . $inf_file . "\"!";=0D
+=0D
+ $subbing =3D 0;=0D
+ print "\n--> Updating OpensslLibCrypto.inf ... ";=0D
+ foreach (@inf) {=0D
+ if ( $_ =3D~ "# Autogenerated files list starts here" ) {=0D
+ push @new_inf, $_, @cryptofilelist;=0D
+ $subbing =3D 1;=0D
+ next;=0D
+ }=0D
+ if ( $_ =3D~ "# Autogenerated files list ends here" ) {=0D
+ push @new_inf, $_;=0D
+ $subbing =3D 0;=0D
+ next;=0D
+ }=0D
+=0D
+ push @new_inf, $_=0D
+ unless ($subbing);=0D
}=0D
=0D
- push @new_inf, $_=0D
- unless ($subbing);=0D
+ $new_inf_file =3D $inf_file . ".new";=0D
+ open( FD, ">" . $new_inf_file ) ||=0D
+ die $new_inf_file;=0D
+ print( FD @new_inf ) ||=0D
+ die $new_inf_file;=0D
+ close(FD) ||=0D
+ die $new_inf_file;=0D
+ rename( $new_inf_file, $inf_file ) ||=0D
+ die "rename $inf_file";=0D
+ print "Done!";=0D
}=0D
=0D
-$new_inf_file =3D $inf_file . ".new";=0D
-open( FD, ">" . $new_inf_file ) ||=0D
- die $new_inf_file;=0D
-print( FD @new_inf ) ||=0D
- die $new_inf_file;=0D
-close(FD) ||=0D
- die $new_inf_file;=0D
-rename( $new_inf_file, $inf_file ) ||=0D
- die "rename $inf_file";=0D
-print "Done!";=0D
-=0D
#=0D
# Copy opensslconf.h and dso_conf.h generated from OpenSSL Configuration=0D
#=0D
diff --git a/CryptoPkg/Library/OpensslLib/uefi-asm.conf b/CryptoPkg/Library=
/OpensslLib/uefi-asm.conf
new file mode 100644
index 0000000000..55eedbf3ba
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
@@ -0,0 +1,15 @@
+## -*- mode: perl; -*-=0D
+## UEFI assembly openssl configuration targets.=0D
+=0D
+my %targets =3D (=0D
+#### UEFI=0D
+ "UEFI-x86_64" =3D> {=0D
+ perlasm_scheme =3D> "nasm",=0D
+ # inherit_from =3D> [ "UEFI", asm("x86_64_asm") ],=0D
+ inherit_from =3D> [ "UEFI" ],=0D
+ cpuid_asm_src =3D> "x86_64cpuid.s",=0D
+ aes_asm_src =3D> "aes_core.c aes_cbc.c vpaes-x86_64.s aesni-x8=
6_64.s aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",=0D
+ sha1_asm_src =3D> "sha1-x86_64.s sha256-x86_64.s sha512-x86_64.=
s sha1-mb-x86_64.s sha256-mb-x86_64.s",=0D
+ modes_asm_src =3D> "ghash-x86_64.s",=0D
+ },=0D
+);=0D
--=20
2.28.0.windows.1


Guomin Jiang
 

It is slight complex, I will review it by 9/11/2020.

Thanks.

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zurcher,
Christopher J
Sent: Tuesday, August 4, 2020 8:24 AM
To: devel@edk2.groups.io
Cc: Yao, Jiewen <jiewen.yao@...>; Wang, Jian J
<jian.j.wang@...>; Lu, XiaoyuX <xiaoyux.lu@...>; Ard
Biesheuvel <ard.biesheuvel@...>
Subject: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2507

Adding OpensslLibX64.inf and modifying process_files.pl to process this file
and generate the necessary assembly files.
ApiHooks.c contains a stub function for a Windows API call.
uefi-asm.conf contains the limited assembly configurations for OpenSSL.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyux.lu@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Christopher J Zurcher <christopher.j.zurcher@...>
---
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibX64.inf | 656
++++++++++++++++++++
CryptoPkg/Library/Include/openssl/opensslconf.h | 3 -
CryptoPkg/Library/OpensslLib/ApiHooks.c | 18 +
CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c | 34 +
CryptoPkg/Library/OpensslLib/process_files.pl | 223 +++++--
CryptoPkg/Library/OpensslLib/uefi-asm.conf | 15 +
8 files changed, 903 insertions(+), 50 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index dbbe5386a1..bd62d86936 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0 LIBRARY_CLASS = OpensslLib
DEFINE OPENSSL_PATH = openssl- DEFINE OPENSSL_FLAGS = -
DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT -
D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE+
DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM # # VALID_ARCHITECTURES = IA32 X64 ARM
AARCH64diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 616ccd9f62..2b7324a990 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0 LIBRARY_CLASS = OpensslLib
DEFINE OPENSSL_PATH = openssl- DEFINE OPENSSL_FLAGS = -
DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT -
D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE+
DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM # # VALID_ARCHITECTURES = IA32 X64 ARM
AARCH64diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
new file mode 100644
index 0000000000..825eea0254
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
@@ -0,0 +1,656 @@
+## @file+# This module provides OpenSSL Library implementation.+#+#
Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>+# (C)
Copyright 2020 Hewlett Packard Enterprise Development LP<BR>+# SPDX-
License-Identifier: BSD-2-Clause-Patent+#+##++[Defines]+ INF_VERSION
= 0x00010005+ BASE_NAME = OpensslLibX64+
MODULE_UNI_FILE = OpensslLib.uni+ FILE_GUID =
18125E50-0117-4DD0-BE54-4784AD995FEF+ MODULE_TYPE = BASE+
VERSION_STRING = 1.0+ LIBRARY_CLASS = OpensslLib+
DEFINE OPENSSL_PATH = openssl+ DEFINE OPENSSL_FLAGS = -
DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT -
D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE+
DEFINE OPENSSL_FLAGS_CONFIG = -DOPENSSL_CPUID_OBJ -DSHA1_ASM -
DSHA256_ASM -DSHA512_ASM -DAESNI_ASM -DVPAES_ASM -
DGHASH_ASM+ CONSTRUCTOR = OpensslLibConstructor++#+#
VALID_ARCHITECTURES = X64+#++[Sources]+ OpensslLibConstructor.c+
$(OPENSSL_PATH)/e_os.h+ $(OPENSSL_PATH)/ms/uplink.h+#
Autogenerated files list starts here+ X64/crypto/aes/aesni-mb-
x86_64.nasm+ X64/crypto/aes/aesni-sha1-x86_64.nasm+
X64/crypto/aes/aesni-sha256-x86_64.nasm+ X64/crypto/aes/aesni-
x86_64.nasm+ X64/crypto/aes/vpaes-x86_64.nasm+
X64/crypto/modes/ghash-x86_64.nasm+ X64/crypto/sha/sha1-mb-
x86_64.nasm+ X64/crypto/sha/sha1-x86_64.nasm+ X64/crypto/sha/sha256-
mb-x86_64.nasm+ X64/crypto/sha/sha256-x86_64.nasm+
X64/crypto/sha/sha512-x86_64.nasm+ X64/crypto/x86_64cpuid.nasm+
$(OPENSSL_PATH)/crypto/aes/aes_cbc.c+
$(OPENSSL_PATH)/crypto/aes/aes_cfb.c+
$(OPENSSL_PATH)/crypto/aes/aes_core.c+
$(OPENSSL_PATH)/crypto/aes/aes_ige.c+
$(OPENSSL_PATH)/crypto/aes/aes_misc.c+
$(OPENSSL_PATH)/crypto/aes/aes_ofb.c+
$(OPENSSL_PATH)/crypto/aes/aes_wrap.c+
$(OPENSSL_PATH)/crypto/aria/aria.c+
$(OPENSSL_PATH)/crypto/asn1/a_bitstr.c+
$(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c+
$(OPENSSL_PATH)/crypto/asn1/a_digest.c+
$(OPENSSL_PATH)/crypto/asn1/a_dup.c+
$(OPENSSL_PATH)/crypto/asn1/a_gentm.c+
$(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c+
$(OPENSSL_PATH)/crypto/asn1/a_int.c+
$(OPENSSL_PATH)/crypto/asn1/a_mbstr.c+
$(OPENSSL_PATH)/crypto/asn1/a_object.c+
$(OPENSSL_PATH)/crypto/asn1/a_octet.c+
$(OPENSSL_PATH)/crypto/asn1/a_print.c+
$(OPENSSL_PATH)/crypto/asn1/a_sign.c+
$(OPENSSL_PATH)/crypto/asn1/a_strex.c+
$(OPENSSL_PATH)/crypto/asn1/a_strnid.c+
$(OPENSSL_PATH)/crypto/asn1/a_time.c+
$(OPENSSL_PATH)/crypto/asn1/a_type.c+
$(OPENSSL_PATH)/crypto/asn1/a_utctm.c+
$(OPENSSL_PATH)/crypto/asn1/a_utf8.c+
$(OPENSSL_PATH)/crypto/asn1/a_verify.c+
$(OPENSSL_PATH)/crypto/asn1/ameth_lib.c+
$(OPENSSL_PATH)/crypto/asn1/asn1_err.c+
$(OPENSSL_PATH)/crypto/asn1/asn1_gen.c+
$(OPENSSL_PATH)/crypto/asn1/asn1_item_list.c+
$(OPENSSL_PATH)/crypto/asn1/asn1_lib.c+
$(OPENSSL_PATH)/crypto/asn1/asn1_par.c+
$(OPENSSL_PATH)/crypto/asn1/asn_mime.c+
$(OPENSSL_PATH)/crypto/asn1/asn_moid.c+
$(OPENSSL_PATH)/crypto/asn1/asn_mstbl.c+
$(OPENSSL_PATH)/crypto/asn1/asn_pack.c+
$(OPENSSL_PATH)/crypto/asn1/bio_asn1.c+
$(OPENSSL_PATH)/crypto/asn1/bio_ndef.c+
$(OPENSSL_PATH)/crypto/asn1/d2i_pr.c+
$(OPENSSL_PATH)/crypto/asn1/d2i_pu.c+
$(OPENSSL_PATH)/crypto/asn1/evp_asn1.c+
$(OPENSSL_PATH)/crypto/asn1/f_int.c+
$(OPENSSL_PATH)/crypto/asn1/f_string.c+
$(OPENSSL_PATH)/crypto/asn1/i2d_pr.c+
$(OPENSSL_PATH)/crypto/asn1/i2d_pu.c+
$(OPENSSL_PATH)/crypto/asn1/n_pkey.c+
$(OPENSSL_PATH)/crypto/asn1/nsseq.c+
$(OPENSSL_PATH)/crypto/asn1/p5_pbe.c+
$(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c+
$(OPENSSL_PATH)/crypto/asn1/p5_scrypt.c+
$(OPENSSL_PATH)/crypto/asn1/p8_pkey.c+
$(OPENSSL_PATH)/crypto/asn1/t_bitst.c+
$(OPENSSL_PATH)/crypto/asn1/t_pkey.c+
$(OPENSSL_PATH)/crypto/asn1/t_spki.c+
$(OPENSSL_PATH)/crypto/asn1/tasn_dec.c+
$(OPENSSL_PATH)/crypto/asn1/tasn_enc.c+
$(OPENSSL_PATH)/crypto/asn1/tasn_fre.c+
$(OPENSSL_PATH)/crypto/asn1/tasn_new.c+
$(OPENSSL_PATH)/crypto/asn1/tasn_prn.c+
$(OPENSSL_PATH)/crypto/asn1/tasn_scn.c+
$(OPENSSL_PATH)/crypto/asn1/tasn_typ.c+
$(OPENSSL_PATH)/crypto/asn1/tasn_utl.c+
$(OPENSSL_PATH)/crypto/asn1/x_algor.c+
$(OPENSSL_PATH)/crypto/asn1/x_bignum.c+
$(OPENSSL_PATH)/crypto/asn1/x_info.c+
$(OPENSSL_PATH)/crypto/asn1/x_int64.c+
$(OPENSSL_PATH)/crypto/asn1/x_long.c+
$(OPENSSL_PATH)/crypto/asn1/x_pkey.c+
$(OPENSSL_PATH)/crypto/asn1/x_sig.c+
$(OPENSSL_PATH)/crypto/asn1/x_spki.c+
$(OPENSSL_PATH)/crypto/asn1/x_val.c+
$(OPENSSL_PATH)/crypto/async/arch/async_null.c+
$(OPENSSL_PATH)/crypto/async/arch/async_posix.c+
$(OPENSSL_PATH)/crypto/async/arch/async_win.c+
$(OPENSSL_PATH)/crypto/async/async.c+
$(OPENSSL_PATH)/crypto/async/async_err.c+
$(OPENSSL_PATH)/crypto/async/async_wait.c+
$(OPENSSL_PATH)/crypto/bio/b_addr.c+
$(OPENSSL_PATH)/crypto/bio/b_dump.c+
$(OPENSSL_PATH)/crypto/bio/b_sock.c+
$(OPENSSL_PATH)/crypto/bio/b_sock2.c+
$(OPENSSL_PATH)/crypto/bio/bf_buff.c+
$(OPENSSL_PATH)/crypto/bio/bf_lbuf.c+
$(OPENSSL_PATH)/crypto/bio/bf_nbio.c+
$(OPENSSL_PATH)/crypto/bio/bf_null.c+
$(OPENSSL_PATH)/crypto/bio/bio_cb.c+
$(OPENSSL_PATH)/crypto/bio/bio_err.c+
$(OPENSSL_PATH)/crypto/bio/bio_lib.c+
$(OPENSSL_PATH)/crypto/bio/bio_meth.c+
$(OPENSSL_PATH)/crypto/bio/bss_acpt.c+
$(OPENSSL_PATH)/crypto/bio/bss_bio.c+
$(OPENSSL_PATH)/crypto/bio/bss_conn.c+
$(OPENSSL_PATH)/crypto/bio/bss_dgram.c+
$(OPENSSL_PATH)/crypto/bio/bss_fd.c+
$(OPENSSL_PATH)/crypto/bio/bss_file.c+
$(OPENSSL_PATH)/crypto/bio/bss_log.c+
$(OPENSSL_PATH)/crypto/bio/bss_mem.c+
$(OPENSSL_PATH)/crypto/bio/bss_null.c+
$(OPENSSL_PATH)/crypto/bio/bss_sock.c+
$(OPENSSL_PATH)/crypto/bn/bn_add.c+
$(OPENSSL_PATH)/crypto/bn/bn_asm.c+
$(OPENSSL_PATH)/crypto/bn/bn_blind.c+
$(OPENSSL_PATH)/crypto/bn/bn_const.c+
$(OPENSSL_PATH)/crypto/bn/bn_ctx.c+
$(OPENSSL_PATH)/crypto/bn/bn_depr.c+
$(OPENSSL_PATH)/crypto/bn/bn_dh.c+
$(OPENSSL_PATH)/crypto/bn/bn_div.c+
$(OPENSSL_PATH)/crypto/bn/bn_err.c+
$(OPENSSL_PATH)/crypto/bn/bn_exp.c+
$(OPENSSL_PATH)/crypto/bn/bn_exp2.c+
$(OPENSSL_PATH)/crypto/bn/bn_gcd.c+
$(OPENSSL_PATH)/crypto/bn/bn_gf2m.c+
$(OPENSSL_PATH)/crypto/bn/bn_intern.c+
$(OPENSSL_PATH)/crypto/bn/bn_kron.c+
$(OPENSSL_PATH)/crypto/bn/bn_lib.c+
$(OPENSSL_PATH)/crypto/bn/bn_mod.c+
$(OPENSSL_PATH)/crypto/bn/bn_mont.c+
$(OPENSSL_PATH)/crypto/bn/bn_mpi.c+
$(OPENSSL_PATH)/crypto/bn/bn_mul.c+
$(OPENSSL_PATH)/crypto/bn/bn_nist.c+
$(OPENSSL_PATH)/crypto/bn/bn_prime.c+
$(OPENSSL_PATH)/crypto/bn/bn_print.c+
$(OPENSSL_PATH)/crypto/bn/bn_rand.c+
$(OPENSSL_PATH)/crypto/bn/bn_recp.c+
$(OPENSSL_PATH)/crypto/bn/bn_shift.c+
$(OPENSSL_PATH)/crypto/bn/bn_sqr.c+
$(OPENSSL_PATH)/crypto/bn/bn_sqrt.c+
$(OPENSSL_PATH)/crypto/bn/bn_srp.c+
$(OPENSSL_PATH)/crypto/bn/bn_word.c+
$(OPENSSL_PATH)/crypto/bn/bn_x931p.c+
$(OPENSSL_PATH)/crypto/buffer/buf_err.c+
$(OPENSSL_PATH)/crypto/buffer/buffer.c+
$(OPENSSL_PATH)/crypto/cmac/cm_ameth.c+
$(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c+
$(OPENSSL_PATH)/crypto/cmac/cmac.c+
$(OPENSSL_PATH)/crypto/comp/c_zlib.c+
$(OPENSSL_PATH)/crypto/comp/comp_err.c+
$(OPENSSL_PATH)/crypto/comp/comp_lib.c+
$(OPENSSL_PATH)/crypto/conf/conf_api.c+
$(OPENSSL_PATH)/crypto/conf/conf_def.c+
$(OPENSSL_PATH)/crypto/conf/conf_err.c+
$(OPENSSL_PATH)/crypto/conf/conf_lib.c+
$(OPENSSL_PATH)/crypto/conf/conf_mall.c+
$(OPENSSL_PATH)/crypto/conf/conf_mod.c+
$(OPENSSL_PATH)/crypto/conf/conf_sap.c+
$(OPENSSL_PATH)/crypto/conf/conf_ssl.c+
$(OPENSSL_PATH)/crypto/cpt_err.c+ $(OPENSSL_PATH)/crypto/cryptlib.c+
$(OPENSSL_PATH)/crypto/ctype.c+ $(OPENSSL_PATH)/crypto/cversion.c+
$(OPENSSL_PATH)/crypto/dh/dh_ameth.c+
$(OPENSSL_PATH)/crypto/dh/dh_asn1.c+
$(OPENSSL_PATH)/crypto/dh/dh_check.c+
$(OPENSSL_PATH)/crypto/dh/dh_depr.c+
$(OPENSSL_PATH)/crypto/dh/dh_err.c+
$(OPENSSL_PATH)/crypto/dh/dh_gen.c+
$(OPENSSL_PATH)/crypto/dh/dh_kdf.c+
$(OPENSSL_PATH)/crypto/dh/dh_key.c+
$(OPENSSL_PATH)/crypto/dh/dh_lib.c+
$(OPENSSL_PATH)/crypto/dh/dh_meth.c+
$(OPENSSL_PATH)/crypto/dh/dh_pmeth.c+
$(OPENSSL_PATH)/crypto/dh/dh_prn.c+
$(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c+
$(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c+
$(OPENSSL_PATH)/crypto/dso/dso_dl.c+
$(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c+
$(OPENSSL_PATH)/crypto/dso/dso_err.c+
$(OPENSSL_PATH)/crypto/dso/dso_lib.c+
$(OPENSSL_PATH)/crypto/dso/dso_openssl.c+
$(OPENSSL_PATH)/crypto/dso/dso_vms.c+
$(OPENSSL_PATH)/crypto/dso/dso_win32.c+
$(OPENSSL_PATH)/crypto/ebcdic.c+ $(OPENSSL_PATH)/crypto/err/err.c+
$(OPENSSL_PATH)/crypto/err/err_prn.c+
$(OPENSSL_PATH)/crypto/evp/bio_b64.c+
$(OPENSSL_PATH)/crypto/evp/bio_enc.c+
$(OPENSSL_PATH)/crypto/evp/bio_md.c+
$(OPENSSL_PATH)/crypto/evp/bio_ok.c+
$(OPENSSL_PATH)/crypto/evp/c_allc.c+
$(OPENSSL_PATH)/crypto/evp/c_alld.c+
$(OPENSSL_PATH)/crypto/evp/cmeth_lib.c+
$(OPENSSL_PATH)/crypto/evp/digest.c+
$(OPENSSL_PATH)/crypto/evp/e_aes.c+
$(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c+
$(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c+
$(OPENSSL_PATH)/crypto/evp/e_aria.c+
$(OPENSSL_PATH)/crypto/evp/e_bf.c+
$(OPENSSL_PATH)/crypto/evp/e_camellia.c+
$(OPENSSL_PATH)/crypto/evp/e_cast.c+
$(OPENSSL_PATH)/crypto/evp/e_chacha20_poly1305.c+
$(OPENSSL_PATH)/crypto/evp/e_des.c+
$(OPENSSL_PATH)/crypto/evp/e_des3.c+
$(OPENSSL_PATH)/crypto/evp/e_idea.c+
$(OPENSSL_PATH)/crypto/evp/e_null.c+
$(OPENSSL_PATH)/crypto/evp/e_old.c+
$(OPENSSL_PATH)/crypto/evp/e_rc2.c+
$(OPENSSL_PATH)/crypto/evp/e_rc4.c+
$(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c+
$(OPENSSL_PATH)/crypto/evp/e_rc5.c+
$(OPENSSL_PATH)/crypto/evp/e_seed.c+
$(OPENSSL_PATH)/crypto/evp/e_sm4.c+
$(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c+
$(OPENSSL_PATH)/crypto/evp/encode.c+
$(OPENSSL_PATH)/crypto/evp/evp_cnf.c+
$(OPENSSL_PATH)/crypto/evp/evp_enc.c+
$(OPENSSL_PATH)/crypto/evp/evp_err.c+
$(OPENSSL_PATH)/crypto/evp/evp_key.c+
$(OPENSSL_PATH)/crypto/evp/evp_lib.c+
$(OPENSSL_PATH)/crypto/evp/evp_pbe.c+
$(OPENSSL_PATH)/crypto/evp/evp_pkey.c+
$(OPENSSL_PATH)/crypto/evp/m_md2.c+
$(OPENSSL_PATH)/crypto/evp/m_md4.c+
$(OPENSSL_PATH)/crypto/evp/m_md5.c+
$(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c+
$(OPENSSL_PATH)/crypto/evp/m_mdc2.c+
$(OPENSSL_PATH)/crypto/evp/m_null.c+
$(OPENSSL_PATH)/crypto/evp/m_ripemd.c+
$(OPENSSL_PATH)/crypto/evp/m_sha1.c+
$(OPENSSL_PATH)/crypto/evp/m_sha3.c+
$(OPENSSL_PATH)/crypto/evp/m_sigver.c+
$(OPENSSL_PATH)/crypto/evp/m_wp.c+
$(OPENSSL_PATH)/crypto/evp/names.c+
$(OPENSSL_PATH)/crypto/evp/p5_crpt.c+
$(OPENSSL_PATH)/crypto/evp/p5_crpt2.c+
$(OPENSSL_PATH)/crypto/evp/p_dec.c+
$(OPENSSL_PATH)/crypto/evp/p_enc.c+
$(OPENSSL_PATH)/crypto/evp/p_lib.c+
$(OPENSSL_PATH)/crypto/evp/p_open.c+
$(OPENSSL_PATH)/crypto/evp/p_seal.c+
$(OPENSSL_PATH)/crypto/evp/p_sign.c+
$(OPENSSL_PATH)/crypto/evp/p_verify.c+
$(OPENSSL_PATH)/crypto/evp/pbe_scrypt.c+
$(OPENSSL_PATH)/crypto/evp/pmeth_fn.c+
$(OPENSSL_PATH)/crypto/evp/pmeth_gn.c+
$(OPENSSL_PATH)/crypto/evp/pmeth_lib.c+
$(OPENSSL_PATH)/crypto/ex_data.c+ $(OPENSSL_PATH)/crypto/getenv.c+
$(OPENSSL_PATH)/crypto/hmac/hm_ameth.c+
$(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c+
$(OPENSSL_PATH)/crypto/hmac/hmac.c+ $(OPENSSL_PATH)/crypto/init.c+
$(OPENSSL_PATH)/crypto/kdf/hkdf.c+
$(OPENSSL_PATH)/crypto/kdf/kdf_err.c+
$(OPENSSL_PATH)/crypto/kdf/scrypt.c+
$(OPENSSL_PATH)/crypto/kdf/tls1_prf.c+
$(OPENSSL_PATH)/crypto/lhash/lh_stats.c+
$(OPENSSL_PATH)/crypto/lhash/lhash.c+
$(OPENSSL_PATH)/crypto/md5/md5_dgst.c+
$(OPENSSL_PATH)/crypto/md5/md5_one.c+
$(OPENSSL_PATH)/crypto/mem.c+ $(OPENSSL_PATH)/crypto/mem_dbg.c+
$(OPENSSL_PATH)/crypto/mem_sec.c+
$(OPENSSL_PATH)/crypto/modes/cbc128.c+
$(OPENSSL_PATH)/crypto/modes/ccm128.c+
$(OPENSSL_PATH)/crypto/modes/cfb128.c+
$(OPENSSL_PATH)/crypto/modes/ctr128.c+
$(OPENSSL_PATH)/crypto/modes/cts128.c+
$(OPENSSL_PATH)/crypto/modes/gcm128.c+
$(OPENSSL_PATH)/crypto/modes/ocb128.c+
$(OPENSSL_PATH)/crypto/modes/ofb128.c+
$(OPENSSL_PATH)/crypto/modes/wrap128.c+
$(OPENSSL_PATH)/crypto/modes/xts128.c+
$(OPENSSL_PATH)/crypto/o_dir.c+ $(OPENSSL_PATH)/crypto/o_fips.c+
$(OPENSSL_PATH)/crypto/o_fopen.c+ $(OPENSSL_PATH)/crypto/o_init.c+
$(OPENSSL_PATH)/crypto/o_str.c+ $(OPENSSL_PATH)/crypto/o_time.c+
$(OPENSSL_PATH)/crypto/objects/o_names.c+
$(OPENSSL_PATH)/crypto/objects/obj_dat.c+
$(OPENSSL_PATH)/crypto/objects/obj_err.c+
$(OPENSSL_PATH)/crypto/objects/obj_lib.c+
$(OPENSSL_PATH)/crypto/objects/obj_xref.c+
$(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c+
$(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c+
$(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c+
$(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c+
$(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c+
$(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c+
$(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c+
$(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c+
$(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c+
$(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c+
$(OPENSSL_PATH)/crypto/pem/pem_all.c+
$(OPENSSL_PATH)/crypto/pem/pem_err.c+
$(OPENSSL_PATH)/crypto/pem/pem_info.c+
$(OPENSSL_PATH)/crypto/pem/pem_lib.c+
$(OPENSSL_PATH)/crypto/pem/pem_oth.c+
$(OPENSSL_PATH)/crypto/pem/pem_pk8.c+
$(OPENSSL_PATH)/crypto/pem/pem_pkey.c+
$(OPENSSL_PATH)/crypto/pem/pem_sign.c+
$(OPENSSL_PATH)/crypto/pem/pem_x509.c+
$(OPENSSL_PATH)/crypto/pem/pem_xaux.c+
$(OPENSSL_PATH)/crypto/pem/pvkfmt.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_add.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_init.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_key.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_sbag.c+
$(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c+
$(OPENSSL_PATH)/crypto/pkcs12/pk12err.c+
$(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c+
$(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c+
$(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c+
$(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c+
$(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c+
$(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c+
$(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c+
$(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c+
$(OPENSSL_PATH)/crypto/rand/drbg_ctr.c+
$(OPENSSL_PATH)/crypto/rand/drbg_lib.c+
$(OPENSSL_PATH)/crypto/rand/rand_egd.c+
$(OPENSSL_PATH)/crypto/rand/rand_err.c+
$(OPENSSL_PATH)/crypto/rand/rand_lib.c+
$(OPENSSL_PATH)/crypto/rand/rand_unix.c+
$(OPENSSL_PATH)/crypto/rand/rand_vms.c+
$(OPENSSL_PATH)/crypto/rand/rand_win.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_chk.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_depr.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_err.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_gen.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_lib.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_meth.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_mp.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_none.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_ossl.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_prn.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_pss.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_saos.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_sign.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_x931.c+
$(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c+
$(OPENSSL_PATH)/crypto/sha/keccak1600.c+
$(OPENSSL_PATH)/crypto/sha/sha1_one.c+
$(OPENSSL_PATH)/crypto/sha/sha1dgst.c+
$(OPENSSL_PATH)/crypto/sha/sha256.c+
$(OPENSSL_PATH)/crypto/sha/sha512.c+
$(OPENSSL_PATH)/crypto/siphash/siphash.c+
$(OPENSSL_PATH)/crypto/siphash/siphash_ameth.c+
$(OPENSSL_PATH)/crypto/siphash/siphash_pmeth.c+
$(OPENSSL_PATH)/crypto/sm3/m_sm3.c+
$(OPENSSL_PATH)/crypto/sm3/sm3.c+
$(OPENSSL_PATH)/crypto/sm4/sm4.c+
$(OPENSSL_PATH)/crypto/stack/stack.c+
$(OPENSSL_PATH)/crypto/threads_none.c+
$(OPENSSL_PATH)/crypto/threads_pthread.c+
$(OPENSSL_PATH)/crypto/threads_win.c+
$(OPENSSL_PATH)/crypto/txt_db/txt_db.c+
$(OPENSSL_PATH)/crypto/ui/ui_err.c+
$(OPENSSL_PATH)/crypto/ui/ui_lib.c+
$(OPENSSL_PATH)/crypto/ui/ui_null.c+
$(OPENSSL_PATH)/crypto/ui/ui_openssl.c+
$(OPENSSL_PATH)/crypto/ui/ui_util.c+ $(OPENSSL_PATH)/crypto/uid.c+
$(OPENSSL_PATH)/crypto/x509/by_dir.c+
$(OPENSSL_PATH)/crypto/x509/by_file.c+
$(OPENSSL_PATH)/crypto/x509/t_crl.c+
$(OPENSSL_PATH)/crypto/x509/t_req.c+
$(OPENSSL_PATH)/crypto/x509/t_x509.c+
$(OPENSSL_PATH)/crypto/x509/x509_att.c+
$(OPENSSL_PATH)/crypto/x509/x509_cmp.c+
$(OPENSSL_PATH)/crypto/x509/x509_d2.c+
$(OPENSSL_PATH)/crypto/x509/x509_def.c+
$(OPENSSL_PATH)/crypto/x509/x509_err.c+
$(OPENSSL_PATH)/crypto/x509/x509_ext.c+
$(OPENSSL_PATH)/crypto/x509/x509_lu.c+
$(OPENSSL_PATH)/crypto/x509/x509_meth.c+
$(OPENSSL_PATH)/crypto/x509/x509_obj.c+
$(OPENSSL_PATH)/crypto/x509/x509_r2x.c+
$(OPENSSL_PATH)/crypto/x509/x509_req.c+
$(OPENSSL_PATH)/crypto/x509/x509_set.c+
$(OPENSSL_PATH)/crypto/x509/x509_trs.c+
$(OPENSSL_PATH)/crypto/x509/x509_txt.c+
$(OPENSSL_PATH)/crypto/x509/x509_v3.c+
$(OPENSSL_PATH)/crypto/x509/x509_vfy.c+
$(OPENSSL_PATH)/crypto/x509/x509_vpm.c+
$(OPENSSL_PATH)/crypto/x509/x509cset.c+
$(OPENSSL_PATH)/crypto/x509/x509name.c+
$(OPENSSL_PATH)/crypto/x509/x509rset.c+
$(OPENSSL_PATH)/crypto/x509/x509spki.c+
$(OPENSSL_PATH)/crypto/x509/x509type.c+
$(OPENSSL_PATH)/crypto/x509/x_all.c+
$(OPENSSL_PATH)/crypto/x509/x_attrib.c+
$(OPENSSL_PATH)/crypto/x509/x_crl.c+
$(OPENSSL_PATH)/crypto/x509/x_exten.c+
$(OPENSSL_PATH)/crypto/x509/x_name.c+
$(OPENSSL_PATH)/crypto/x509/x_pubkey.c+
$(OPENSSL_PATH)/crypto/x509/x_req.c+
$(OPENSSL_PATH)/crypto/x509/x_x509.c+
$(OPENSSL_PATH)/crypto/x509/x_x509a.c+
$(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c+
$(OPENSSL_PATH)/crypto/x509v3/pcy_data.c+
$(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c+
$(OPENSSL_PATH)/crypto/x509v3/pcy_map.c+
$(OPENSSL_PATH)/crypto/x509v3/pcy_node.c+
$(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_addr.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_admis.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_akey.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_alt.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_asid.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_conf.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_crld.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_enum.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_extku.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_genn.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_info.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_int.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_lib.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_pci.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_pku.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_prn.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_purp.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_skey.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_tlsf.c+
$(OPENSSL_PATH)/crypto/x509v3/v3_utl.c+
$(OPENSSL_PATH)/crypto/x509v3/v3err.c+
$(OPENSSL_PATH)/crypto/arm_arch.h+
$(OPENSSL_PATH)/crypto/mips_arch.h+
$(OPENSSL_PATH)/crypto/ppc_arch.h+
$(OPENSSL_PATH)/crypto/s390x_arch.h+
$(OPENSSL_PATH)/crypto/sparc_arch.h+
$(OPENSSL_PATH)/crypto/vms_rms.h+
$(OPENSSL_PATH)/crypto/aes/aes_local.h+
$(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h+
$(OPENSSL_PATH)/crypto/asn1/asn1_local.h+
$(OPENSSL_PATH)/crypto/asn1/charmap.h+
$(OPENSSL_PATH)/crypto/asn1/standard_methods.h+
$(OPENSSL_PATH)/crypto/asn1/tbl_standard.h+
$(OPENSSL_PATH)/crypto/async/async_local.h+
$(OPENSSL_PATH)/crypto/async/arch/async_null.h+
$(OPENSSL_PATH)/crypto/async/arch/async_posix.h+
$(OPENSSL_PATH)/crypto/async/arch/async_win.h+
$(OPENSSL_PATH)/crypto/bio/bio_local.h+
$(OPENSSL_PATH)/crypto/bn/bn_local.h+
$(OPENSSL_PATH)/crypto/bn/bn_prime.h+
$(OPENSSL_PATH)/crypto/bn/rsaz_exp.h+
$(OPENSSL_PATH)/crypto/comp/comp_local.h+
$(OPENSSL_PATH)/crypto/conf/conf_def.h+
$(OPENSSL_PATH)/crypto/conf/conf_local.h+
$(OPENSSL_PATH)/crypto/dh/dh_local.h+
$(OPENSSL_PATH)/crypto/dso/dso_local.h+
$(OPENSSL_PATH)/crypto/evp/evp_local.h+
$(OPENSSL_PATH)/crypto/hmac/hmac_local.h+
$(OPENSSL_PATH)/crypto/lhash/lhash_local.h+
$(OPENSSL_PATH)/crypto/md5/md5_local.h+
$(OPENSSL_PATH)/crypto/modes/modes_local.h+
$(OPENSSL_PATH)/crypto/objects/obj_dat.h+
$(OPENSSL_PATH)/crypto/objects/obj_local.h+
$(OPENSSL_PATH)/crypto/objects/obj_xref.h+
$(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h+
$(OPENSSL_PATH)/crypto/pkcs12/p12_local.h+
$(OPENSSL_PATH)/crypto/rand/rand_local.h+
$(OPENSSL_PATH)/crypto/rsa/rsa_local.h+
$(OPENSSL_PATH)/crypto/sha/sha_local.h+
$(OPENSSL_PATH)/crypto/siphash/siphash_local.h+
$(OPENSSL_PATH)/crypto/sm3/sm3_local.h+
$(OPENSSL_PATH)/crypto/store/store_local.h+
$(OPENSSL_PATH)/crypto/ui/ui_local.h+
$(OPENSSL_PATH)/crypto/x509/x509_local.h+
$(OPENSSL_PATH)/crypto/x509v3/ext_dat.h+
$(OPENSSL_PATH)/crypto/x509v3/pcy_local.h+
$(OPENSSL_PATH)/crypto/x509v3/standard_exts.h+
$(OPENSSL_PATH)/crypto/x509v3/v3_admis.h+
$(OPENSSL_PATH)/ssl/bio_ssl.c+ $(OPENSSL_PATH)/ssl/d1_lib.c+
$(OPENSSL_PATH)/ssl/d1_msg.c+ $(OPENSSL_PATH)/ssl/d1_srtp.c+
$(OPENSSL_PATH)/ssl/methods.c+ $(OPENSSL_PATH)/ssl/packet.c+
$(OPENSSL_PATH)/ssl/pqueue.c+
$(OPENSSL_PATH)/ssl/record/dtls1_bitmap.c+
$(OPENSSL_PATH)/ssl/record/rec_layer_d1.c+
$(OPENSSL_PATH)/ssl/record/rec_layer_s3.c+
$(OPENSSL_PATH)/ssl/record/ssl3_buffer.c+
$(OPENSSL_PATH)/ssl/record/ssl3_record.c+
$(OPENSSL_PATH)/ssl/record/ssl3_record_tls13.c+
$(OPENSSL_PATH)/ssl/s3_cbc.c+ $(OPENSSL_PATH)/ssl/s3_enc.c+
$(OPENSSL_PATH)/ssl/s3_lib.c+ $(OPENSSL_PATH)/ssl/s3_msg.c+
$(OPENSSL_PATH)/ssl/ssl_asn1.c+ $(OPENSSL_PATH)/ssl/ssl_cert.c+
$(OPENSSL_PATH)/ssl/ssl_ciph.c+ $(OPENSSL_PATH)/ssl/ssl_conf.c+
$(OPENSSL_PATH)/ssl/ssl_err.c+ $(OPENSSL_PATH)/ssl/ssl_init.c+
$(OPENSSL_PATH)/ssl/ssl_lib.c+ $(OPENSSL_PATH)/ssl/ssl_mcnf.c+
$(OPENSSL_PATH)/ssl/ssl_rsa.c+ $(OPENSSL_PATH)/ssl/ssl_sess.c+
$(OPENSSL_PATH)/ssl/ssl_stat.c+ $(OPENSSL_PATH)/ssl/ssl_txt.c+
$(OPENSSL_PATH)/ssl/ssl_utst.c+
$(OPENSSL_PATH)/ssl/statem/extensions.c+
$(OPENSSL_PATH)/ssl/statem/extensions_clnt.c+
$(OPENSSL_PATH)/ssl/statem/extensions_cust.c+
$(OPENSSL_PATH)/ssl/statem/extensions_srvr.c+
$(OPENSSL_PATH)/ssl/statem/statem.c+
$(OPENSSL_PATH)/ssl/statem/statem_clnt.c+
$(OPENSSL_PATH)/ssl/statem/statem_dtls.c+
$(OPENSSL_PATH)/ssl/statem/statem_lib.c+
$(OPENSSL_PATH)/ssl/statem/statem_srvr.c+
$(OPENSSL_PATH)/ssl/t1_enc.c+ $(OPENSSL_PATH)/ssl/t1_lib.c+
$(OPENSSL_PATH)/ssl/t1_trce.c+ $(OPENSSL_PATH)/ssl/tls13_enc.c+
$(OPENSSL_PATH)/ssl/tls_srp.c+ $(OPENSSL_PATH)/ssl/packet_local.h+
$(OPENSSL_PATH)/ssl/ssl_cert_table.h+ $(OPENSSL_PATH)/ssl/ssl_local.h+
$(OPENSSL_PATH)/ssl/record/record.h+
$(OPENSSL_PATH)/ssl/record/record_local.h+
$(OPENSSL_PATH)/ssl/statem/statem.h+
$(OPENSSL_PATH)/ssl/statem/statem_local.h+# Autogenerated files list
ends here+ buildinf.h+ rand_pool_noise.h+ ossl_store.c+
rand_pool.c++[Sources.X64]+ rand_pool_noise_tsc.c+
ApiHooks.c++[Packages]+ MdePkg/MdePkg.dec+
CryptoPkg/CryptoPkg.dec++[LibraryClasses]+ BaseLib+ DebugLib+
TimerLib+ PrintLib++[BuildOptions]+ #+ # Disables the following Visual
Studio compiler warnings brought by openssl source,+ # so we do not break
the build with /WX option:+ # C4090: 'function' : different 'const' qualifiers+
# C4132: 'object' : const object should be initialized (tls13_enc.c)+ # C4210:
nonstandard extension used: function given file scope+ # C4244:
conversion from type1 to type2, possible loss of data+ # C4245: conversion
from type1 to type2, signed/unsigned mismatch+ # C4267: conversion from
size_t to type, possible loss of data+ # C4306: 'identifier' : conversion from
'type1' to 'type2' of greater size+ # C4310: cast truncates constant value+ #
C4389: 'operator' : signed/unsigned mismatch (xxxx)+ # C4700: uninitialized
local variable 'name' used. (conf_sap.c(71))+ # C4702: unreachable code+ #
C4706: assignment within conditional expression+ # C4819: The file contains
a character that cannot be represented in the current code page+ #+
MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /wd4090 /wd4132 /wd4210
/wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702
/wd4706 /wd4819++ INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -
U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /w++
#+ # Suppress the following build warnings in openssl so we don't break the
build with -Werror+ # -Werror=maybe-uninitialized: there exist some other
paths for which the variable is not initialized.+ # -Werror=format: Check
calls to printf and scanf, etc., to make sure that the arguments supplied
have+ # types appropriate to the format string specified.+ # -
Werror=unused-but-set-variable: Warn whenever a local variable is assigned
to, but otherwise unused (aside from its declaration).+ #+
GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS)
$(OPENSSL_FLAGS_CONFIG) -Wno-error=maybe-uninitialized -Wno-
error=format -Wno-format -Wno-error=unused-but-set-variable -
DNO_MSABI_VA_FUNCS++ # suppress the following warnings in openssl so
we don't break the build with warnings-as-errors:+ # 1295: Deprecated
declaration <entity> - give arg types+ # 550: <entity> was set but never
used+ # 1293: assignment in condition+ # 111: statement is unreachable
(invariably "break;" after "return X;" in case statement)+ # 68: integer
conversion resulted in a change of sign ("if (Status == -1)")+ # 177: <entity>
was declared but never referenced+ # 223: function <entity> declared
implicitly+ # 144: a value of type <type> cannot be used to initialize an entity
of type <type>+ # 513: a value of type <type> cannot be assigned to an
entity of type <type>+ # 188: enumerated type mixed with another type
(i.e. passing an integer as an enum without a cast)+ # 1296: Extended
constant initialiser used+ # 128: loop is not reachable - may be emitted
inappropriately if code follows a conditional return+ # from the function
that evaluates to true at compile time+ # 546: transfer of control bypasses
initialization - may be emitted inappropriately if the uninitialized+ #
variable is never referenced after the jump+ # 1: ignore "#1-D: last line of
file ends without a newline"+ # 3017: <entity> may be used before being set
(NOTE: This was fixed in OpenSSL 1.1 HEAD with+ # commit
d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.)+
XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) -w -std=c99 -Wno-
error=uninitializeddiff --git
a/CryptoPkg/Library/Include/openssl/opensslconf.h
b/CryptoPkg/Library/Include/openssl/opensslconf.h
index 3a2544ea5c..e8f73c4d10 100644
--- a/CryptoPkg/Library/Include/openssl/opensslconf.h
+++ b/CryptoPkg/Library/Include/openssl/opensslconf.h
@@ -112,9 +112,6 @@ extern "C" {
#ifndef OPENSSL_NO_ASAN # define OPENSSL_NO_ASAN #endif-#ifndef
OPENSSL_NO_ASM-# define OPENSSL_NO_ASM-#endif #ifndef
OPENSSL_NO_ASYNC # define OPENSSL_NO_ASYNC #endifdiff --git
a/CryptoPkg/Library/OpensslLib/ApiHooks.c
b/CryptoPkg/Library/OpensslLib/ApiHooks.c
new file mode 100644
index 0000000000..58cff16838
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/ApiHooks.c
@@ -0,0 +1,18 @@
+/** @file+ OpenSSL Library API hooks.++Copyright (c) 2020, Intel
Corporation. All rights reserved.<BR>+SPDX-License-Identifier: BSD-2-
Clause-Patent++**/++#include <Uefi.h>++VOID *+__imp_RtlVirtualUnwind
(+ VOID * Args+ )+{+ return NULL;+}+diff --git
a/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
new file mode 100644
index 0000000000..ef20d2b84e
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
@@ -0,0 +1,34 @@
+/** @file+ Constructor to initialize CPUID data for OpenSSL assembly
operations.++Copyright (c) 2020, Intel Corporation. All rights
reserved.<BR>+SPDX-License-Identifier: BSD-2-Clause-
Patent++**/++#include <Uefi.h>++extern void OPENSSL_cpuid_setup
(void);++/**+ Constructor routine for OpensslLib.++ The constructor calls an
internal OpenSSL function which fetches a local copy+ of the hardware
capability flags, used to enable native crypto instructions.++ @param
None++ @retval EFI_SUCCESS The construction
succeeded.++**/+EFI_STATUS+EFIAPI+OpensslLibConstructor (+ VOID+
)+{+ OPENSSL_cpuid_setup ();++ return EFI_SUCCESS;+}+diff --git
a/CryptoPkg/Library/OpensslLib/process_files.pl
b/CryptoPkg/Library/OpensslLib/process_files.pl
index 57ce195394..472f59bc8e 100755
--- a/CryptoPkg/Library/OpensslLib/process_files.pl
+++ b/CryptoPkg/Library/OpensslLib/process_files.pl
@@ -9,9 +9,63 @@
# do not need to do this, since the results are stored in the EDK2 # git
repository for them. #+# Due to the script wrapping required to process the
OpenSSL+# configuration data, each native architecture must be
processed+# individually by the maintainer (in addition to the standard
version):+# ./process_files.pl+# ./process_files.pl X64+# ./process_files.pl
[Arch]+ use strict; use Cwd; use File::Copy;+use File::Basename;+use
File::Path qw(make_path remove_tree);+use Text::Tabs;++#+# OpenSSL
perlasm generator script does not transfer the copyright header+#+sub
copy_license_header+{+ my @args = split / /, shift; #Separate args by
spaces+ my $source = $args[1]; #Source file is second (after "perl")+
my $target = pop @args; #Target file is always last+ chop ($target);
#Remove newline char++ my $temp_file_name = "license.tmp";+ open
(my $source_file, "<" . $source) || die $source;+ open (my $target_file, "<"
. $target) || die $target;+ open (my $temp_file, ">" . $temp_file_name) ||
die $temp_file_name;++ #Add "generated file" warning+ $source =~
s/^..//; #Remove leading "./"+ print ($temp_file "; WARNING: do not
edit!\r\n");+ print ($temp_file "; Generated from $source\r\n");+ print
($temp_file ";\r\n");++ #Copy source file header to temp file+ while (my
$line = <$source_file>) {+ next if ($line =~ /#!/); #Ignore shebang line+
$line =~ s/#/;/; #Fix comment character for assembly+ $line =~
s/\s+$/\r\n/; #Trim trailing whitepsace, fixup line endings+ print
($temp_file $line);+ last if ($line =~ /http/); #Last line of copyright header
contains a web link+ }+ print ($temp_file "\r\n");+ #Retrieve generated
assembly contents+ while (my $line = <$target_file>) {+ $line =~
s/\s+$/\r\n/; #Trim trailing whitepsace, fixup line endings+ print
($temp_file expand ($line)); #expand() replaces tabs with spaces+ }++
close ($source_file);+ close ($target_file);+ close ($temp_file);++ move
($temp_file_name, $target) ||+ die "Cannot replace \"" . $target .
"\"!";+} # # Find the openssl directory name for use lib. We have to do
this@@ -21,10 +75,41 @@ use File::Copy;
# my $inf_file; my $OPENSSL_PATH;+my $uefi_config;+my $extension;+my
$arch; my @inf; BEGIN { $inf_file = "OpensslLib.inf";+ $uefi_config =
"UEFI";+ $arch = shift;++ if (defined $arch) {+ if (uc ($arch) eq "X64") {+
$arch = "X64";+ $inf_file = "OpensslLibX64.inf";+ $uefi_config =
"UEFI-x86_64";+ $extension = "nasm";+ } else {+ die
"Unsupported architecture \"" . $arch . "\"!";+ }+ if ($extension eq
"nasm") {+ if (`nasm -v 2>&1`) {+ #Presence of nasm executable
will trigger inclusion of AVX instructions+ die "\nCannot run assembly
generators with NASM in path!\n\n";+ }+ }++ # Prepare
assembly folder+ if (-d $arch) {+ remove_tree ($arch, {safe => 1})
||+ die "Cannot clean assembly folder \"" . $arch . "\"!";+ } else {+
mkdir $arch ||+ die "Cannot create assembly folder \"" . $arch .
"\"!";+ }+ } # Read the contents of the inf file open( FD, "<" .
$inf_file ) ||@@ -47,9 +132,9 @@ BEGIN {
# Configure UEFI system( "./Configure",-
"UEFI",+ "--config=../uefi-asm.conf",+ "$uefi_config",
"no-afalgeng",- "no-asm", "no-async", "no-
autoerrinit", "no-autoload-config",@@ -129,23 +214,53 @@ BEGIN {
# Retrieve file lists from OpenSSL configdata # use configdata
qw/%unified_info/;+use configdata qw/%config/;+use configdata
qw/%target/;++#+# Collect build flags from configdata+#+my $flags =
"";+foreach my $f (@{$config{lib_defines}}) {+ $flags .= " -D$f";+} my
@cryptofilelist = (); my @sslfilelist = ();+my @asmfilelist = ();+my @asmbuild
= (); foreach my $product ((@{$unified_info{libraries}},
@{$unified_info{engines}})) { foreach my $o (@{$unified_info{sources}-
{$product}}) { foreach my $s (@{$unified_info{sources}->{$o}}) {-
next if ($unified_info{generate}->{$s});- next if $s =~
"crypto/bio/b_print.c";- # No need to add unused files in UEFI. #
So it can reduce porting time, compile time, library size.+ next if $s =~
"crypto/bio/b_print.c"; next if $s =~ "crypto/rand/randfile.c";
next if $s =~ "crypto/store/"; next if $s =~ "crypto/err/err_all.c";
next if $s =~ "crypto/aes/aes_ecb.c"; + if ($unified_info{generate}-
{$s}) {+ if (defined $arch) {+ my $buildstring = "perl";+
foreach my $arg (@{$unified_info{generate}->{$s}}) {+ if ($arg =~
".pl") {+ $buildstring .= " ./openssl/$arg";+ } elsif
($arg =~ "PERLASM_SCHEME") {+ $buildstring .= "
$target{perlasm_scheme}";+ } elsif ($arg =~ "LIB_CFLAGS") {+
$buildstring .= "$flags";+ }+ }+ ($s, my $path,
undef) = fileparse($s, qr/\.[^.]*/);+ $buildstring .= "
./$arch/$path$s.$extension";+ make_path ("./$arch/$path");+
push @asmbuild, "$buildstring\n";+ push @asmfilelist, "
$arch/$path$s.$extension\r\n";+ }+ next;+ } if
($product =~ "libssl") { push @sslfilelist, ' $(OPENSSL_PATH)/' . $s .
"\r\n"; next;@@ -183,15 +298,31 @@ foreach (@headers){
} +#+# Generate assembly files+#+if (@asmbuild) {+ print "\n-->
Generating assembly files ... ";+ foreach my $buildstring (@asmbuild) {+
system ("$buildstring");+ copy_license_header ($buildstring);+ }+ print
"Done!";+}+ # # Update OpensslLib.inf with autogenerated file list # my
@new_inf = (); my $subbing = 0;-print "\n--> Updating OpensslLib.inf ...
";+print "\n--> Updating $inf_file ... "; foreach (@inf) {+ if ($_ =~ "DEFINE
OPENSSL_FLAGS_CONFIG") {+ push @new_inf, " DEFINE
OPENSSL_FLAGS_CONFIG =" . $flags . "\r\n";+ next;+ } if ( $_ =~ "#
Autogenerated files list starts here" ) {- push @new_inf, $_,
@cryptofilelist, @sslfilelist;+ push @new_inf, $_, @asmfilelist,
@cryptofilelist, @sslfilelist; $subbing = 1; next; }@@ -216,49
+347,51 @@ rename( $new_inf_file, $inf_file ) ||
die "rename $inf_file"; print "Done!"; -#-# Update OpensslLibCrypto.inf
with auto-generated file list (no libssl)-#-$inf_file = "OpensslLibCrypto.inf";--
# Read the contents of the inf file-@inf = ();-@new_inf = ();-open( FD, "<" .
$inf_file ) ||- die "Cannot open \"" . $inf_file . "\"!";-@inf = (<FD>);-
close(FD) ||- die "Cannot close \"" . $inf_file . "\"!";+if (!defined $arch) {+
#+ # Update OpensslLibCrypto.inf with auto-generated file list (no libssl)+
#+ $inf_file = "OpensslLibCrypto.inf"; -$subbing = 0;-print "\n--> Updating
OpensslLibCrypto.inf ... ";-foreach (@inf) {- if ( $_ =~ "# Autogenerated files
list starts here" ) {- push @new_inf, $_, @cryptofilelist;- $subbing = 1;-
next;- }- if ( $_ =~ "# Autogenerated files list ends here" ) {- push
@new_inf, $_;- $subbing = 0;- next;+ # Read the contents of the inf
file+ @inf = ();+ @new_inf = ();+ open( FD, "<" . $inf_file ) ||+ die
"Cannot open \"" . $inf_file . "\"!";+ @inf = (<FD>);+ close(FD) ||+ die
"Cannot close \"" . $inf_file . "\"!";++ $subbing = 0;+ print "\n--> Updating
OpensslLibCrypto.inf ... ";+ foreach (@inf) {+ if ( $_ =~ "#
Autogenerated files list starts here" ) {+ push @new_inf, $_,
@cryptofilelist;+ $subbing = 1;+ next;+ }+ if ( $_ =~ "#
Autogenerated files list ends here" ) {+ push @new_inf, $_;+
$subbing = 0;+ next;+ }++ push @new_inf, $_+ unless
($subbing); } - push @new_inf, $_- unless ($subbing);+
$new_inf_file = $inf_file . ".new";+ open( FD, ">" . $new_inf_file ) ||+
die $new_inf_file;+ print( FD @new_inf ) ||+ die $new_inf_file;+
close(FD) ||+ die $new_inf_file;+ rename( $new_inf_file, $inf_file ) ||+
die "rename $inf_file";+ print "Done!"; } -$new_inf_file = $inf_file .
".new";-open( FD, ">" . $new_inf_file ) ||- die $new_inf_file;-print( FD
@new_inf ) ||- die $new_inf_file;-close(FD) ||- die $new_inf_file;-
rename( $new_inf_file, $inf_file ) ||- die "rename $inf_file";-print
"Done!";- # # Copy opensslconf.h and dso_conf.h generated from OpenSSL
Configuration #diff --git a/CryptoPkg/Library/OpensslLib/uefi-asm.conf
b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
new file mode 100644
index 0000000000..55eedbf3ba
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
@@ -0,0 +1,15 @@
+## -*- mode: perl; -*-+## UEFI assembly openssl configuration
targets.++my %targets = (+#### UEFI+ "UEFI-x86_64" => {+
perlasm_scheme => "nasm",+ # inherit_from => [ "UEFI",
asm("x86_64_asm") ],+ inherit_from => [ "UEFI" ],+ cpuid_asm_src
=> "x86_64cpuid.s",+ aes_asm_src => "aes_core.c aes_cbc.c vpaes-
x86_64.s aesni-x86_64.s aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-
mb-x86_64.s",+ sha1_asm_src => "sha1-x86_64.s sha256-x86_64.s
sha512-x86_64.s sha1-mb-x86_64.s sha256-mb-x86_64.s",+
modes_asm_src => "ghash-x86_64.s",+ },+);--
2.28.0.windows.1


-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#63682): https://edk2.groups.io/g/devel/message/63682
Mute This Topic: https://groups.io/mt/75978612/4399222
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub
[guomin.jiang@...] -=-=-=-=-=-=


Yao, Jiewen
 

Hi Christopher
Thanks.

1) Would you please help me understand more on "ApiHooks.c contains a stub function for a Windows API call" ?
Why we need this?
If it is compiler specific in openssl, should we submit patch to openssl to exclude this with OPENSSL_SYS_UEFI? That should be a cleaner solution for UEFI.

2) Would you please describe what compiler you have tried? VS? GCC? LLVM?

3) Would you please describe what unit test you have done?

Thank you
Yao Jiewen

-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 4, 2020 8:24 AM
To: devel@edk2.groups.io
Cc: Yao, Jiewen <jiewen.yao@...>; Wang, Jian J <jian.j.wang@...>;
Lu, XiaoyuX <xiaoyux.lu@...>; Ard Biesheuvel <ard.biesheuvel@...>
Subject: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native instruction support
for X64

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2507

Adding OpensslLibX64.inf and modifying process_files.pl to process this
file and generate the necessary assembly files.
ApiHooks.c contains a stub function for a Windows API call.
uefi-asm.conf contains the limited assembly configurations for OpenSSL.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyux.lu@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Christopher J Zurcher <christopher.j.zurcher@...>
---
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibX64.inf | 656
++++++++++++++++++++
CryptoPkg/Library/Include/openssl/opensslconf.h | 3 -
CryptoPkg/Library/OpensslLib/ApiHooks.c | 18 +
CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c | 34 +
CryptoPkg/Library/OpensslLib/process_files.pl | 223 +++++--
CryptoPkg/Library/OpensslLib/uefi-asm.conf | 15 +
8 files changed, 903 insertions(+), 50 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index dbbe5386a1..bd62d86936 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 616ccd9f62..2b7324a990 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
new file mode 100644
index 0000000000..825eea0254
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
@@ -0,0 +1,656 @@
+## @file

+# This module provides OpenSSL Library implementation.

+#

+# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>

+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+ INF_VERSION = 0x00010005

+ BASE_NAME = OpensslLibX64

+ MODULE_UNI_FILE = OpensslLib.uni

+ FILE_GUID = 18125E50-0117-4DD0-BE54-4784AD995FEF

+ MODULE_TYPE = BASE

+ VERSION_STRING = 1.0

+ LIBRARY_CLASS = OpensslLib

+ DEFINE OPENSSL_PATH = openssl

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS_CONFIG = -DOPENSSL_CPUID_OBJ -DSHA1_ASM -
DSHA256_ASM -DSHA512_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM

+ CONSTRUCTOR = OpensslLibConstructor

+

+#

+# VALID_ARCHITECTURES = X64

+#

+

+[Sources]

+ OpensslLibConstructor.c

+ $(OPENSSL_PATH)/e_os.h

+ $(OPENSSL_PATH)/ms/uplink.h

+# Autogenerated files list starts here

+ X64/crypto/aes/aesni-mb-x86_64.nasm

+ X64/crypto/aes/aesni-sha1-x86_64.nasm

+ X64/crypto/aes/aesni-sha256-x86_64.nasm

+ X64/crypto/aes/aesni-x86_64.nasm

+ X64/crypto/aes/vpaes-x86_64.nasm

+ X64/crypto/modes/ghash-x86_64.nasm

+ X64/crypto/sha/sha1-mb-x86_64.nasm

+ X64/crypto/sha/sha1-x86_64.nasm

+ X64/crypto/sha/sha256-mb-x86_64.nasm

+ X64/crypto/sha/sha256-x86_64.nasm

+ X64/crypto/sha/sha512-x86_64.nasm

+ X64/crypto/x86_64cpuid.nasm

+ $(OPENSSL_PATH)/crypto/aes/aes_cbc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_cfb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_core.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ige.c

+ $(OPENSSL_PATH)/crypto/aes/aes_misc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ofb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_wrap.c

+ $(OPENSSL_PATH)/crypto/aria/aria.c

+ $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_digest.c

+ $(OPENSSL_PATH)/crypto/asn1/a_dup.c

+ $(OPENSSL_PATH)/crypto/asn1/a_gentm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_int.c

+ $(OPENSSL_PATH)/crypto/asn1/a_mbstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_object.c

+ $(OPENSSL_PATH)/crypto/asn1/a_octet.c

+ $(OPENSSL_PATH)/crypto/asn1/a_print.c

+ $(OPENSSL_PATH)/crypto/asn1/a_sign.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strex.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strnid.c

+ $(OPENSSL_PATH)/crypto/asn1/a_time.c

+ $(OPENSSL_PATH)/crypto/asn1/a_type.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utctm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utf8.c

+ $(OPENSSL_PATH)/crypto/asn1/a_verify.c

+ $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_err.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_par.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mime.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_moid.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mstbl.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_pack.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/evp_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/f_int.c

+ $(OPENSSL_PATH)/crypto/asn1/f_string.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/n_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/nsseq.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbe.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_scrypt.c

+ $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_bitst.c

+ $(OPENSSL_PATH)/crypto/asn1/t_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_dec.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_enc.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_fre.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_new.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_scn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c

+ $(OPENSSL_PATH)/crypto/asn1/x_algor.c

+ $(OPENSSL_PATH)/crypto/asn1/x_bignum.c

+ $(OPENSSL_PATH)/crypto/asn1/x_info.c

+ $(OPENSSL_PATH)/crypto/asn1/x_int64.c

+ $(OPENSSL_PATH)/crypto/asn1/x_long.c

+ $(OPENSSL_PATH)/crypto/asn1/x_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/x_sig.c

+ $(OPENSSL_PATH)/crypto/asn1/x_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/x_val.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.c

+ $(OPENSSL_PATH)/crypto/async/async.c

+ $(OPENSSL_PATH)/crypto/async/async_err.c

+ $(OPENSSL_PATH)/crypto/async/async_wait.c

+ $(OPENSSL_PATH)/crypto/bio/b_addr.c

+ $(OPENSSL_PATH)/crypto/bio/b_dump.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock2.c

+ $(OPENSSL_PATH)/crypto/bio/bf_buff.c

+ $(OPENSSL_PATH)/crypto/bio/bf_lbuf.c

+ $(OPENSSL_PATH)/crypto/bio/bf_nbio.c

+ $(OPENSSL_PATH)/crypto/bio/bf_null.c

+ $(OPENSSL_PATH)/crypto/bio/bio_cb.c

+ $(OPENSSL_PATH)/crypto/bio/bio_err.c

+ $(OPENSSL_PATH)/crypto/bio/bio_lib.c

+ $(OPENSSL_PATH)/crypto/bio/bio_meth.c

+ $(OPENSSL_PATH)/crypto/bio/bss_acpt.c

+ $(OPENSSL_PATH)/crypto/bio/bss_bio.c

+ $(OPENSSL_PATH)/crypto/bio/bss_conn.c

+ $(OPENSSL_PATH)/crypto/bio/bss_dgram.c

+ $(OPENSSL_PATH)/crypto/bio/bss_fd.c

+ $(OPENSSL_PATH)/crypto/bio/bss_file.c

+ $(OPENSSL_PATH)/crypto/bio/bss_log.c

+ $(OPENSSL_PATH)/crypto/bio/bss_mem.c

+ $(OPENSSL_PATH)/crypto/bio/bss_null.c

+ $(OPENSSL_PATH)/crypto/bio/bss_sock.c

+ $(OPENSSL_PATH)/crypto/bn/bn_add.c

+ $(OPENSSL_PATH)/crypto/bn/bn_asm.c

+ $(OPENSSL_PATH)/crypto/bn/bn_blind.c

+ $(OPENSSL_PATH)/crypto/bn/bn_const.c

+ $(OPENSSL_PATH)/crypto/bn/bn_ctx.c

+ $(OPENSSL_PATH)/crypto/bn/bn_depr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_dh.c

+ $(OPENSSL_PATH)/crypto/bn/bn_div.c

+ $(OPENSSL_PATH)/crypto/bn/bn_err.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp2.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gcd.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gf2m.c

+ $(OPENSSL_PATH)/crypto/bn/bn_intern.c

+ $(OPENSSL_PATH)/crypto/bn/bn_kron.c

+ $(OPENSSL_PATH)/crypto/bn/bn_lib.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mod.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mont.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mpi.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mul.c

+ $(OPENSSL_PATH)/crypto/bn/bn_nist.c

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.c

+ $(OPENSSL_PATH)/crypto/bn/bn_print.c

+ $(OPENSSL_PATH)/crypto/bn/bn_rand.c

+ $(OPENSSL_PATH)/crypto/bn/bn_recp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_shift.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqrt.c

+ $(OPENSSL_PATH)/crypto/bn/bn_srp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_word.c

+ $(OPENSSL_PATH)/crypto/bn/bn_x931p.c

+ $(OPENSSL_PATH)/crypto/buffer/buf_err.c

+ $(OPENSSL_PATH)/crypto/buffer/buffer.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c

+ $(OPENSSL_PATH)/crypto/cmac/cmac.c

+ $(OPENSSL_PATH)/crypto/comp/c_zlib.c

+ $(OPENSSL_PATH)/crypto/comp/comp_err.c

+ $(OPENSSL_PATH)/crypto/comp/comp_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_api.c

+ $(OPENSSL_PATH)/crypto/conf/conf_def.c

+ $(OPENSSL_PATH)/crypto/conf/conf_err.c

+ $(OPENSSL_PATH)/crypto/conf/conf_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mall.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mod.c

+ $(OPENSSL_PATH)/crypto/conf/conf_sap.c

+ $(OPENSSL_PATH)/crypto/conf/conf_ssl.c

+ $(OPENSSL_PATH)/crypto/cpt_err.c

+ $(OPENSSL_PATH)/crypto/cryptlib.c

+ $(OPENSSL_PATH)/crypto/ctype.c

+ $(OPENSSL_PATH)/crypto/cversion.c

+ $(OPENSSL_PATH)/crypto/dh/dh_ameth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_asn1.c

+ $(OPENSSL_PATH)/crypto/dh/dh_check.c

+ $(OPENSSL_PATH)/crypto/dh/dh_depr.c

+ $(OPENSSL_PATH)/crypto/dh/dh_err.c

+ $(OPENSSL_PATH)/crypto/dh/dh_gen.c

+ $(OPENSSL_PATH)/crypto/dh/dh_kdf.c

+ $(OPENSSL_PATH)/crypto/dh/dh_key.c

+ $(OPENSSL_PATH)/crypto/dh/dh_lib.c

+ $(OPENSSL_PATH)/crypto/dh/dh_meth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_prn.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c

+ $(OPENSSL_PATH)/crypto/dso/dso_err.c

+ $(OPENSSL_PATH)/crypto/dso/dso_lib.c

+ $(OPENSSL_PATH)/crypto/dso/dso_openssl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_vms.c

+ $(OPENSSL_PATH)/crypto/dso/dso_win32.c

+ $(OPENSSL_PATH)/crypto/ebcdic.c

+ $(OPENSSL_PATH)/crypto/err/err.c

+ $(OPENSSL_PATH)/crypto/err/err_prn.c

+ $(OPENSSL_PATH)/crypto/evp/bio_b64.c

+ $(OPENSSL_PATH)/crypto/evp/bio_enc.c

+ $(OPENSSL_PATH)/crypto/evp/bio_md.c

+ $(OPENSSL_PATH)/crypto/evp/bio_ok.c

+ $(OPENSSL_PATH)/crypto/evp/c_allc.c

+ $(OPENSSL_PATH)/crypto/evp/c_alld.c

+ $(OPENSSL_PATH)/crypto/evp/cmeth_lib.c

+ $(OPENSSL_PATH)/crypto/evp/digest.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c

+ $(OPENSSL_PATH)/crypto/evp/e_aria.c

+ $(OPENSSL_PATH)/crypto/evp/e_bf.c

+ $(OPENSSL_PATH)/crypto/evp/e_camellia.c

+ $(OPENSSL_PATH)/crypto/evp/e_cast.c

+ $(OPENSSL_PATH)/crypto/evp/e_chacha20_poly1305.c

+ $(OPENSSL_PATH)/crypto/evp/e_des.c

+ $(OPENSSL_PATH)/crypto/evp/e_des3.c

+ $(OPENSSL_PATH)/crypto/evp/e_idea.c

+ $(OPENSSL_PATH)/crypto/evp/e_null.c

+ $(OPENSSL_PATH)/crypto/evp/e_old.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc2.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc5.c

+ $(OPENSSL_PATH)/crypto/evp/e_seed.c

+ $(OPENSSL_PATH)/crypto/evp/e_sm4.c

+ $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c

+ $(OPENSSL_PATH)/crypto/evp/encode.c

+ $(OPENSSL_PATH)/crypto/evp/evp_cnf.c

+ $(OPENSSL_PATH)/crypto/evp/evp_enc.c

+ $(OPENSSL_PATH)/crypto/evp/evp_err.c

+ $(OPENSSL_PATH)/crypto/evp/evp_key.c

+ $(OPENSSL_PATH)/crypto/evp/evp_lib.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pbe.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pkey.c

+ $(OPENSSL_PATH)/crypto/evp/m_md2.c

+ $(OPENSSL_PATH)/crypto/evp/m_md4.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_mdc2.c

+ $(OPENSSL_PATH)/crypto/evp/m_null.c

+ $(OPENSSL_PATH)/crypto/evp/m_ripemd.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha3.c

+ $(OPENSSL_PATH)/crypto/evp/m_sigver.c

+ $(OPENSSL_PATH)/crypto/evp/m_wp.c

+ $(OPENSSL_PATH)/crypto/evp/names.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c

+ $(OPENSSL_PATH)/crypto/evp/p_dec.c

+ $(OPENSSL_PATH)/crypto/evp/p_enc.c

+ $(OPENSSL_PATH)/crypto/evp/p_lib.c

+ $(OPENSSL_PATH)/crypto/evp/p_open.c

+ $(OPENSSL_PATH)/crypto/evp/p_seal.c

+ $(OPENSSL_PATH)/crypto/evp/p_sign.c

+ $(OPENSSL_PATH)/crypto/evp/p_verify.c

+ $(OPENSSL_PATH)/crypto/evp/pbe_scrypt.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c

+ $(OPENSSL_PATH)/crypto/ex_data.c

+ $(OPENSSL_PATH)/crypto/getenv.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c

+ $(OPENSSL_PATH)/crypto/hmac/hmac.c

+ $(OPENSSL_PATH)/crypto/init.c

+ $(OPENSSL_PATH)/crypto/kdf/hkdf.c

+ $(OPENSSL_PATH)/crypto/kdf/kdf_err.c

+ $(OPENSSL_PATH)/crypto/kdf/scrypt.c

+ $(OPENSSL_PATH)/crypto/kdf/tls1_prf.c

+ $(OPENSSL_PATH)/crypto/lhash/lh_stats.c

+ $(OPENSSL_PATH)/crypto/lhash/lhash.c

+ $(OPENSSL_PATH)/crypto/md5/md5_dgst.c

+ $(OPENSSL_PATH)/crypto/md5/md5_one.c

+ $(OPENSSL_PATH)/crypto/mem.c

+ $(OPENSSL_PATH)/crypto/mem_dbg.c

+ $(OPENSSL_PATH)/crypto/mem_sec.c

+ $(OPENSSL_PATH)/crypto/modes/cbc128.c

+ $(OPENSSL_PATH)/crypto/modes/ccm128.c

+ $(OPENSSL_PATH)/crypto/modes/cfb128.c

+ $(OPENSSL_PATH)/crypto/modes/ctr128.c

+ $(OPENSSL_PATH)/crypto/modes/cts128.c

+ $(OPENSSL_PATH)/crypto/modes/gcm128.c

+ $(OPENSSL_PATH)/crypto/modes/ocb128.c

+ $(OPENSSL_PATH)/crypto/modes/ofb128.c

+ $(OPENSSL_PATH)/crypto/modes/wrap128.c

+ $(OPENSSL_PATH)/crypto/modes/xts128.c

+ $(OPENSSL_PATH)/crypto/o_dir.c

+ $(OPENSSL_PATH)/crypto/o_fips.c

+ $(OPENSSL_PATH)/crypto/o_fopen.c

+ $(OPENSSL_PATH)/crypto/o_init.c

+ $(OPENSSL_PATH)/crypto/o_str.c

+ $(OPENSSL_PATH)/crypto/o_time.c

+ $(OPENSSL_PATH)/crypto/objects/o_names.c

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.c

+ $(OPENSSL_PATH)/crypto/objects/obj_err.c

+ $(OPENSSL_PATH)/crypto/objects/obj_lib.c

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c

+ $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c

+ $(OPENSSL_PATH)/crypto/pem/pem_all.c

+ $(OPENSSL_PATH)/crypto/pem/pem_err.c

+ $(OPENSSL_PATH)/crypto/pem/pem_info.c

+ $(OPENSSL_PATH)/crypto/pem/pem_lib.c

+ $(OPENSSL_PATH)/crypto/pem/pem_oth.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pk8.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pkey.c

+ $(OPENSSL_PATH)/crypto/pem/pem_sign.c

+ $(OPENSSL_PATH)/crypto/pem/pem_x509.c

+ $(OPENSSL_PATH)/crypto/pem/pem_xaux.c

+ $(OPENSSL_PATH)/crypto/pem/pvkfmt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_init.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_key.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_sbag.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c

+ $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_ctr.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_egd.c

+ $(OPENSSL_PATH)/crypto/rand/rand_err.c

+ $(OPENSSL_PATH)/crypto/rand/rand_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_unix.c

+ $(OPENSSL_PATH)/crypto/rand/rand_vms.c

+ $(OPENSSL_PATH)/crypto/rand/rand_win.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_chk.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_err.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_lib.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_meth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_mp.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_none.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ossl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_saos.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_sign.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c

+ $(OPENSSL_PATH)/crypto/sha/keccak1600.c

+ $(OPENSSL_PATH)/crypto/sha/sha1_one.c

+ $(OPENSSL_PATH)/crypto/sha/sha1dgst.c

+ $(OPENSSL_PATH)/crypto/sha/sha256.c

+ $(OPENSSL_PATH)/crypto/sha/sha512.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_ameth.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_pmeth.c

+ $(OPENSSL_PATH)/crypto/sm3/m_sm3.c

+ $(OPENSSL_PATH)/crypto/sm3/sm3.c

+ $(OPENSSL_PATH)/crypto/sm4/sm4.c

+ $(OPENSSL_PATH)/crypto/stack/stack.c

+ $(OPENSSL_PATH)/crypto/threads_none.c

+ $(OPENSSL_PATH)/crypto/threads_pthread.c

+ $(OPENSSL_PATH)/crypto/threads_win.c

+ $(OPENSSL_PATH)/crypto/txt_db/txt_db.c

+ $(OPENSSL_PATH)/crypto/ui/ui_err.c

+ $(OPENSSL_PATH)/crypto/ui/ui_lib.c

+ $(OPENSSL_PATH)/crypto/ui/ui_null.c

+ $(OPENSSL_PATH)/crypto/ui/ui_openssl.c

+ $(OPENSSL_PATH)/crypto/ui/ui_util.c

+ $(OPENSSL_PATH)/crypto/uid.c

+ $(OPENSSL_PATH)/crypto/x509/by_dir.c

+ $(OPENSSL_PATH)/crypto/x509/by_file.c

+ $(OPENSSL_PATH)/crypto/x509/t_crl.c

+ $(OPENSSL_PATH)/crypto/x509/t_req.c

+ $(OPENSSL_PATH)/crypto/x509/t_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x509_att.c

+ $(OPENSSL_PATH)/crypto/x509/x509_cmp.c

+ $(OPENSSL_PATH)/crypto/x509/x509_d2.c

+ $(OPENSSL_PATH)/crypto/x509/x509_def.c

+ $(OPENSSL_PATH)/crypto/x509/x509_err.c

+ $(OPENSSL_PATH)/crypto/x509/x509_ext.c

+ $(OPENSSL_PATH)/crypto/x509/x509_lu.c

+ $(OPENSSL_PATH)/crypto/x509/x509_meth.c

+ $(OPENSSL_PATH)/crypto/x509/x509_obj.c

+ $(OPENSSL_PATH)/crypto/x509/x509_r2x.c

+ $(OPENSSL_PATH)/crypto/x509/x509_req.c

+ $(OPENSSL_PATH)/crypto/x509/x509_set.c

+ $(OPENSSL_PATH)/crypto/x509/x509_trs.c

+ $(OPENSSL_PATH)/crypto/x509/x509_txt.c

+ $(OPENSSL_PATH)/crypto/x509/x509_v3.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vfy.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vpm.c

+ $(OPENSSL_PATH)/crypto/x509/x509cset.c

+ $(OPENSSL_PATH)/crypto/x509/x509name.c

+ $(OPENSSL_PATH)/crypto/x509/x509rset.c

+ $(OPENSSL_PATH)/crypto/x509/x509spki.c

+ $(OPENSSL_PATH)/crypto/x509/x509type.c

+ $(OPENSSL_PATH)/crypto/x509/x_all.c

+ $(OPENSSL_PATH)/crypto/x509/x_attrib.c

+ $(OPENSSL_PATH)/crypto/x509/x_crl.c

+ $(OPENSSL_PATH)/crypto/x509/x_exten.c

+ $(OPENSSL_PATH)/crypto/x509/x_name.c

+ $(OPENSSL_PATH)/crypto/x509/x_pubkey.c

+ $(OPENSSL_PATH)/crypto/x509/x_req.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509a.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_map.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_node.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_alt.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_conf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_crld.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_enum.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_extku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_genn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_info.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_int.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pci.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_prn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_purp.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_skey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_tlsf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3err.c

+ $(OPENSSL_PATH)/crypto/arm_arch.h

+ $(OPENSSL_PATH)/crypto/mips_arch.h

+ $(OPENSSL_PATH)/crypto/ppc_arch.h

+ $(OPENSSL_PATH)/crypto/s390x_arch.h

+ $(OPENSSL_PATH)/crypto/sparc_arch.h

+ $(OPENSSL_PATH)/crypto/vms_rms.h

+ $(OPENSSL_PATH)/crypto/aes/aes_local.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_local.h

+ $(OPENSSL_PATH)/crypto/asn1/charmap.h

+ $(OPENSSL_PATH)/crypto/asn1/standard_methods.h

+ $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h

+ $(OPENSSL_PATH)/crypto/async/async_local.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.h

+ $(OPENSSL_PATH)/crypto/bio/bio_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.h

+ $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h

+ $(OPENSSL_PATH)/crypto/comp/comp_local.h

+ $(OPENSSL_PATH)/crypto/conf/conf_def.h

+ $(OPENSSL_PATH)/crypto/conf/conf_local.h

+ $(OPENSSL_PATH)/crypto/dh/dh_local.h

+ $(OPENSSL_PATH)/crypto/dso/dso_local.h

+ $(OPENSSL_PATH)/crypto/evp/evp_local.h

+ $(OPENSSL_PATH)/crypto/hmac/hmac_local.h

+ $(OPENSSL_PATH)/crypto/lhash/lhash_local.h

+ $(OPENSSL_PATH)/crypto/md5/md5_local.h

+ $(OPENSSL_PATH)/crypto/modes/modes_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.h

+ $(OPENSSL_PATH)/crypto/objects/obj_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.h

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h

+ $(OPENSSL_PATH)/crypto/rand/rand_local.h

+ $(OPENSSL_PATH)/crypto/rsa/rsa_local.h

+ $(OPENSSL_PATH)/crypto/sha/sha_local.h

+ $(OPENSSL_PATH)/crypto/siphash/siphash_local.h

+ $(OPENSSL_PATH)/crypto/sm3/sm3_local.h

+ $(OPENSSL_PATH)/crypto/store/store_local.h

+ $(OPENSSL_PATH)/crypto/ui/ui_local.h

+ $(OPENSSL_PATH)/crypto/x509/x509_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h

+ $(OPENSSL_PATH)/ssl/bio_ssl.c

+ $(OPENSSL_PATH)/ssl/d1_lib.c

+ $(OPENSSL_PATH)/ssl/d1_msg.c

+ $(OPENSSL_PATH)/ssl/d1_srtp.c

+ $(OPENSSL_PATH)/ssl/methods.c

+ $(OPENSSL_PATH)/ssl/packet.c

+ $(OPENSSL_PATH)/ssl/pqueue.c

+ $(OPENSSL_PATH)/ssl/record/dtls1_bitmap.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_d1.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_s3.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_buffer.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record_tls13.c

+ $(OPENSSL_PATH)/ssl/s3_cbc.c

+ $(OPENSSL_PATH)/ssl/s3_enc.c

+ $(OPENSSL_PATH)/ssl/s3_lib.c

+ $(OPENSSL_PATH)/ssl/s3_msg.c

+ $(OPENSSL_PATH)/ssl/ssl_asn1.c

+ $(OPENSSL_PATH)/ssl/ssl_cert.c

+ $(OPENSSL_PATH)/ssl/ssl_ciph.c

+ $(OPENSSL_PATH)/ssl/ssl_conf.c

+ $(OPENSSL_PATH)/ssl/ssl_err.c

+ $(OPENSSL_PATH)/ssl/ssl_init.c

+ $(OPENSSL_PATH)/ssl/ssl_lib.c

+ $(OPENSSL_PATH)/ssl/ssl_mcnf.c

+ $(OPENSSL_PATH)/ssl/ssl_rsa.c

+ $(OPENSSL_PATH)/ssl/ssl_sess.c

+ $(OPENSSL_PATH)/ssl/ssl_stat.c

+ $(OPENSSL_PATH)/ssl/ssl_txt.c

+ $(OPENSSL_PATH)/ssl/ssl_utst.c

+ $(OPENSSL_PATH)/ssl/statem/extensions.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_cust.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_srvr.c

+ $(OPENSSL_PATH)/ssl/statem/statem.c

+ $(OPENSSL_PATH)/ssl/statem/statem_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/statem_dtls.c

+ $(OPENSSL_PATH)/ssl/statem/statem_lib.c

+ $(OPENSSL_PATH)/ssl/statem/statem_srvr.c

+ $(OPENSSL_PATH)/ssl/t1_enc.c

+ $(OPENSSL_PATH)/ssl/t1_lib.c

+ $(OPENSSL_PATH)/ssl/t1_trce.c

+ $(OPENSSL_PATH)/ssl/tls13_enc.c

+ $(OPENSSL_PATH)/ssl/tls_srp.c

+ $(OPENSSL_PATH)/ssl/packet_local.h

+ $(OPENSSL_PATH)/ssl/ssl_cert_table.h

+ $(OPENSSL_PATH)/ssl/ssl_local.h

+ $(OPENSSL_PATH)/ssl/record/record.h

+ $(OPENSSL_PATH)/ssl/record/record_local.h

+ $(OPENSSL_PATH)/ssl/statem/statem.h

+ $(OPENSSL_PATH)/ssl/statem/statem_local.h

+# Autogenerated files list ends here

+ buildinf.h

+ rand_pool_noise.h

+ ossl_store.c

+ rand_pool.c

+

+[Sources.X64]

+ rand_pool_noise_tsc.c

+ ApiHooks.c

+

+[Packages]

+ MdePkg/MdePkg.dec

+ CryptoPkg/CryptoPkg.dec

+

+[LibraryClasses]

+ BaseLib

+ DebugLib

+ TimerLib

+ PrintLib

+

+[BuildOptions]

+ #

+ # Disables the following Visual Studio compiler warnings brought by openssl
source,

+ # so we do not break the build with /WX option:

+ # C4090: 'function' : different 'const' qualifiers

+ # C4132: 'object' : const object should be initialized (tls13_enc.c)

+ # C4210: nonstandard extension used: function given file scope

+ # C4244: conversion from type1 to type2, possible loss of data

+ # C4245: conversion from type1 to type2, signed/unsigned mismatch

+ # C4267: conversion from size_t to type, possible loss of data

+ # C4306: 'identifier' : conversion from 'type1' to 'type2' of greater size

+ # C4310: cast truncates constant value

+ # C4389: 'operator' : signed/unsigned mismatch (xxxx)

+ # C4700: uninitialized local variable 'name' used. (conf_sap.c(71))

+ # C4702: unreachable code

+ # C4706: assignment within conditional expression

+ # C4819: The file contains a character that cannot be represented in the
current code page

+ #

+ MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /wd4090 /wd4132 /wd4210
/wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702
/wd4706 /wd4819

+

+ INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /w

+

+ #

+ # Suppress the following build warnings in openssl so we don't break the build
with -Werror

+ # -Werror=maybe-uninitialized: there exist some other paths for which the
variable is not initialized.

+ # -Werror=format: Check calls to printf and scanf, etc., to make sure that the
arguments supplied have

+ # types appropriate to the format string specified.

+ # -Werror=unused-but-set-variable: Warn whenever a local variable is
assigned to, but otherwise unused (aside from its declaration).

+ #

+ GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS)
$(OPENSSL_FLAGS_CONFIG) -Wno-error=maybe-uninitialized -Wno-
error=format -Wno-format -Wno-error=unused-but-set-variable -
DNO_MSABI_VA_FUNCS

+

+ # suppress the following warnings in openssl so we don't break the build with
warnings-as-errors:

+ # 1295: Deprecated declaration <entity> - give arg types

+ # 550: <entity> was set but never used

+ # 1293: assignment in condition

+ # 111: statement is unreachable (invariably "break;" after "return X;" in case
statement)

+ # 68: integer conversion resulted in a change of sign ("if (Status == -1)")

+ # 177: <entity> was declared but never referenced

+ # 223: function <entity> declared implicitly

+ # 144: a value of type <type> cannot be used to initialize an entity of type
<type>

+ # 513: a value of type <type> cannot be assigned to an entity of type <type>

+ # 188: enumerated type mixed with another type (i.e. passing an integer as an
enum without a cast)

+ # 1296: Extended constant initialiser used

+ # 128: loop is not reachable - may be emitted inappropriately if code follows
a conditional return

+ # from the function that evaluates to true at compile time

+ # 546: transfer of control bypasses initialization - may be emitted
inappropriately if the uninitialized

+ # variable is never referenced after the jump

+ # 1: ignore "#1-D: last line of file ends without a newline"

+ # 3017: <entity> may be used before being set (NOTE: This was fixed in
OpenSSL 1.1 HEAD with

+ # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be
dropped then.)

+ XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) -w -std=c99 -Wno-
error=uninitialized

diff --git a/CryptoPkg/Library/Include/openssl/opensslconf.h
b/CryptoPkg/Library/Include/openssl/opensslconf.h
index 3a2544ea5c..e8f73c4d10 100644
--- a/CryptoPkg/Library/Include/openssl/opensslconf.h
+++ b/CryptoPkg/Library/Include/openssl/opensslconf.h
@@ -112,9 +112,6 @@ extern "C" {
#ifndef OPENSSL_NO_ASAN

# define OPENSSL_NO_ASAN

#endif

-#ifndef OPENSSL_NO_ASM

-# define OPENSSL_NO_ASM

-#endif

#ifndef OPENSSL_NO_ASYNC

# define OPENSSL_NO_ASYNC

#endif

diff --git a/CryptoPkg/Library/OpensslLib/ApiHooks.c
b/CryptoPkg/Library/OpensslLib/ApiHooks.c
new file mode 100644
index 0000000000..58cff16838
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/ApiHooks.c
@@ -0,0 +1,18 @@
+/** @file

+ OpenSSL Library API hooks.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+VOID *

+__imp_RtlVirtualUnwind (

+ VOID * Args

+ )

+{

+ return NULL;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
new file mode 100644
index 0000000000..ef20d2b84e
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
@@ -0,0 +1,34 @@
+/** @file

+ Constructor to initialize CPUID data for OpenSSL assembly operations.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+extern void OPENSSL_cpuid_setup (void);

+

+/**

+ Constructor routine for OpensslLib.

+

+ The constructor calls an internal OpenSSL function which fetches a local copy

+ of the hardware capability flags, used to enable native crypto instructions.

+

+ @param None

+

+ @retval EFI_SUCCESS The construction succeeded.

+

+**/

+EFI_STATUS

+EFIAPI

+OpensslLibConstructor (

+ VOID

+ )

+{

+ OPENSSL_cpuid_setup ();

+

+ return EFI_SUCCESS;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl
b/CryptoPkg/Library/OpensslLib/process_files.pl
index 57ce195394..472f59bc8e 100755
--- a/CryptoPkg/Library/OpensslLib/process_files.pl
+++ b/CryptoPkg/Library/OpensslLib/process_files.pl
@@ -9,9 +9,63 @@
# do not need to do this, since the results are stored in the EDK2

# git repository for them.

#

+# Due to the script wrapping required to process the OpenSSL

+# configuration data, each native architecture must be processed

+# individually by the maintainer (in addition to the standard version):

+# ./process_files.pl

+# ./process_files.pl X64

+# ./process_files.pl [Arch]

+

use strict;

use Cwd;

use File::Copy;

+use File::Basename;

+use File::Path qw(make_path remove_tree);

+use Text::Tabs;

+

+#

+# OpenSSL perlasm generator script does not transfer the copyright header

+#

+sub copy_license_header

+{

+ my @args = split / /, shift; #Separate args by spaces

+ my $source = $args[1]; #Source file is second (after "perl")

+ my $target = pop @args; #Target file is always last

+ chop ($target); #Remove newline char

+

+ my $temp_file_name = "license.tmp";

+ open (my $source_file, "<" . $source) || die $source;

+ open (my $target_file, "<" . $target) || die $target;

+ open (my $temp_file, ">" . $temp_file_name) || die $temp_file_name;

+

+ #Add "generated file" warning

+ $source =~ s/^..//; #Remove leading "./"

+ print ($temp_file "; WARNING: do not edit!\r\n");

+ print ($temp_file "; Generated from $source\r\n");

+ print ($temp_file ";\r\n");

+

+ #Copy source file header to temp file

+ while (my $line = <$source_file>) {

+ next if ($line =~ /#!/); #Ignore shebang line

+ $line =~ s/#/;/; #Fix comment character for assembly

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace, fixup line endings

+ print ($temp_file $line);

+ last if ($line =~ /http/); #Last line of copyright header contains a web link

+ }

+ print ($temp_file "\r\n");

+ #Retrieve generated assembly contents

+ while (my $line = <$target_file>) {

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace, fixup line endings

+ print ($temp_file expand ($line)); #expand() replaces tabs with spaces

+ }

+

+ close ($source_file);

+ close ($target_file);

+ close ($temp_file);

+

+ move ($temp_file_name, $target) ||

+ die "Cannot replace \"" . $target . "\"!";

+}



#

# Find the openssl directory name for use lib. We have to do this

@@ -21,10 +75,41 @@ use File::Copy;
#

my $inf_file;

my $OPENSSL_PATH;

+my $uefi_config;

+my $extension;

+my $arch;

my @inf;



BEGIN {

$inf_file = "OpensslLib.inf";

+ $uefi_config = "UEFI";

+ $arch = shift;

+

+ if (defined $arch) {

+ if (uc ($arch) eq "X64") {

+ $arch = "X64";

+ $inf_file = "OpensslLibX64.inf";

+ $uefi_config = "UEFI-x86_64";

+ $extension = "nasm";

+ } else {

+ die "Unsupported architecture \"" . $arch . "\"!";

+ }

+ if ($extension eq "nasm") {

+ if (`nasm -v 2>&1`) {

+ #Presence of nasm executable will trigger inclusion of AVX instructions

+ die "\nCannot run assembly generators with NASM in path!\n\n";

+ }

+ }

+

+ # Prepare assembly folder

+ if (-d $arch) {

+ remove_tree ($arch, {safe => 1}) ||

+ die "Cannot clean assembly folder \"" . $arch . "\"!";

+ } else {

+ mkdir $arch ||

+ die "Cannot create assembly folder \"" . $arch . "\"!";

+ }

+ }



# Read the contents of the inf file

open( FD, "<" . $inf_file ) ||

@@ -47,9 +132,9 @@ BEGIN {
# Configure UEFI

system(

"./Configure",

- "UEFI",

+ "--config=../uefi-asm.conf",

+ "$uefi_config",

"no-afalgeng",

- "no-asm",

"no-async",

"no-autoerrinit",

"no-autoload-config",

@@ -129,23 +214,53 @@ BEGIN {
# Retrieve file lists from OpenSSL configdata

#

use configdata qw/%unified_info/;

+use configdata qw/%config/;

+use configdata qw/%target/;

+

+#

+# Collect build flags from configdata

+#

+my $flags = "";

+foreach my $f (@{$config{lib_defines}}) {

+ $flags .= " -D$f";

+}



my @cryptofilelist = ();

my @sslfilelist = ();

+my @asmfilelist = ();

+my @asmbuild = ();

foreach my $product ((@{$unified_info{libraries}},

@{$unified_info{engines}})) {

foreach my $o (@{$unified_info{sources}->{$product}}) {

foreach my $s (@{$unified_info{sources}->{$o}}) {

- next if ($unified_info{generate}->{$s});

- next if $s =~ "crypto/bio/b_print.c";

-

# No need to add unused files in UEFI.

# So it can reduce porting time, compile time, library size.

+ next if $s =~ "crypto/bio/b_print.c";

next if $s =~ "crypto/rand/randfile.c";

next if $s =~ "crypto/store/";

next if $s =~ "crypto/err/err_all.c";

next if $s =~ "crypto/aes/aes_ecb.c";



+ if ($unified_info{generate}->{$s}) {

+ if (defined $arch) {

+ my $buildstring = "perl";

+ foreach my $arg (@{$unified_info{generate}->{$s}}) {

+ if ($arg =~ ".pl") {

+ $buildstring .= " ./openssl/$arg";

+ } elsif ($arg =~ "PERLASM_SCHEME") {

+ $buildstring .= " $target{perlasm_scheme}";

+ } elsif ($arg =~ "LIB_CFLAGS") {

+ $buildstring .= "$flags";

+ }

+ }

+ ($s, my $path, undef) = fileparse($s, qr/\.[^.]*/);

+ $buildstring .= " ./$arch/$path$s.$extension";

+ make_path ("./$arch/$path");

+ push @asmbuild, "$buildstring\n";

+ push @asmfilelist, " $arch/$path$s.$extension\r\n";

+ }

+ next;

+ }

if ($product =~ "libssl") {

push @sslfilelist, ' $(OPENSSL_PATH)/' . $s . "\r\n";

next;

@@ -183,15 +298,31 @@ foreach (@headers){
}





+#

+# Generate assembly files

+#

+if (@asmbuild) {

+ print "\n--> Generating assembly files ... ";

+ foreach my $buildstring (@asmbuild) {

+ system ("$buildstring");

+ copy_license_header ($buildstring);

+ }

+ print "Done!";

+}

+

#

# Update OpensslLib.inf with autogenerated file list

#

my @new_inf = ();

my $subbing = 0;

-print "\n--> Updating OpensslLib.inf ... ";

+print "\n--> Updating $inf_file ... ";

foreach (@inf) {

+ if ($_ =~ "DEFINE OPENSSL_FLAGS_CONFIG") {

+ push @new_inf, " DEFINE OPENSSL_FLAGS_CONFIG =" . $flags . "\r\n";

+ next;

+ }

if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist, @sslfilelist;

+ push @new_inf, $_, @asmfilelist, @cryptofilelist, @sslfilelist;

$subbing = 1;

next;

}

@@ -216,49 +347,51 @@ rename( $new_inf_file, $inf_file ) ||
die "rename $inf_file";

print "Done!";



-#

-# Update OpensslLibCrypto.inf with auto-generated file list (no libssl)

-#

-$inf_file = "OpensslLibCrypto.inf";

-

-# Read the contents of the inf file

-@inf = ();

-@new_inf = ();

-open( FD, "<" . $inf_file ) ||

- die "Cannot open \"" . $inf_file . "\"!";

-@inf = (<FD>);

-close(FD) ||

- die "Cannot close \"" . $inf_file . "\"!";

+if (!defined $arch) {

+ #

+ # Update OpensslLibCrypto.inf with auto-generated file list (no libssl)

+ #

+ $inf_file = "OpensslLibCrypto.inf";



-$subbing = 0;

-print "\n--> Updating OpensslLibCrypto.inf ... ";

-foreach (@inf) {

- if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist;

- $subbing = 1;

- next;

- }

- if ( $_ =~ "# Autogenerated files list ends here" ) {

- push @new_inf, $_;

- $subbing = 0;

- next;

+ # Read the contents of the inf file

+ @inf = ();

+ @new_inf = ();

+ open( FD, "<" . $inf_file ) ||

+ die "Cannot open \"" . $inf_file . "\"!";

+ @inf = (<FD>);

+ close(FD) ||

+ die "Cannot close \"" . $inf_file . "\"!";

+

+ $subbing = 0;

+ print "\n--> Updating OpensslLibCrypto.inf ... ";

+ foreach (@inf) {

+ if ( $_ =~ "# Autogenerated files list starts here" ) {

+ push @new_inf, $_, @cryptofilelist;

+ $subbing = 1;

+ next;

+ }

+ if ( $_ =~ "# Autogenerated files list ends here" ) {

+ push @new_inf, $_;

+ $subbing = 0;

+ next;

+ }

+

+ push @new_inf, $_

+ unless ($subbing);

}



- push @new_inf, $_

- unless ($subbing);

+ $new_inf_file = $inf_file . ".new";

+ open( FD, ">" . $new_inf_file ) ||

+ die $new_inf_file;

+ print( FD @new_inf ) ||

+ die $new_inf_file;

+ close(FD) ||

+ die $new_inf_file;

+ rename( $new_inf_file, $inf_file ) ||

+ die "rename $inf_file";

+ print "Done!";

}



-$new_inf_file = $inf_file . ".new";

-open( FD, ">" . $new_inf_file ) ||

- die $new_inf_file;

-print( FD @new_inf ) ||

- die $new_inf_file;

-close(FD) ||

- die $new_inf_file;

-rename( $new_inf_file, $inf_file ) ||

- die "rename $inf_file";

-print "Done!";

-

#

# Copy opensslconf.h and dso_conf.h generated from OpenSSL Configuration

#

diff --git a/CryptoPkg/Library/OpensslLib/uefi-asm.conf
b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
new file mode 100644
index 0000000000..55eedbf3ba
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
@@ -0,0 +1,15 @@
+## -*- mode: perl; -*-

+## UEFI assembly openssl configuration targets.

+

+my %targets = (

+#### UEFI

+ "UEFI-x86_64" => {

+ perlasm_scheme => "nasm",

+ # inherit_from => [ "UEFI", asm("x86_64_asm") ],

+ inherit_from => [ "UEFI" ],

+ cpuid_asm_src => "x86_64cpuid.s",

+ aes_asm_src => "aes_core.c aes_cbc.c vpaes-x86_64.s aesni-x86_64.s
aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",

+ sha1_asm_src => "sha1-x86_64.s sha256-x86_64.s sha512-x86_64.s
sha1-mb-x86_64.s sha256-mb-x86_64.s",

+ modes_asm_src => "ghash-x86_64.s",

+ },

+);

--
2.28.0.windows.1


Zurcher, Christopher J
 

After further review, the ApiHooks.c file may no longer be needed since we are no longer including the AVX instructions. I will look over the dependencies and send a new patch set if I can eliminate the API hooks file.

Thanks,
Christopher Zurcher

-----Original Message-----
From: Yao, Jiewen <jiewen.yao@...>
Sent: Thursday, August 13, 2020 08:04
To: Zurcher, Christopher J <christopher.j.zurcher@...>;
devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX <xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native instruction
support for X64

Hi Christopher
Thanks.

1) Would you please help me understand more on "ApiHooks.c contains a stub
function for a Windows API call" ?
Why we need this?
If it is compiler specific in openssl, should we submit patch to openssl to
exclude this with OPENSSL_SYS_UEFI? That should be a cleaner solution for
UEFI.

2) Would you please describe what compiler you have tried? VS? GCC? LLVM?

3) Would you please describe what unit test you have done?

Thank you
Yao Jiewen


-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 4, 2020 8:24 AM
To: devel@edk2.groups.io
Cc: Yao, Jiewen <jiewen.yao@...>; Wang, Jian J
<jian.j.wang@...>;
Lu, XiaoyuX <xiaoyux.lu@...>; Ard Biesheuvel
<ard.biesheuvel@...>
Subject: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native instruction
support
for X64

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2507

Adding OpensslLibX64.inf and modifying process_files.pl to process this
file and generate the necessary assembly files.
ApiHooks.c contains a stub function for a Windows API call.
uefi-asm.conf contains the limited assembly configurations for OpenSSL.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyux.lu@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Christopher J Zurcher <christopher.j.zurcher@...>
---
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibX64.inf | 656
++++++++++++++++++++
CryptoPkg/Library/Include/openssl/opensslconf.h | 3 -
CryptoPkg/Library/OpensslLib/ApiHooks.c | 18 +
CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c | 34 +
CryptoPkg/Library/OpensslLib/process_files.pl | 223 +++++--
CryptoPkg/Library/OpensslLib/uefi-asm.conf | 15 +
8 files changed, 903 insertions(+), 50 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index dbbe5386a1..bd62d86936 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 616ccd9f62..2b7324a990 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
new file mode 100644
index 0000000000..825eea0254
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
@@ -0,0 +1,656 @@
+## @file

+# This module provides OpenSSL Library implementation.

+#

+# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>

+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+ INF_VERSION = 0x00010005

+ BASE_NAME = OpensslLibX64

+ MODULE_UNI_FILE = OpensslLib.uni

+ FILE_GUID = 18125E50-0117-4DD0-BE54-4784AD995FEF

+ MODULE_TYPE = BASE

+ VERSION_STRING = 1.0

+ LIBRARY_CLASS = OpensslLib

+ DEFINE OPENSSL_PATH = openssl

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS_CONFIG = -DOPENSSL_CPUID_OBJ -DSHA1_ASM -
DSHA256_ASM -DSHA512_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM

+ CONSTRUCTOR = OpensslLibConstructor

+

+#

+# VALID_ARCHITECTURES = X64

+#

+

+[Sources]

+ OpensslLibConstructor.c

+ $(OPENSSL_PATH)/e_os.h

+ $(OPENSSL_PATH)/ms/uplink.h

+# Autogenerated files list starts here

+ X64/crypto/aes/aesni-mb-x86_64.nasm

+ X64/crypto/aes/aesni-sha1-x86_64.nasm

+ X64/crypto/aes/aesni-sha256-x86_64.nasm

+ X64/crypto/aes/aesni-x86_64.nasm

+ X64/crypto/aes/vpaes-x86_64.nasm

+ X64/crypto/modes/ghash-x86_64.nasm

+ X64/crypto/sha/sha1-mb-x86_64.nasm

+ X64/crypto/sha/sha1-x86_64.nasm

+ X64/crypto/sha/sha256-mb-x86_64.nasm

+ X64/crypto/sha/sha256-x86_64.nasm

+ X64/crypto/sha/sha512-x86_64.nasm

+ X64/crypto/x86_64cpuid.nasm

+ $(OPENSSL_PATH)/crypto/aes/aes_cbc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_cfb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_core.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ige.c

+ $(OPENSSL_PATH)/crypto/aes/aes_misc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ofb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_wrap.c

+ $(OPENSSL_PATH)/crypto/aria/aria.c

+ $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_digest.c

+ $(OPENSSL_PATH)/crypto/asn1/a_dup.c

+ $(OPENSSL_PATH)/crypto/asn1/a_gentm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_int.c

+ $(OPENSSL_PATH)/crypto/asn1/a_mbstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_object.c

+ $(OPENSSL_PATH)/crypto/asn1/a_octet.c

+ $(OPENSSL_PATH)/crypto/asn1/a_print.c

+ $(OPENSSL_PATH)/crypto/asn1/a_sign.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strex.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strnid.c

+ $(OPENSSL_PATH)/crypto/asn1/a_time.c

+ $(OPENSSL_PATH)/crypto/asn1/a_type.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utctm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utf8.c

+ $(OPENSSL_PATH)/crypto/asn1/a_verify.c

+ $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_err.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_par.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mime.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_moid.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mstbl.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_pack.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/evp_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/f_int.c

+ $(OPENSSL_PATH)/crypto/asn1/f_string.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/n_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/nsseq.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbe.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_scrypt.c

+ $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_bitst.c

+ $(OPENSSL_PATH)/crypto/asn1/t_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_dec.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_enc.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_fre.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_new.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_scn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c

+ $(OPENSSL_PATH)/crypto/asn1/x_algor.c

+ $(OPENSSL_PATH)/crypto/asn1/x_bignum.c

+ $(OPENSSL_PATH)/crypto/asn1/x_info.c

+ $(OPENSSL_PATH)/crypto/asn1/x_int64.c

+ $(OPENSSL_PATH)/crypto/asn1/x_long.c

+ $(OPENSSL_PATH)/crypto/asn1/x_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/x_sig.c

+ $(OPENSSL_PATH)/crypto/asn1/x_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/x_val.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.c

+ $(OPENSSL_PATH)/crypto/async/async.c

+ $(OPENSSL_PATH)/crypto/async/async_err.c

+ $(OPENSSL_PATH)/crypto/async/async_wait.c

+ $(OPENSSL_PATH)/crypto/bio/b_addr.c

+ $(OPENSSL_PATH)/crypto/bio/b_dump.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock2.c

+ $(OPENSSL_PATH)/crypto/bio/bf_buff.c

+ $(OPENSSL_PATH)/crypto/bio/bf_lbuf.c

+ $(OPENSSL_PATH)/crypto/bio/bf_nbio.c

+ $(OPENSSL_PATH)/crypto/bio/bf_null.c

+ $(OPENSSL_PATH)/crypto/bio/bio_cb.c

+ $(OPENSSL_PATH)/crypto/bio/bio_err.c

+ $(OPENSSL_PATH)/crypto/bio/bio_lib.c

+ $(OPENSSL_PATH)/crypto/bio/bio_meth.c

+ $(OPENSSL_PATH)/crypto/bio/bss_acpt.c

+ $(OPENSSL_PATH)/crypto/bio/bss_bio.c

+ $(OPENSSL_PATH)/crypto/bio/bss_conn.c

+ $(OPENSSL_PATH)/crypto/bio/bss_dgram.c

+ $(OPENSSL_PATH)/crypto/bio/bss_fd.c

+ $(OPENSSL_PATH)/crypto/bio/bss_file.c

+ $(OPENSSL_PATH)/crypto/bio/bss_log.c

+ $(OPENSSL_PATH)/crypto/bio/bss_mem.c

+ $(OPENSSL_PATH)/crypto/bio/bss_null.c

+ $(OPENSSL_PATH)/crypto/bio/bss_sock.c

+ $(OPENSSL_PATH)/crypto/bn/bn_add.c

+ $(OPENSSL_PATH)/crypto/bn/bn_asm.c

+ $(OPENSSL_PATH)/crypto/bn/bn_blind.c

+ $(OPENSSL_PATH)/crypto/bn/bn_const.c

+ $(OPENSSL_PATH)/crypto/bn/bn_ctx.c

+ $(OPENSSL_PATH)/crypto/bn/bn_depr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_dh.c

+ $(OPENSSL_PATH)/crypto/bn/bn_div.c

+ $(OPENSSL_PATH)/crypto/bn/bn_err.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp2.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gcd.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gf2m.c

+ $(OPENSSL_PATH)/crypto/bn/bn_intern.c

+ $(OPENSSL_PATH)/crypto/bn/bn_kron.c

+ $(OPENSSL_PATH)/crypto/bn/bn_lib.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mod.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mont.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mpi.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mul.c

+ $(OPENSSL_PATH)/crypto/bn/bn_nist.c

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.c

+ $(OPENSSL_PATH)/crypto/bn/bn_print.c

+ $(OPENSSL_PATH)/crypto/bn/bn_rand.c

+ $(OPENSSL_PATH)/crypto/bn/bn_recp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_shift.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqrt.c

+ $(OPENSSL_PATH)/crypto/bn/bn_srp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_word.c

+ $(OPENSSL_PATH)/crypto/bn/bn_x931p.c

+ $(OPENSSL_PATH)/crypto/buffer/buf_err.c

+ $(OPENSSL_PATH)/crypto/buffer/buffer.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c

+ $(OPENSSL_PATH)/crypto/cmac/cmac.c

+ $(OPENSSL_PATH)/crypto/comp/c_zlib.c

+ $(OPENSSL_PATH)/crypto/comp/comp_err.c

+ $(OPENSSL_PATH)/crypto/comp/comp_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_api.c

+ $(OPENSSL_PATH)/crypto/conf/conf_def.c

+ $(OPENSSL_PATH)/crypto/conf/conf_err.c

+ $(OPENSSL_PATH)/crypto/conf/conf_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mall.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mod.c

+ $(OPENSSL_PATH)/crypto/conf/conf_sap.c

+ $(OPENSSL_PATH)/crypto/conf/conf_ssl.c

+ $(OPENSSL_PATH)/crypto/cpt_err.c

+ $(OPENSSL_PATH)/crypto/cryptlib.c

+ $(OPENSSL_PATH)/crypto/ctype.c

+ $(OPENSSL_PATH)/crypto/cversion.c

+ $(OPENSSL_PATH)/crypto/dh/dh_ameth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_asn1.c

+ $(OPENSSL_PATH)/crypto/dh/dh_check.c

+ $(OPENSSL_PATH)/crypto/dh/dh_depr.c

+ $(OPENSSL_PATH)/crypto/dh/dh_err.c

+ $(OPENSSL_PATH)/crypto/dh/dh_gen.c

+ $(OPENSSL_PATH)/crypto/dh/dh_kdf.c

+ $(OPENSSL_PATH)/crypto/dh/dh_key.c

+ $(OPENSSL_PATH)/crypto/dh/dh_lib.c

+ $(OPENSSL_PATH)/crypto/dh/dh_meth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_prn.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c

+ $(OPENSSL_PATH)/crypto/dso/dso_err.c

+ $(OPENSSL_PATH)/crypto/dso/dso_lib.c

+ $(OPENSSL_PATH)/crypto/dso/dso_openssl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_vms.c

+ $(OPENSSL_PATH)/crypto/dso/dso_win32.c

+ $(OPENSSL_PATH)/crypto/ebcdic.c

+ $(OPENSSL_PATH)/crypto/err/err.c

+ $(OPENSSL_PATH)/crypto/err/err_prn.c

+ $(OPENSSL_PATH)/crypto/evp/bio_b64.c

+ $(OPENSSL_PATH)/crypto/evp/bio_enc.c

+ $(OPENSSL_PATH)/crypto/evp/bio_md.c

+ $(OPENSSL_PATH)/crypto/evp/bio_ok.c

+ $(OPENSSL_PATH)/crypto/evp/c_allc.c

+ $(OPENSSL_PATH)/crypto/evp/c_alld.c

+ $(OPENSSL_PATH)/crypto/evp/cmeth_lib.c

+ $(OPENSSL_PATH)/crypto/evp/digest.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c

+ $(OPENSSL_PATH)/crypto/evp/e_aria.c

+ $(OPENSSL_PATH)/crypto/evp/e_bf.c

+ $(OPENSSL_PATH)/crypto/evp/e_camellia.c

+ $(OPENSSL_PATH)/crypto/evp/e_cast.c

+ $(OPENSSL_PATH)/crypto/evp/e_chacha20_poly1305.c

+ $(OPENSSL_PATH)/crypto/evp/e_des.c

+ $(OPENSSL_PATH)/crypto/evp/e_des3.c

+ $(OPENSSL_PATH)/crypto/evp/e_idea.c

+ $(OPENSSL_PATH)/crypto/evp/e_null.c

+ $(OPENSSL_PATH)/crypto/evp/e_old.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc2.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc5.c

+ $(OPENSSL_PATH)/crypto/evp/e_seed.c

+ $(OPENSSL_PATH)/crypto/evp/e_sm4.c

+ $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c

+ $(OPENSSL_PATH)/crypto/evp/encode.c

+ $(OPENSSL_PATH)/crypto/evp/evp_cnf.c

+ $(OPENSSL_PATH)/crypto/evp/evp_enc.c

+ $(OPENSSL_PATH)/crypto/evp/evp_err.c

+ $(OPENSSL_PATH)/crypto/evp/evp_key.c

+ $(OPENSSL_PATH)/crypto/evp/evp_lib.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pbe.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pkey.c

+ $(OPENSSL_PATH)/crypto/evp/m_md2.c

+ $(OPENSSL_PATH)/crypto/evp/m_md4.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_mdc2.c

+ $(OPENSSL_PATH)/crypto/evp/m_null.c

+ $(OPENSSL_PATH)/crypto/evp/m_ripemd.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha3.c

+ $(OPENSSL_PATH)/crypto/evp/m_sigver.c

+ $(OPENSSL_PATH)/crypto/evp/m_wp.c

+ $(OPENSSL_PATH)/crypto/evp/names.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c

+ $(OPENSSL_PATH)/crypto/evp/p_dec.c

+ $(OPENSSL_PATH)/crypto/evp/p_enc.c

+ $(OPENSSL_PATH)/crypto/evp/p_lib.c

+ $(OPENSSL_PATH)/crypto/evp/p_open.c

+ $(OPENSSL_PATH)/crypto/evp/p_seal.c

+ $(OPENSSL_PATH)/crypto/evp/p_sign.c

+ $(OPENSSL_PATH)/crypto/evp/p_verify.c

+ $(OPENSSL_PATH)/crypto/evp/pbe_scrypt.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c

+ $(OPENSSL_PATH)/crypto/ex_data.c

+ $(OPENSSL_PATH)/crypto/getenv.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c

+ $(OPENSSL_PATH)/crypto/hmac/hmac.c

+ $(OPENSSL_PATH)/crypto/init.c

+ $(OPENSSL_PATH)/crypto/kdf/hkdf.c

+ $(OPENSSL_PATH)/crypto/kdf/kdf_err.c

+ $(OPENSSL_PATH)/crypto/kdf/scrypt.c

+ $(OPENSSL_PATH)/crypto/kdf/tls1_prf.c

+ $(OPENSSL_PATH)/crypto/lhash/lh_stats.c

+ $(OPENSSL_PATH)/crypto/lhash/lhash.c

+ $(OPENSSL_PATH)/crypto/md5/md5_dgst.c

+ $(OPENSSL_PATH)/crypto/md5/md5_one.c

+ $(OPENSSL_PATH)/crypto/mem.c

+ $(OPENSSL_PATH)/crypto/mem_dbg.c

+ $(OPENSSL_PATH)/crypto/mem_sec.c

+ $(OPENSSL_PATH)/crypto/modes/cbc128.c

+ $(OPENSSL_PATH)/crypto/modes/ccm128.c

+ $(OPENSSL_PATH)/crypto/modes/cfb128.c

+ $(OPENSSL_PATH)/crypto/modes/ctr128.c

+ $(OPENSSL_PATH)/crypto/modes/cts128.c

+ $(OPENSSL_PATH)/crypto/modes/gcm128.c

+ $(OPENSSL_PATH)/crypto/modes/ocb128.c

+ $(OPENSSL_PATH)/crypto/modes/ofb128.c

+ $(OPENSSL_PATH)/crypto/modes/wrap128.c

+ $(OPENSSL_PATH)/crypto/modes/xts128.c

+ $(OPENSSL_PATH)/crypto/o_dir.c

+ $(OPENSSL_PATH)/crypto/o_fips.c

+ $(OPENSSL_PATH)/crypto/o_fopen.c

+ $(OPENSSL_PATH)/crypto/o_init.c

+ $(OPENSSL_PATH)/crypto/o_str.c

+ $(OPENSSL_PATH)/crypto/o_time.c

+ $(OPENSSL_PATH)/crypto/objects/o_names.c

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.c

+ $(OPENSSL_PATH)/crypto/objects/obj_err.c

+ $(OPENSSL_PATH)/crypto/objects/obj_lib.c

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c

+ $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c

+ $(OPENSSL_PATH)/crypto/pem/pem_all.c

+ $(OPENSSL_PATH)/crypto/pem/pem_err.c

+ $(OPENSSL_PATH)/crypto/pem/pem_info.c

+ $(OPENSSL_PATH)/crypto/pem/pem_lib.c

+ $(OPENSSL_PATH)/crypto/pem/pem_oth.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pk8.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pkey.c

+ $(OPENSSL_PATH)/crypto/pem/pem_sign.c

+ $(OPENSSL_PATH)/crypto/pem/pem_x509.c

+ $(OPENSSL_PATH)/crypto/pem/pem_xaux.c

+ $(OPENSSL_PATH)/crypto/pem/pvkfmt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_init.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_key.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_sbag.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c

+ $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_ctr.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_egd.c

+ $(OPENSSL_PATH)/crypto/rand/rand_err.c

+ $(OPENSSL_PATH)/crypto/rand/rand_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_unix.c

+ $(OPENSSL_PATH)/crypto/rand/rand_vms.c

+ $(OPENSSL_PATH)/crypto/rand/rand_win.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_chk.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_err.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_lib.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_meth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_mp.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_none.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ossl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_saos.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_sign.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c

+ $(OPENSSL_PATH)/crypto/sha/keccak1600.c

+ $(OPENSSL_PATH)/crypto/sha/sha1_one.c

+ $(OPENSSL_PATH)/crypto/sha/sha1dgst.c

+ $(OPENSSL_PATH)/crypto/sha/sha256.c

+ $(OPENSSL_PATH)/crypto/sha/sha512.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_ameth.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_pmeth.c

+ $(OPENSSL_PATH)/crypto/sm3/m_sm3.c

+ $(OPENSSL_PATH)/crypto/sm3/sm3.c

+ $(OPENSSL_PATH)/crypto/sm4/sm4.c

+ $(OPENSSL_PATH)/crypto/stack/stack.c

+ $(OPENSSL_PATH)/crypto/threads_none.c

+ $(OPENSSL_PATH)/crypto/threads_pthread.c

+ $(OPENSSL_PATH)/crypto/threads_win.c

+ $(OPENSSL_PATH)/crypto/txt_db/txt_db.c

+ $(OPENSSL_PATH)/crypto/ui/ui_err.c

+ $(OPENSSL_PATH)/crypto/ui/ui_lib.c

+ $(OPENSSL_PATH)/crypto/ui/ui_null.c

+ $(OPENSSL_PATH)/crypto/ui/ui_openssl.c

+ $(OPENSSL_PATH)/crypto/ui/ui_util.c

+ $(OPENSSL_PATH)/crypto/uid.c

+ $(OPENSSL_PATH)/crypto/x509/by_dir.c

+ $(OPENSSL_PATH)/crypto/x509/by_file.c

+ $(OPENSSL_PATH)/crypto/x509/t_crl.c

+ $(OPENSSL_PATH)/crypto/x509/t_req.c

+ $(OPENSSL_PATH)/crypto/x509/t_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x509_att.c

+ $(OPENSSL_PATH)/crypto/x509/x509_cmp.c

+ $(OPENSSL_PATH)/crypto/x509/x509_d2.c

+ $(OPENSSL_PATH)/crypto/x509/x509_def.c

+ $(OPENSSL_PATH)/crypto/x509/x509_err.c

+ $(OPENSSL_PATH)/crypto/x509/x509_ext.c

+ $(OPENSSL_PATH)/crypto/x509/x509_lu.c

+ $(OPENSSL_PATH)/crypto/x509/x509_meth.c

+ $(OPENSSL_PATH)/crypto/x509/x509_obj.c

+ $(OPENSSL_PATH)/crypto/x509/x509_r2x.c

+ $(OPENSSL_PATH)/crypto/x509/x509_req.c

+ $(OPENSSL_PATH)/crypto/x509/x509_set.c

+ $(OPENSSL_PATH)/crypto/x509/x509_trs.c

+ $(OPENSSL_PATH)/crypto/x509/x509_txt.c

+ $(OPENSSL_PATH)/crypto/x509/x509_v3.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vfy.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vpm.c

+ $(OPENSSL_PATH)/crypto/x509/x509cset.c

+ $(OPENSSL_PATH)/crypto/x509/x509name.c

+ $(OPENSSL_PATH)/crypto/x509/x509rset.c

+ $(OPENSSL_PATH)/crypto/x509/x509spki.c

+ $(OPENSSL_PATH)/crypto/x509/x509type.c

+ $(OPENSSL_PATH)/crypto/x509/x_all.c

+ $(OPENSSL_PATH)/crypto/x509/x_attrib.c

+ $(OPENSSL_PATH)/crypto/x509/x_crl.c

+ $(OPENSSL_PATH)/crypto/x509/x_exten.c

+ $(OPENSSL_PATH)/crypto/x509/x_name.c

+ $(OPENSSL_PATH)/crypto/x509/x_pubkey.c

+ $(OPENSSL_PATH)/crypto/x509/x_req.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509a.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_map.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_node.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_alt.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_conf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_crld.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_enum.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_extku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_genn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_info.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_int.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pci.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_prn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_purp.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_skey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_tlsf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3err.c

+ $(OPENSSL_PATH)/crypto/arm_arch.h

+ $(OPENSSL_PATH)/crypto/mips_arch.h

+ $(OPENSSL_PATH)/crypto/ppc_arch.h

+ $(OPENSSL_PATH)/crypto/s390x_arch.h

+ $(OPENSSL_PATH)/crypto/sparc_arch.h

+ $(OPENSSL_PATH)/crypto/vms_rms.h

+ $(OPENSSL_PATH)/crypto/aes/aes_local.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_local.h

+ $(OPENSSL_PATH)/crypto/asn1/charmap.h

+ $(OPENSSL_PATH)/crypto/asn1/standard_methods.h

+ $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h

+ $(OPENSSL_PATH)/crypto/async/async_local.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.h

+ $(OPENSSL_PATH)/crypto/bio/bio_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.h

+ $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h

+ $(OPENSSL_PATH)/crypto/comp/comp_local.h

+ $(OPENSSL_PATH)/crypto/conf/conf_def.h

+ $(OPENSSL_PATH)/crypto/conf/conf_local.h

+ $(OPENSSL_PATH)/crypto/dh/dh_local.h

+ $(OPENSSL_PATH)/crypto/dso/dso_local.h

+ $(OPENSSL_PATH)/crypto/evp/evp_local.h

+ $(OPENSSL_PATH)/crypto/hmac/hmac_local.h

+ $(OPENSSL_PATH)/crypto/lhash/lhash_local.h

+ $(OPENSSL_PATH)/crypto/md5/md5_local.h

+ $(OPENSSL_PATH)/crypto/modes/modes_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.h

+ $(OPENSSL_PATH)/crypto/objects/obj_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.h

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h

+ $(OPENSSL_PATH)/crypto/rand/rand_local.h

+ $(OPENSSL_PATH)/crypto/rsa/rsa_local.h

+ $(OPENSSL_PATH)/crypto/sha/sha_local.h

+ $(OPENSSL_PATH)/crypto/siphash/siphash_local.h

+ $(OPENSSL_PATH)/crypto/sm3/sm3_local.h

+ $(OPENSSL_PATH)/crypto/store/store_local.h

+ $(OPENSSL_PATH)/crypto/ui/ui_local.h

+ $(OPENSSL_PATH)/crypto/x509/x509_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h

+ $(OPENSSL_PATH)/ssl/bio_ssl.c

+ $(OPENSSL_PATH)/ssl/d1_lib.c

+ $(OPENSSL_PATH)/ssl/d1_msg.c

+ $(OPENSSL_PATH)/ssl/d1_srtp.c

+ $(OPENSSL_PATH)/ssl/methods.c

+ $(OPENSSL_PATH)/ssl/packet.c

+ $(OPENSSL_PATH)/ssl/pqueue.c

+ $(OPENSSL_PATH)/ssl/record/dtls1_bitmap.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_d1.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_s3.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_buffer.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record_tls13.c

+ $(OPENSSL_PATH)/ssl/s3_cbc.c

+ $(OPENSSL_PATH)/ssl/s3_enc.c

+ $(OPENSSL_PATH)/ssl/s3_lib.c

+ $(OPENSSL_PATH)/ssl/s3_msg.c

+ $(OPENSSL_PATH)/ssl/ssl_asn1.c

+ $(OPENSSL_PATH)/ssl/ssl_cert.c

+ $(OPENSSL_PATH)/ssl/ssl_ciph.c

+ $(OPENSSL_PATH)/ssl/ssl_conf.c

+ $(OPENSSL_PATH)/ssl/ssl_err.c

+ $(OPENSSL_PATH)/ssl/ssl_init.c

+ $(OPENSSL_PATH)/ssl/ssl_lib.c

+ $(OPENSSL_PATH)/ssl/ssl_mcnf.c

+ $(OPENSSL_PATH)/ssl/ssl_rsa.c

+ $(OPENSSL_PATH)/ssl/ssl_sess.c

+ $(OPENSSL_PATH)/ssl/ssl_stat.c

+ $(OPENSSL_PATH)/ssl/ssl_txt.c

+ $(OPENSSL_PATH)/ssl/ssl_utst.c

+ $(OPENSSL_PATH)/ssl/statem/extensions.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_cust.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_srvr.c

+ $(OPENSSL_PATH)/ssl/statem/statem.c

+ $(OPENSSL_PATH)/ssl/statem/statem_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/statem_dtls.c

+ $(OPENSSL_PATH)/ssl/statem/statem_lib.c

+ $(OPENSSL_PATH)/ssl/statem/statem_srvr.c

+ $(OPENSSL_PATH)/ssl/t1_enc.c

+ $(OPENSSL_PATH)/ssl/t1_lib.c

+ $(OPENSSL_PATH)/ssl/t1_trce.c

+ $(OPENSSL_PATH)/ssl/tls13_enc.c

+ $(OPENSSL_PATH)/ssl/tls_srp.c

+ $(OPENSSL_PATH)/ssl/packet_local.h

+ $(OPENSSL_PATH)/ssl/ssl_cert_table.h

+ $(OPENSSL_PATH)/ssl/ssl_local.h

+ $(OPENSSL_PATH)/ssl/record/record.h

+ $(OPENSSL_PATH)/ssl/record/record_local.h

+ $(OPENSSL_PATH)/ssl/statem/statem.h

+ $(OPENSSL_PATH)/ssl/statem/statem_local.h

+# Autogenerated files list ends here

+ buildinf.h

+ rand_pool_noise.h

+ ossl_store.c

+ rand_pool.c

+

+[Sources.X64]

+ rand_pool_noise_tsc.c

+ ApiHooks.c

+

+[Packages]

+ MdePkg/MdePkg.dec

+ CryptoPkg/CryptoPkg.dec

+

+[LibraryClasses]

+ BaseLib

+ DebugLib

+ TimerLib

+ PrintLib

+

+[BuildOptions]

+ #

+ # Disables the following Visual Studio compiler warnings brought by
openssl
source,

+ # so we do not break the build with /WX option:

+ # C4090: 'function' : different 'const' qualifiers

+ # C4132: 'object' : const object should be initialized (tls13_enc.c)

+ # C4210: nonstandard extension used: function given file scope

+ # C4244: conversion from type1 to type2, possible loss of data

+ # C4245: conversion from type1 to type2, signed/unsigned mismatch

+ # C4267: conversion from size_t to type, possible loss of data

+ # C4306: 'identifier' : conversion from 'type1' to 'type2' of greater
size

+ # C4310: cast truncates constant value

+ # C4389: 'operator' : signed/unsigned mismatch (xxxx)

+ # C4700: uninitialized local variable 'name' used. (conf_sap.c(71))

+ # C4702: unreachable code

+ # C4706: assignment within conditional expression

+ # C4819: The file contains a character that cannot be represented in
the
current code page

+ #

+ MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /wd4090 /wd4132 /wd4210
/wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702
/wd4706 /wd4819

+

+ INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /w

+

+ #

+ # Suppress the following build warnings in openssl so we don't break the
build
with -Werror

+ # -Werror=maybe-uninitialized: there exist some other paths for which
the
variable is not initialized.

+ # -Werror=format: Check calls to printf and scanf, etc., to make sure
that the
arguments supplied have

+ # types appropriate to the format string specified.

+ # -Werror=unused-but-set-variable: Warn whenever a local variable is
assigned to, but otherwise unused (aside from its declaration).

+ #

+ GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS)
$(OPENSSL_FLAGS_CONFIG) -Wno-error=maybe-uninitialized -Wno-
error=format -Wno-format -Wno-error=unused-but-set-variable -
DNO_MSABI_VA_FUNCS

+

+ # suppress the following warnings in openssl so we don't break the build
with
warnings-as-errors:

+ # 1295: Deprecated declaration <entity> - give arg types

+ # 550: <entity> was set but never used

+ # 1293: assignment in condition

+ # 111: statement is unreachable (invariably "break;" after "return X;"
in case
statement)

+ # 68: integer conversion resulted in a change of sign ("if (Status ==
-1)")

+ # 177: <entity> was declared but never referenced

+ # 223: function <entity> declared implicitly

+ # 144: a value of type <type> cannot be used to initialize an entity of
type
<type>

+ # 513: a value of type <type> cannot be assigned to an entity of type
<type>

+ # 188: enumerated type mixed with another type (i.e. passing an integer
as an
enum without a cast)

+ # 1296: Extended constant initialiser used

+ # 128: loop is not reachable - may be emitted inappropriately if code
follows
a conditional return

+ # from the function that evaluates to true at compile time

+ # 546: transfer of control bypasses initialization - may be emitted
inappropriately if the uninitialized

+ # variable is never referenced after the jump

+ # 1: ignore "#1-D: last line of file ends without a newline"

+ # 3017: <entity> may be used before being set (NOTE: This was fixed in
OpenSSL 1.1 HEAD with

+ # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be
dropped then.)

+ XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) -w -std=c99 -Wno-
error=uninitialized

diff --git a/CryptoPkg/Library/Include/openssl/opensslconf.h
b/CryptoPkg/Library/Include/openssl/opensslconf.h
index 3a2544ea5c..e8f73c4d10 100644
--- a/CryptoPkg/Library/Include/openssl/opensslconf.h
+++ b/CryptoPkg/Library/Include/openssl/opensslconf.h
@@ -112,9 +112,6 @@ extern "C" {
#ifndef OPENSSL_NO_ASAN

# define OPENSSL_NO_ASAN

#endif

-#ifndef OPENSSL_NO_ASM

-# define OPENSSL_NO_ASM

-#endif

#ifndef OPENSSL_NO_ASYNC

# define OPENSSL_NO_ASYNC

#endif

diff --git a/CryptoPkg/Library/OpensslLib/ApiHooks.c
b/CryptoPkg/Library/OpensslLib/ApiHooks.c
new file mode 100644
index 0000000000..58cff16838
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/ApiHooks.c
@@ -0,0 +1,18 @@
+/** @file

+ OpenSSL Library API hooks.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+VOID *

+__imp_RtlVirtualUnwind (

+ VOID * Args

+ )

+{

+ return NULL;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
new file mode 100644
index 0000000000..ef20d2b84e
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
@@ -0,0 +1,34 @@
+/** @file

+ Constructor to initialize CPUID data for OpenSSL assembly operations.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+extern void OPENSSL_cpuid_setup (void);

+

+/**

+ Constructor routine for OpensslLib.

+

+ The constructor calls an internal OpenSSL function which fetches a local
copy

+ of the hardware capability flags, used to enable native crypto
instructions.

+

+ @param None

+

+ @retval EFI_SUCCESS The construction succeeded.

+

+**/

+EFI_STATUS

+EFIAPI

+OpensslLibConstructor (

+ VOID

+ )

+{

+ OPENSSL_cpuid_setup ();

+

+ return EFI_SUCCESS;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl
b/CryptoPkg/Library/OpensslLib/process_files.pl
index 57ce195394..472f59bc8e 100755
--- a/CryptoPkg/Library/OpensslLib/process_files.pl
+++ b/CryptoPkg/Library/OpensslLib/process_files.pl
@@ -9,9 +9,63 @@
# do not need to do this, since the results are stored in the EDK2

# git repository for them.

#

+# Due to the script wrapping required to process the OpenSSL

+# configuration data, each native architecture must be processed

+# individually by the maintainer (in addition to the standard version):

+# ./process_files.pl

+# ./process_files.pl X64

+# ./process_files.pl [Arch]

+

use strict;

use Cwd;

use File::Copy;

+use File::Basename;

+use File::Path qw(make_path remove_tree);

+use Text::Tabs;

+

+#

+# OpenSSL perlasm generator script does not transfer the copyright header

+#

+sub copy_license_header

+{

+ my @args = split / /, shift; #Separate args by spaces

+ my $source = $args[1]; #Source file is second (after "perl")

+ my $target = pop @args; #Target file is always last

+ chop ($target); #Remove newline char

+

+ my $temp_file_name = "license.tmp";

+ open (my $source_file, "<" . $source) || die $source;

+ open (my $target_file, "<" . $target) || die $target;

+ open (my $temp_file, ">" . $temp_file_name) || die $temp_file_name;

+

+ #Add "generated file" warning

+ $source =~ s/^..//; #Remove leading "./"

+ print ($temp_file "; WARNING: do not edit!\r\n");

+ print ($temp_file "; Generated from $source\r\n");

+ print ($temp_file ";\r\n");

+

+ #Copy source file header to temp file

+ while (my $line = <$source_file>) {

+ next if ($line =~ /#!/); #Ignore shebang line

+ $line =~ s/#/;/; #Fix comment character for assembly

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace, fixup line
endings

+ print ($temp_file $line);

+ last if ($line =~ /http/); #Last line of copyright header
contains a web link

+ }

+ print ($temp_file "\r\n");

+ #Retrieve generated assembly contents

+ while (my $line = <$target_file>) {

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace, fixup line
endings

+ print ($temp_file expand ($line)); #expand() replaces tabs with
spaces

+ }

+

+ close ($source_file);

+ close ($target_file);

+ close ($temp_file);

+

+ move ($temp_file_name, $target) ||

+ die "Cannot replace \"" . $target . "\"!";

+}



#

# Find the openssl directory name for use lib. We have to do this

@@ -21,10 +75,41 @@ use File::Copy;
#

my $inf_file;

my $OPENSSL_PATH;

+my $uefi_config;

+my $extension;

+my $arch;

my @inf;



BEGIN {

$inf_file = "OpensslLib.inf";

+ $uefi_config = "UEFI";

+ $arch = shift;

+

+ if (defined $arch) {

+ if (uc ($arch) eq "X64") {

+ $arch = "X64";

+ $inf_file = "OpensslLibX64.inf";

+ $uefi_config = "UEFI-x86_64";

+ $extension = "nasm";

+ } else {

+ die "Unsupported architecture \"" . $arch . "\"!";

+ }

+ if ($extension eq "nasm") {

+ if (`nasm -v 2>&1`) {

+ #Presence of nasm executable will trigger inclusion of AVX
instructions

+ die "\nCannot run assembly generators with NASM in
path!\n\n";

+ }

+ }

+

+ # Prepare assembly folder

+ if (-d $arch) {

+ remove_tree ($arch, {safe => 1}) ||

+ die "Cannot clean assembly folder \"" . $arch . "\"!";

+ } else {

+ mkdir $arch ||

+ die "Cannot create assembly folder \"" . $arch . "\"!";

+ }

+ }



# Read the contents of the inf file

open( FD, "<" . $inf_file ) ||

@@ -47,9 +132,9 @@ BEGIN {
# Configure UEFI

system(

"./Configure",

- "UEFI",

+ "--config=../uefi-asm.conf",

+ "$uefi_config",

"no-afalgeng",

- "no-asm",

"no-async",

"no-autoerrinit",

"no-autoload-config",

@@ -129,23 +214,53 @@ BEGIN {
# Retrieve file lists from OpenSSL configdata

#

use configdata qw/%unified_info/;

+use configdata qw/%config/;

+use configdata qw/%target/;

+

+#

+# Collect build flags from configdata

+#

+my $flags = "";

+foreach my $f (@{$config{lib_defines}}) {

+ $flags .= " -D$f";

+}



my @cryptofilelist = ();

my @sslfilelist = ();

+my @asmfilelist = ();

+my @asmbuild = ();

foreach my $product ((@{$unified_info{libraries}},

@{$unified_info{engines}})) {

foreach my $o (@{$unified_info{sources}->{$product}}) {

foreach my $s (@{$unified_info{sources}->{$o}}) {

- next if ($unified_info{generate}->{$s});

- next if $s =~ "crypto/bio/b_print.c";

-

# No need to add unused files in UEFI.

# So it can reduce porting time, compile time, library size.

+ next if $s =~ "crypto/bio/b_print.c";

next if $s =~ "crypto/rand/randfile.c";

next if $s =~ "crypto/store/";

next if $s =~ "crypto/err/err_all.c";

next if $s =~ "crypto/aes/aes_ecb.c";



+ if ($unified_info{generate}->{$s}) {

+ if (defined $arch) {

+ my $buildstring = "perl";

+ foreach my $arg (@{$unified_info{generate}->{$s}}) {

+ if ($arg =~ ".pl") {

+ $buildstring .= " ./openssl/$arg";

+ } elsif ($arg =~ "PERLASM_SCHEME") {

+ $buildstring .= " $target{perlasm_scheme}";

+ } elsif ($arg =~ "LIB_CFLAGS") {

+ $buildstring .= "$flags";

+ }

+ }

+ ($s, my $path, undef) = fileparse($s, qr/\.[^.]*/);

+ $buildstring .= " ./$arch/$path$s.$extension";

+ make_path ("./$arch/$path");

+ push @asmbuild, "$buildstring\n";

+ push @asmfilelist, " $arch/$path$s.$extension\r\n";

+ }

+ next;

+ }

if ($product =~ "libssl") {

push @sslfilelist, ' $(OPENSSL_PATH)/' . $s . "\r\n";

next;

@@ -183,15 +298,31 @@ foreach (@headers){
}





+#

+# Generate assembly files

+#

+if (@asmbuild) {

+ print "\n--> Generating assembly files ... ";

+ foreach my $buildstring (@asmbuild) {

+ system ("$buildstring");

+ copy_license_header ($buildstring);

+ }

+ print "Done!";

+}

+

#

# Update OpensslLib.inf with autogenerated file list

#

my @new_inf = ();

my $subbing = 0;

-print "\n--> Updating OpensslLib.inf ... ";

+print "\n--> Updating $inf_file ... ";

foreach (@inf) {

+ if ($_ =~ "DEFINE OPENSSL_FLAGS_CONFIG") {

+ push @new_inf, " DEFINE OPENSSL_FLAGS_CONFIG =" . $flags .
"\r\n";

+ next;

+ }

if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist, @sslfilelist;

+ push @new_inf, $_, @asmfilelist, @cryptofilelist, @sslfilelist;

$subbing = 1;

next;

}

@@ -216,49 +347,51 @@ rename( $new_inf_file, $inf_file ) ||
die "rename $inf_file";

print "Done!";



-#

-# Update OpensslLibCrypto.inf with auto-generated file list (no libssl)

-#

-$inf_file = "OpensslLibCrypto.inf";

-

-# Read the contents of the inf file

-@inf = ();

-@new_inf = ();

-open( FD, "<" . $inf_file ) ||

- die "Cannot open \"" . $inf_file . "\"!";

-@inf = (<FD>);

-close(FD) ||

- die "Cannot close \"" . $inf_file . "\"!";

+if (!defined $arch) {

+ #

+ # Update OpensslLibCrypto.inf with auto-generated file list (no
libssl)

+ #

+ $inf_file = "OpensslLibCrypto.inf";



-$subbing = 0;

-print "\n--> Updating OpensslLibCrypto.inf ... ";

-foreach (@inf) {

- if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist;

- $subbing = 1;

- next;

- }

- if ( $_ =~ "# Autogenerated files list ends here" ) {

- push @new_inf, $_;

- $subbing = 0;

- next;

+ # Read the contents of the inf file

+ @inf = ();

+ @new_inf = ();

+ open( FD, "<" . $inf_file ) ||

+ die "Cannot open \"" . $inf_file . "\"!";

+ @inf = (<FD>);

+ close(FD) ||

+ die "Cannot close \"" . $inf_file . "\"!";

+

+ $subbing = 0;

+ print "\n--> Updating OpensslLibCrypto.inf ... ";

+ foreach (@inf) {

+ if ( $_ =~ "# Autogenerated files list starts here" ) {

+ push @new_inf, $_, @cryptofilelist;

+ $subbing = 1;

+ next;

+ }

+ if ( $_ =~ "# Autogenerated files list ends here" ) {

+ push @new_inf, $_;

+ $subbing = 0;

+ next;

+ }

+

+ push @new_inf, $_

+ unless ($subbing);

}



- push @new_inf, $_

- unless ($subbing);

+ $new_inf_file = $inf_file . ".new";

+ open( FD, ">" . $new_inf_file ) ||

+ die $new_inf_file;

+ print( FD @new_inf ) ||

+ die $new_inf_file;

+ close(FD) ||

+ die $new_inf_file;

+ rename( $new_inf_file, $inf_file ) ||

+ die "rename $inf_file";

+ print "Done!";

}



-$new_inf_file = $inf_file . ".new";

-open( FD, ">" . $new_inf_file ) ||

- die $new_inf_file;

-print( FD @new_inf ) ||

- die $new_inf_file;

-close(FD) ||

- die $new_inf_file;

-rename( $new_inf_file, $inf_file ) ||

- die "rename $inf_file";

-print "Done!";

-

#

# Copy opensslconf.h and dso_conf.h generated from OpenSSL Configuration

#

diff --git a/CryptoPkg/Library/OpensslLib/uefi-asm.conf
b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
new file mode 100644
index 0000000000..55eedbf3ba
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
@@ -0,0 +1,15 @@
+## -*- mode: perl; -*-

+## UEFI assembly openssl configuration targets.

+

+my %targets = (

+#### UEFI

+ "UEFI-x86_64" => {

+ perlasm_scheme => "nasm",

+ # inherit_from => [ "UEFI", asm("x86_64_asm") ],

+ inherit_from => [ "UEFI" ],

+ cpuid_asm_src => "x86_64cpuid.s",

+ aes_asm_src => "aes_core.c aes_cbc.c vpaes-x86_64.s aesni-
x86_64.s
aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",

+ sha1_asm_src => "sha1-x86_64.s sha256-x86_64.s sha512-x86_64.s
sha1-mb-x86_64.s sha256-mb-x86_64.s",

+ modes_asm_src => "ghash-x86_64.s",

+ },

+);

--
2.28.0.windows.1


Zurcher, Christopher J
 

1) I have confirmed that the ApiHooks.c file is still required even without the AVX instructions included. The x86_64 assembly files in OpenSSL set a flag called $win64 and automatically include calls to the RtlVirtualUnwind function if NASM is selected as the assembler scheme.

https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-rtlvirtualunwind

I have submitted an issue against OpenSSL since I don't think using the NASM assembler should force the inclusion of Windows-specific API hooks, but that change cannot be made in OpenSSL 1.1.1 and we will have to wait for OpenSSL 3 or later to remove the stub function.

https://github.com/openssl/openssl/issues/12712

2) So far I have only built with VS.

3) The X64 SHA256 implementation was successfully exercised across a large number of devices in a production environment as a verification step in a multi-GB data transfer scenario.

Thanks,
Christopher Zurcher

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zurcher,
Christopher J
Sent: Tuesday, August 18, 2020 15:50
To: Yao, Jiewen <jiewen.yao@...>; devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX <xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: Re: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

After further review, the ApiHooks.c file may no longer be needed since we
are no longer including the AVX instructions. I will look over the
dependencies and send a new patch set if I can eliminate the API hooks file.

Thanks,
Christopher Zurcher

-----Original Message-----
From: Yao, Jiewen <jiewen.yao@...>
Sent: Thursday, August 13, 2020 08:04
To: Zurcher, Christopher J <christopher.j.zurcher@...>;
devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native instruction
support for X64

Hi Christopher
Thanks.

1) Would you please help me understand more on "ApiHooks.c contains a stub
function for a Windows API call" ?
Why we need this?
If it is compiler specific in openssl, should we submit patch to openssl to
exclude this with OPENSSL_SYS_UEFI? That should be a cleaner solution for
UEFI.

2) Would you please describe what compiler you have tried? VS? GCC? LLVM?

3) Would you please describe what unit test you have done?

Thank you
Yao Jiewen


-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 4, 2020 8:24 AM
To: devel@edk2.groups.io
Cc: Yao, Jiewen <jiewen.yao@...>; Wang, Jian J
<jian.j.wang@...>;
Lu, XiaoyuX <xiaoyux.lu@...>; Ard Biesheuvel
<ard.biesheuvel@...>
Subject: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native instruction
support
for X64

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2507

Adding OpensslLibX64.inf and modifying process_files.pl to process this
file and generate the necessary assembly files.
ApiHooks.c contains a stub function for a Windows API call.
uefi-asm.conf contains the limited assembly configurations for OpenSSL.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyux.lu@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Christopher J Zurcher <christopher.j.zurcher@...>
---
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibX64.inf | 656
++++++++++++++++++++
CryptoPkg/Library/Include/openssl/opensslconf.h | 3 -
CryptoPkg/Library/OpensslLib/ApiHooks.c | 18 +
CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c | 34 +
CryptoPkg/Library/OpensslLib/process_files.pl | 223 +++++--
CryptoPkg/Library/OpensslLib/uefi-asm.conf | 15 +
8 files changed, 903 insertions(+), 50 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index dbbe5386a1..bd62d86936 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 616ccd9f62..2b7324a990 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
new file mode 100644
index 0000000000..825eea0254
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
@@ -0,0 +1,656 @@
+## @file

+# This module provides OpenSSL Library implementation.

+#

+# Copyright (c) 2010 - 2020, Intel Corporation. All rights
reserved.<BR>

+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+ INF_VERSION = 0x00010005

+ BASE_NAME = OpensslLibX64

+ MODULE_UNI_FILE = OpensslLib.uni

+ FILE_GUID = 18125E50-0117-4DD0-BE54-4784AD995FEF

+ MODULE_TYPE = BASE

+ VERSION_STRING = 1.0

+ LIBRARY_CLASS = OpensslLib

+ DEFINE OPENSSL_PATH = openssl

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS_CONFIG = -DOPENSSL_CPUID_OBJ -DSHA1_ASM -
DSHA256_ASM -DSHA512_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM

+ CONSTRUCTOR = OpensslLibConstructor

+

+#

+# VALID_ARCHITECTURES = X64

+#

+

+[Sources]

+ OpensslLibConstructor.c

+ $(OPENSSL_PATH)/e_os.h

+ $(OPENSSL_PATH)/ms/uplink.h

+# Autogenerated files list starts here

+ X64/crypto/aes/aesni-mb-x86_64.nasm

+ X64/crypto/aes/aesni-sha1-x86_64.nasm

+ X64/crypto/aes/aesni-sha256-x86_64.nasm

+ X64/crypto/aes/aesni-x86_64.nasm

+ X64/crypto/aes/vpaes-x86_64.nasm

+ X64/crypto/modes/ghash-x86_64.nasm

+ X64/crypto/sha/sha1-mb-x86_64.nasm

+ X64/crypto/sha/sha1-x86_64.nasm

+ X64/crypto/sha/sha256-mb-x86_64.nasm

+ X64/crypto/sha/sha256-x86_64.nasm

+ X64/crypto/sha/sha512-x86_64.nasm

+ X64/crypto/x86_64cpuid.nasm

+ $(OPENSSL_PATH)/crypto/aes/aes_cbc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_cfb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_core.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ige.c

+ $(OPENSSL_PATH)/crypto/aes/aes_misc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ofb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_wrap.c

+ $(OPENSSL_PATH)/crypto/aria/aria.c

+ $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_digest.c

+ $(OPENSSL_PATH)/crypto/asn1/a_dup.c

+ $(OPENSSL_PATH)/crypto/asn1/a_gentm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_int.c

+ $(OPENSSL_PATH)/crypto/asn1/a_mbstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_object.c

+ $(OPENSSL_PATH)/crypto/asn1/a_octet.c

+ $(OPENSSL_PATH)/crypto/asn1/a_print.c

+ $(OPENSSL_PATH)/crypto/asn1/a_sign.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strex.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strnid.c

+ $(OPENSSL_PATH)/crypto/asn1/a_time.c

+ $(OPENSSL_PATH)/crypto/asn1/a_type.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utctm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utf8.c

+ $(OPENSSL_PATH)/crypto/asn1/a_verify.c

+ $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_err.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_par.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mime.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_moid.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mstbl.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_pack.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/evp_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/f_int.c

+ $(OPENSSL_PATH)/crypto/asn1/f_string.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/n_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/nsseq.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbe.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_scrypt.c

+ $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_bitst.c

+ $(OPENSSL_PATH)/crypto/asn1/t_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_dec.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_enc.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_fre.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_new.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_scn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c

+ $(OPENSSL_PATH)/crypto/asn1/x_algor.c

+ $(OPENSSL_PATH)/crypto/asn1/x_bignum.c

+ $(OPENSSL_PATH)/crypto/asn1/x_info.c

+ $(OPENSSL_PATH)/crypto/asn1/x_int64.c

+ $(OPENSSL_PATH)/crypto/asn1/x_long.c

+ $(OPENSSL_PATH)/crypto/asn1/x_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/x_sig.c

+ $(OPENSSL_PATH)/crypto/asn1/x_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/x_val.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.c

+ $(OPENSSL_PATH)/crypto/async/async.c

+ $(OPENSSL_PATH)/crypto/async/async_err.c

+ $(OPENSSL_PATH)/crypto/async/async_wait.c

+ $(OPENSSL_PATH)/crypto/bio/b_addr.c

+ $(OPENSSL_PATH)/crypto/bio/b_dump.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock2.c

+ $(OPENSSL_PATH)/crypto/bio/bf_buff.c

+ $(OPENSSL_PATH)/crypto/bio/bf_lbuf.c

+ $(OPENSSL_PATH)/crypto/bio/bf_nbio.c

+ $(OPENSSL_PATH)/crypto/bio/bf_null.c

+ $(OPENSSL_PATH)/crypto/bio/bio_cb.c

+ $(OPENSSL_PATH)/crypto/bio/bio_err.c

+ $(OPENSSL_PATH)/crypto/bio/bio_lib.c

+ $(OPENSSL_PATH)/crypto/bio/bio_meth.c

+ $(OPENSSL_PATH)/crypto/bio/bss_acpt.c

+ $(OPENSSL_PATH)/crypto/bio/bss_bio.c

+ $(OPENSSL_PATH)/crypto/bio/bss_conn.c

+ $(OPENSSL_PATH)/crypto/bio/bss_dgram.c

+ $(OPENSSL_PATH)/crypto/bio/bss_fd.c

+ $(OPENSSL_PATH)/crypto/bio/bss_file.c

+ $(OPENSSL_PATH)/crypto/bio/bss_log.c

+ $(OPENSSL_PATH)/crypto/bio/bss_mem.c

+ $(OPENSSL_PATH)/crypto/bio/bss_null.c

+ $(OPENSSL_PATH)/crypto/bio/bss_sock.c

+ $(OPENSSL_PATH)/crypto/bn/bn_add.c

+ $(OPENSSL_PATH)/crypto/bn/bn_asm.c

+ $(OPENSSL_PATH)/crypto/bn/bn_blind.c

+ $(OPENSSL_PATH)/crypto/bn/bn_const.c

+ $(OPENSSL_PATH)/crypto/bn/bn_ctx.c

+ $(OPENSSL_PATH)/crypto/bn/bn_depr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_dh.c

+ $(OPENSSL_PATH)/crypto/bn/bn_div.c

+ $(OPENSSL_PATH)/crypto/bn/bn_err.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp2.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gcd.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gf2m.c

+ $(OPENSSL_PATH)/crypto/bn/bn_intern.c

+ $(OPENSSL_PATH)/crypto/bn/bn_kron.c

+ $(OPENSSL_PATH)/crypto/bn/bn_lib.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mod.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mont.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mpi.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mul.c

+ $(OPENSSL_PATH)/crypto/bn/bn_nist.c

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.c

+ $(OPENSSL_PATH)/crypto/bn/bn_print.c

+ $(OPENSSL_PATH)/crypto/bn/bn_rand.c

+ $(OPENSSL_PATH)/crypto/bn/bn_recp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_shift.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqrt.c

+ $(OPENSSL_PATH)/crypto/bn/bn_srp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_word.c

+ $(OPENSSL_PATH)/crypto/bn/bn_x931p.c

+ $(OPENSSL_PATH)/crypto/buffer/buf_err.c

+ $(OPENSSL_PATH)/crypto/buffer/buffer.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c

+ $(OPENSSL_PATH)/crypto/cmac/cmac.c

+ $(OPENSSL_PATH)/crypto/comp/c_zlib.c

+ $(OPENSSL_PATH)/crypto/comp/comp_err.c

+ $(OPENSSL_PATH)/crypto/comp/comp_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_api.c

+ $(OPENSSL_PATH)/crypto/conf/conf_def.c

+ $(OPENSSL_PATH)/crypto/conf/conf_err.c

+ $(OPENSSL_PATH)/crypto/conf/conf_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mall.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mod.c

+ $(OPENSSL_PATH)/crypto/conf/conf_sap.c

+ $(OPENSSL_PATH)/crypto/conf/conf_ssl.c

+ $(OPENSSL_PATH)/crypto/cpt_err.c

+ $(OPENSSL_PATH)/crypto/cryptlib.c

+ $(OPENSSL_PATH)/crypto/ctype.c

+ $(OPENSSL_PATH)/crypto/cversion.c

+ $(OPENSSL_PATH)/crypto/dh/dh_ameth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_asn1.c

+ $(OPENSSL_PATH)/crypto/dh/dh_check.c

+ $(OPENSSL_PATH)/crypto/dh/dh_depr.c

+ $(OPENSSL_PATH)/crypto/dh/dh_err.c

+ $(OPENSSL_PATH)/crypto/dh/dh_gen.c

+ $(OPENSSL_PATH)/crypto/dh/dh_kdf.c

+ $(OPENSSL_PATH)/crypto/dh/dh_key.c

+ $(OPENSSL_PATH)/crypto/dh/dh_lib.c

+ $(OPENSSL_PATH)/crypto/dh/dh_meth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_prn.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c

+ $(OPENSSL_PATH)/crypto/dso/dso_err.c

+ $(OPENSSL_PATH)/crypto/dso/dso_lib.c

+ $(OPENSSL_PATH)/crypto/dso/dso_openssl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_vms.c

+ $(OPENSSL_PATH)/crypto/dso/dso_win32.c

+ $(OPENSSL_PATH)/crypto/ebcdic.c

+ $(OPENSSL_PATH)/crypto/err/err.c

+ $(OPENSSL_PATH)/crypto/err/err_prn.c

+ $(OPENSSL_PATH)/crypto/evp/bio_b64.c

+ $(OPENSSL_PATH)/crypto/evp/bio_enc.c

+ $(OPENSSL_PATH)/crypto/evp/bio_md.c

+ $(OPENSSL_PATH)/crypto/evp/bio_ok.c

+ $(OPENSSL_PATH)/crypto/evp/c_allc.c

+ $(OPENSSL_PATH)/crypto/evp/c_alld.c

+ $(OPENSSL_PATH)/crypto/evp/cmeth_lib.c

+ $(OPENSSL_PATH)/crypto/evp/digest.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c

+ $(OPENSSL_PATH)/crypto/evp/e_aria.c

+ $(OPENSSL_PATH)/crypto/evp/e_bf.c

+ $(OPENSSL_PATH)/crypto/evp/e_camellia.c

+ $(OPENSSL_PATH)/crypto/evp/e_cast.c

+ $(OPENSSL_PATH)/crypto/evp/e_chacha20_poly1305.c

+ $(OPENSSL_PATH)/crypto/evp/e_des.c

+ $(OPENSSL_PATH)/crypto/evp/e_des3.c

+ $(OPENSSL_PATH)/crypto/evp/e_idea.c

+ $(OPENSSL_PATH)/crypto/evp/e_null.c

+ $(OPENSSL_PATH)/crypto/evp/e_old.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc2.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc5.c

+ $(OPENSSL_PATH)/crypto/evp/e_seed.c

+ $(OPENSSL_PATH)/crypto/evp/e_sm4.c

+ $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c

+ $(OPENSSL_PATH)/crypto/evp/encode.c

+ $(OPENSSL_PATH)/crypto/evp/evp_cnf.c

+ $(OPENSSL_PATH)/crypto/evp/evp_enc.c

+ $(OPENSSL_PATH)/crypto/evp/evp_err.c

+ $(OPENSSL_PATH)/crypto/evp/evp_key.c

+ $(OPENSSL_PATH)/crypto/evp/evp_lib.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pbe.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pkey.c

+ $(OPENSSL_PATH)/crypto/evp/m_md2.c

+ $(OPENSSL_PATH)/crypto/evp/m_md4.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_mdc2.c

+ $(OPENSSL_PATH)/crypto/evp/m_null.c

+ $(OPENSSL_PATH)/crypto/evp/m_ripemd.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha3.c

+ $(OPENSSL_PATH)/crypto/evp/m_sigver.c

+ $(OPENSSL_PATH)/crypto/evp/m_wp.c

+ $(OPENSSL_PATH)/crypto/evp/names.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c

+ $(OPENSSL_PATH)/crypto/evp/p_dec.c

+ $(OPENSSL_PATH)/crypto/evp/p_enc.c

+ $(OPENSSL_PATH)/crypto/evp/p_lib.c

+ $(OPENSSL_PATH)/crypto/evp/p_open.c

+ $(OPENSSL_PATH)/crypto/evp/p_seal.c

+ $(OPENSSL_PATH)/crypto/evp/p_sign.c

+ $(OPENSSL_PATH)/crypto/evp/p_verify.c

+ $(OPENSSL_PATH)/crypto/evp/pbe_scrypt.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c

+ $(OPENSSL_PATH)/crypto/ex_data.c

+ $(OPENSSL_PATH)/crypto/getenv.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c

+ $(OPENSSL_PATH)/crypto/hmac/hmac.c

+ $(OPENSSL_PATH)/crypto/init.c

+ $(OPENSSL_PATH)/crypto/kdf/hkdf.c

+ $(OPENSSL_PATH)/crypto/kdf/kdf_err.c

+ $(OPENSSL_PATH)/crypto/kdf/scrypt.c

+ $(OPENSSL_PATH)/crypto/kdf/tls1_prf.c

+ $(OPENSSL_PATH)/crypto/lhash/lh_stats.c

+ $(OPENSSL_PATH)/crypto/lhash/lhash.c

+ $(OPENSSL_PATH)/crypto/md5/md5_dgst.c

+ $(OPENSSL_PATH)/crypto/md5/md5_one.c

+ $(OPENSSL_PATH)/crypto/mem.c

+ $(OPENSSL_PATH)/crypto/mem_dbg.c

+ $(OPENSSL_PATH)/crypto/mem_sec.c

+ $(OPENSSL_PATH)/crypto/modes/cbc128.c

+ $(OPENSSL_PATH)/crypto/modes/ccm128.c

+ $(OPENSSL_PATH)/crypto/modes/cfb128.c

+ $(OPENSSL_PATH)/crypto/modes/ctr128.c

+ $(OPENSSL_PATH)/crypto/modes/cts128.c

+ $(OPENSSL_PATH)/crypto/modes/gcm128.c

+ $(OPENSSL_PATH)/crypto/modes/ocb128.c

+ $(OPENSSL_PATH)/crypto/modes/ofb128.c

+ $(OPENSSL_PATH)/crypto/modes/wrap128.c

+ $(OPENSSL_PATH)/crypto/modes/xts128.c

+ $(OPENSSL_PATH)/crypto/o_dir.c

+ $(OPENSSL_PATH)/crypto/o_fips.c

+ $(OPENSSL_PATH)/crypto/o_fopen.c

+ $(OPENSSL_PATH)/crypto/o_init.c

+ $(OPENSSL_PATH)/crypto/o_str.c

+ $(OPENSSL_PATH)/crypto/o_time.c

+ $(OPENSSL_PATH)/crypto/objects/o_names.c

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.c

+ $(OPENSSL_PATH)/crypto/objects/obj_err.c

+ $(OPENSSL_PATH)/crypto/objects/obj_lib.c

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c

+ $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c

+ $(OPENSSL_PATH)/crypto/pem/pem_all.c

+ $(OPENSSL_PATH)/crypto/pem/pem_err.c

+ $(OPENSSL_PATH)/crypto/pem/pem_info.c

+ $(OPENSSL_PATH)/crypto/pem/pem_lib.c

+ $(OPENSSL_PATH)/crypto/pem/pem_oth.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pk8.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pkey.c

+ $(OPENSSL_PATH)/crypto/pem/pem_sign.c

+ $(OPENSSL_PATH)/crypto/pem/pem_x509.c

+ $(OPENSSL_PATH)/crypto/pem/pem_xaux.c

+ $(OPENSSL_PATH)/crypto/pem/pvkfmt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_init.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_key.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_sbag.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c

+ $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_ctr.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_egd.c

+ $(OPENSSL_PATH)/crypto/rand/rand_err.c

+ $(OPENSSL_PATH)/crypto/rand/rand_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_unix.c

+ $(OPENSSL_PATH)/crypto/rand/rand_vms.c

+ $(OPENSSL_PATH)/crypto/rand/rand_win.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_chk.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_err.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_lib.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_meth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_mp.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_none.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ossl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_saos.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_sign.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c

+ $(OPENSSL_PATH)/crypto/sha/keccak1600.c

+ $(OPENSSL_PATH)/crypto/sha/sha1_one.c

+ $(OPENSSL_PATH)/crypto/sha/sha1dgst.c

+ $(OPENSSL_PATH)/crypto/sha/sha256.c

+ $(OPENSSL_PATH)/crypto/sha/sha512.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_ameth.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_pmeth.c

+ $(OPENSSL_PATH)/crypto/sm3/m_sm3.c

+ $(OPENSSL_PATH)/crypto/sm3/sm3.c

+ $(OPENSSL_PATH)/crypto/sm4/sm4.c

+ $(OPENSSL_PATH)/crypto/stack/stack.c

+ $(OPENSSL_PATH)/crypto/threads_none.c

+ $(OPENSSL_PATH)/crypto/threads_pthread.c

+ $(OPENSSL_PATH)/crypto/threads_win.c

+ $(OPENSSL_PATH)/crypto/txt_db/txt_db.c

+ $(OPENSSL_PATH)/crypto/ui/ui_err.c

+ $(OPENSSL_PATH)/crypto/ui/ui_lib.c

+ $(OPENSSL_PATH)/crypto/ui/ui_null.c

+ $(OPENSSL_PATH)/crypto/ui/ui_openssl.c

+ $(OPENSSL_PATH)/crypto/ui/ui_util.c

+ $(OPENSSL_PATH)/crypto/uid.c

+ $(OPENSSL_PATH)/crypto/x509/by_dir.c

+ $(OPENSSL_PATH)/crypto/x509/by_file.c

+ $(OPENSSL_PATH)/crypto/x509/t_crl.c

+ $(OPENSSL_PATH)/crypto/x509/t_req.c

+ $(OPENSSL_PATH)/crypto/x509/t_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x509_att.c

+ $(OPENSSL_PATH)/crypto/x509/x509_cmp.c

+ $(OPENSSL_PATH)/crypto/x509/x509_d2.c

+ $(OPENSSL_PATH)/crypto/x509/x509_def.c

+ $(OPENSSL_PATH)/crypto/x509/x509_err.c

+ $(OPENSSL_PATH)/crypto/x509/x509_ext.c

+ $(OPENSSL_PATH)/crypto/x509/x509_lu.c

+ $(OPENSSL_PATH)/crypto/x509/x509_meth.c

+ $(OPENSSL_PATH)/crypto/x509/x509_obj.c

+ $(OPENSSL_PATH)/crypto/x509/x509_r2x.c

+ $(OPENSSL_PATH)/crypto/x509/x509_req.c

+ $(OPENSSL_PATH)/crypto/x509/x509_set.c

+ $(OPENSSL_PATH)/crypto/x509/x509_trs.c

+ $(OPENSSL_PATH)/crypto/x509/x509_txt.c

+ $(OPENSSL_PATH)/crypto/x509/x509_v3.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vfy.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vpm.c

+ $(OPENSSL_PATH)/crypto/x509/x509cset.c

+ $(OPENSSL_PATH)/crypto/x509/x509name.c

+ $(OPENSSL_PATH)/crypto/x509/x509rset.c

+ $(OPENSSL_PATH)/crypto/x509/x509spki.c

+ $(OPENSSL_PATH)/crypto/x509/x509type.c

+ $(OPENSSL_PATH)/crypto/x509/x_all.c

+ $(OPENSSL_PATH)/crypto/x509/x_attrib.c

+ $(OPENSSL_PATH)/crypto/x509/x_crl.c

+ $(OPENSSL_PATH)/crypto/x509/x_exten.c

+ $(OPENSSL_PATH)/crypto/x509/x_name.c

+ $(OPENSSL_PATH)/crypto/x509/x_pubkey.c

+ $(OPENSSL_PATH)/crypto/x509/x_req.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509a.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_map.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_node.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_alt.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_conf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_crld.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_enum.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_extku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_genn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_info.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_int.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pci.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_prn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_purp.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_skey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_tlsf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3err.c

+ $(OPENSSL_PATH)/crypto/arm_arch.h

+ $(OPENSSL_PATH)/crypto/mips_arch.h

+ $(OPENSSL_PATH)/crypto/ppc_arch.h

+ $(OPENSSL_PATH)/crypto/s390x_arch.h

+ $(OPENSSL_PATH)/crypto/sparc_arch.h

+ $(OPENSSL_PATH)/crypto/vms_rms.h

+ $(OPENSSL_PATH)/crypto/aes/aes_local.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_local.h

+ $(OPENSSL_PATH)/crypto/asn1/charmap.h

+ $(OPENSSL_PATH)/crypto/asn1/standard_methods.h

+ $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h

+ $(OPENSSL_PATH)/crypto/async/async_local.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.h

+ $(OPENSSL_PATH)/crypto/bio/bio_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.h

+ $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h

+ $(OPENSSL_PATH)/crypto/comp/comp_local.h

+ $(OPENSSL_PATH)/crypto/conf/conf_def.h

+ $(OPENSSL_PATH)/crypto/conf/conf_local.h

+ $(OPENSSL_PATH)/crypto/dh/dh_local.h

+ $(OPENSSL_PATH)/crypto/dso/dso_local.h

+ $(OPENSSL_PATH)/crypto/evp/evp_local.h

+ $(OPENSSL_PATH)/crypto/hmac/hmac_local.h

+ $(OPENSSL_PATH)/crypto/lhash/lhash_local.h

+ $(OPENSSL_PATH)/crypto/md5/md5_local.h

+ $(OPENSSL_PATH)/crypto/modes/modes_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.h

+ $(OPENSSL_PATH)/crypto/objects/obj_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.h

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h

+ $(OPENSSL_PATH)/crypto/rand/rand_local.h

+ $(OPENSSL_PATH)/crypto/rsa/rsa_local.h

+ $(OPENSSL_PATH)/crypto/sha/sha_local.h

+ $(OPENSSL_PATH)/crypto/siphash/siphash_local.h

+ $(OPENSSL_PATH)/crypto/sm3/sm3_local.h

+ $(OPENSSL_PATH)/crypto/store/store_local.h

+ $(OPENSSL_PATH)/crypto/ui/ui_local.h

+ $(OPENSSL_PATH)/crypto/x509/x509_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h

+ $(OPENSSL_PATH)/ssl/bio_ssl.c

+ $(OPENSSL_PATH)/ssl/d1_lib.c

+ $(OPENSSL_PATH)/ssl/d1_msg.c

+ $(OPENSSL_PATH)/ssl/d1_srtp.c

+ $(OPENSSL_PATH)/ssl/methods.c

+ $(OPENSSL_PATH)/ssl/packet.c

+ $(OPENSSL_PATH)/ssl/pqueue.c

+ $(OPENSSL_PATH)/ssl/record/dtls1_bitmap.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_d1.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_s3.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_buffer.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record_tls13.c

+ $(OPENSSL_PATH)/ssl/s3_cbc.c

+ $(OPENSSL_PATH)/ssl/s3_enc.c

+ $(OPENSSL_PATH)/ssl/s3_lib.c

+ $(OPENSSL_PATH)/ssl/s3_msg.c

+ $(OPENSSL_PATH)/ssl/ssl_asn1.c

+ $(OPENSSL_PATH)/ssl/ssl_cert.c

+ $(OPENSSL_PATH)/ssl/ssl_ciph.c

+ $(OPENSSL_PATH)/ssl/ssl_conf.c

+ $(OPENSSL_PATH)/ssl/ssl_err.c

+ $(OPENSSL_PATH)/ssl/ssl_init.c

+ $(OPENSSL_PATH)/ssl/ssl_lib.c

+ $(OPENSSL_PATH)/ssl/ssl_mcnf.c

+ $(OPENSSL_PATH)/ssl/ssl_rsa.c

+ $(OPENSSL_PATH)/ssl/ssl_sess.c

+ $(OPENSSL_PATH)/ssl/ssl_stat.c

+ $(OPENSSL_PATH)/ssl/ssl_txt.c

+ $(OPENSSL_PATH)/ssl/ssl_utst.c

+ $(OPENSSL_PATH)/ssl/statem/extensions.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_cust.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_srvr.c

+ $(OPENSSL_PATH)/ssl/statem/statem.c

+ $(OPENSSL_PATH)/ssl/statem/statem_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/statem_dtls.c

+ $(OPENSSL_PATH)/ssl/statem/statem_lib.c

+ $(OPENSSL_PATH)/ssl/statem/statem_srvr.c

+ $(OPENSSL_PATH)/ssl/t1_enc.c

+ $(OPENSSL_PATH)/ssl/t1_lib.c

+ $(OPENSSL_PATH)/ssl/t1_trce.c

+ $(OPENSSL_PATH)/ssl/tls13_enc.c

+ $(OPENSSL_PATH)/ssl/tls_srp.c

+ $(OPENSSL_PATH)/ssl/packet_local.h

+ $(OPENSSL_PATH)/ssl/ssl_cert_table.h

+ $(OPENSSL_PATH)/ssl/ssl_local.h

+ $(OPENSSL_PATH)/ssl/record/record.h

+ $(OPENSSL_PATH)/ssl/record/record_local.h

+ $(OPENSSL_PATH)/ssl/statem/statem.h

+ $(OPENSSL_PATH)/ssl/statem/statem_local.h

+# Autogenerated files list ends here

+ buildinf.h

+ rand_pool_noise.h

+ ossl_store.c

+ rand_pool.c

+

+[Sources.X64]

+ rand_pool_noise_tsc.c

+ ApiHooks.c

+

+[Packages]

+ MdePkg/MdePkg.dec

+ CryptoPkg/CryptoPkg.dec

+

+[LibraryClasses]

+ BaseLib

+ DebugLib

+ TimerLib

+ PrintLib

+

+[BuildOptions]

+ #

+ # Disables the following Visual Studio compiler warnings brought by
openssl
source,

+ # so we do not break the build with /WX option:

+ # C4090: 'function' : different 'const' qualifiers

+ # C4132: 'object' : const object should be initialized (tls13_enc.c)

+ # C4210: nonstandard extension used: function given file scope

+ # C4244: conversion from type1 to type2, possible loss of data

+ # C4245: conversion from type1 to type2, signed/unsigned mismatch

+ # C4267: conversion from size_t to type, possible loss of data

+ # C4306: 'identifier' : conversion from 'type1' to 'type2' of
greater
size

+ # C4310: cast truncates constant value

+ # C4389: 'operator' : signed/unsigned mismatch (xxxx)

+ # C4700: uninitialized local variable 'name' used. (conf_sap.c(71))

+ # C4702: unreachable code

+ # C4706: assignment within conditional expression

+ # C4819: The file contains a character that cannot be represented in
the
current code page

+ #

+ MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /wd4090 /wd4132 /wd4210
/wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702
/wd4706 /wd4819

+

+ INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /w

+

+ #

+ # Suppress the following build warnings in openssl so we don't break
the
build
with -Werror

+ # -Werror=maybe-uninitialized: there exist some other paths for
which
the
variable is not initialized.

+ # -Werror=format: Check calls to printf and scanf, etc., to make
sure
that the
arguments supplied have

+ # types appropriate to the format string specified.

+ # -Werror=unused-but-set-variable: Warn whenever a local variable is
assigned to, but otherwise unused (aside from its declaration).

+ #

+ GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS)
$(OPENSSL_FLAGS_CONFIG) -Wno-error=maybe-uninitialized -Wno-
error=format -Wno-format -Wno-error=unused-but-set-variable -
DNO_MSABI_VA_FUNCS

+

+ # suppress the following warnings in openssl so we don't break the
build
with
warnings-as-errors:

+ # 1295: Deprecated declaration <entity> - give arg types

+ # 550: <entity> was set but never used

+ # 1293: assignment in condition

+ # 111: statement is unreachable (invariably "break;" after "return
X;"
in case
statement)

+ # 68: integer conversion resulted in a change of sign ("if (Status
==
-1)")

+ # 177: <entity> was declared but never referenced

+ # 223: function <entity> declared implicitly

+ # 144: a value of type <type> cannot be used to initialize an entity
of
type
<type>

+ # 513: a value of type <type> cannot be assigned to an entity of type
<type>

+ # 188: enumerated type mixed with another type (i.e. passing an
integer
as an
enum without a cast)

+ # 1296: Extended constant initialiser used

+ # 128: loop is not reachable - may be emitted inappropriately if code
follows
a conditional return

+ # from the function that evaluates to true at compile time

+ # 546: transfer of control bypasses initialization - may be emitted
inappropriately if the uninitialized

+ # variable is never referenced after the jump

+ # 1: ignore "#1-D: last line of file ends without a newline"

+ # 3017: <entity> may be used before being set (NOTE: This was fixed in
OpenSSL 1.1 HEAD with

+ # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be
dropped then.)

+ XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) -w -std=c99 -Wno-
error=uninitialized

diff --git a/CryptoPkg/Library/Include/openssl/opensslconf.h
b/CryptoPkg/Library/Include/openssl/opensslconf.h
index 3a2544ea5c..e8f73c4d10 100644
--- a/CryptoPkg/Library/Include/openssl/opensslconf.h
+++ b/CryptoPkg/Library/Include/openssl/opensslconf.h
@@ -112,9 +112,6 @@ extern "C" {
#ifndef OPENSSL_NO_ASAN

# define OPENSSL_NO_ASAN

#endif

-#ifndef OPENSSL_NO_ASM

-# define OPENSSL_NO_ASM

-#endif

#ifndef OPENSSL_NO_ASYNC

# define OPENSSL_NO_ASYNC

#endif

diff --git a/CryptoPkg/Library/OpensslLib/ApiHooks.c
b/CryptoPkg/Library/OpensslLib/ApiHooks.c
new file mode 100644
index 0000000000..58cff16838
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/ApiHooks.c
@@ -0,0 +1,18 @@
+/** @file

+ OpenSSL Library API hooks.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+VOID *

+__imp_RtlVirtualUnwind (

+ VOID * Args

+ )

+{

+ return NULL;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
new file mode 100644
index 0000000000..ef20d2b84e
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
@@ -0,0 +1,34 @@
+/** @file

+ Constructor to initialize CPUID data for OpenSSL assembly operations.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+extern void OPENSSL_cpuid_setup (void);

+

+/**

+ Constructor routine for OpensslLib.

+

+ The constructor calls an internal OpenSSL function which fetches a
local
copy

+ of the hardware capability flags, used to enable native crypto
instructions.

+

+ @param None

+

+ @retval EFI_SUCCESS The construction succeeded.

+

+**/

+EFI_STATUS

+EFIAPI

+OpensslLibConstructor (

+ VOID

+ )

+{

+ OPENSSL_cpuid_setup ();

+

+ return EFI_SUCCESS;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl
b/CryptoPkg/Library/OpensslLib/process_files.pl
index 57ce195394..472f59bc8e 100755
--- a/CryptoPkg/Library/OpensslLib/process_files.pl
+++ b/CryptoPkg/Library/OpensslLib/process_files.pl
@@ -9,9 +9,63 @@
# do not need to do this, since the results are stored in the EDK2

# git repository for them.

#

+# Due to the script wrapping required to process the OpenSSL

+# configuration data, each native architecture must be processed

+# individually by the maintainer (in addition to the standard version):

+# ./process_files.pl

+# ./process_files.pl X64

+# ./process_files.pl [Arch]

+

use strict;

use Cwd;

use File::Copy;

+use File::Basename;

+use File::Path qw(make_path remove_tree);

+use Text::Tabs;

+

+#

+# OpenSSL perlasm generator script does not transfer the copyright
header

+#

+sub copy_license_header

+{

+ my @args = split / /, shift; #Separate args by spaces

+ my $source = $args[1]; #Source file is second (after
"perl")

+ my $target = pop @args; #Target file is always last

+ chop ($target); #Remove newline char

+

+ my $temp_file_name = "license.tmp";

+ open (my $source_file, "<" . $source) || die $source;

+ open (my $target_file, "<" . $target) || die $target;

+ open (my $temp_file, ">" . $temp_file_name) || die $temp_file_name;

+

+ #Add "generated file" warning

+ $source =~ s/^..//; #Remove leading "./"

+ print ($temp_file "; WARNING: do not edit!\r\n");

+ print ($temp_file "; Generated from $source\r\n");

+ print ($temp_file ";\r\n");

+

+ #Copy source file header to temp file

+ while (my $line = <$source_file>) {

+ next if ($line =~ /#!/); #Ignore shebang line

+ $line =~ s/#/;/; #Fix comment character for assembly

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace, fixup
line
endings

+ print ($temp_file $line);

+ last if ($line =~ /http/); #Last line of copyright header
contains a web link

+ }

+ print ($temp_file "\r\n");

+ #Retrieve generated assembly contents

+ while (my $line = <$target_file>) {

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace, fixup
line
endings

+ print ($temp_file expand ($line)); #expand() replaces tabs with
spaces

+ }

+

+ close ($source_file);

+ close ($target_file);

+ close ($temp_file);

+

+ move ($temp_file_name, $target) ||

+ die "Cannot replace \"" . $target . "\"!";

+}



#

# Find the openssl directory name for use lib. We have to do this

@@ -21,10 +75,41 @@ use File::Copy;
#

my $inf_file;

my $OPENSSL_PATH;

+my $uefi_config;

+my $extension;

+my $arch;

my @inf;



BEGIN {

$inf_file = "OpensslLib.inf";

+ $uefi_config = "UEFI";

+ $arch = shift;

+

+ if (defined $arch) {

+ if (uc ($arch) eq "X64") {

+ $arch = "X64";

+ $inf_file = "OpensslLibX64.inf";

+ $uefi_config = "UEFI-x86_64";

+ $extension = "nasm";

+ } else {

+ die "Unsupported architecture \"" . $arch . "\"!";

+ }

+ if ($extension eq "nasm") {

+ if (`nasm -v 2>&1`) {

+ #Presence of nasm executable will trigger inclusion of
AVX
instructions

+ die "\nCannot run assembly generators with NASM in
path!\n\n";

+ }

+ }

+

+ # Prepare assembly folder

+ if (-d $arch) {

+ remove_tree ($arch, {safe => 1}) ||

+ die "Cannot clean assembly folder \"" . $arch . "\"!";

+ } else {

+ mkdir $arch ||

+ die "Cannot create assembly folder \"" . $arch . "\"!";

+ }

+ }



# Read the contents of the inf file

open( FD, "<" . $inf_file ) ||

@@ -47,9 +132,9 @@ BEGIN {
# Configure UEFI

system(

"./Configure",

- "UEFI",

+ "--config=../uefi-asm.conf",

+ "$uefi_config",

"no-afalgeng",

- "no-asm",

"no-async",

"no-autoerrinit",

"no-autoload-config",

@@ -129,23 +214,53 @@ BEGIN {
# Retrieve file lists from OpenSSL configdata

#

use configdata qw/%unified_info/;

+use configdata qw/%config/;

+use configdata qw/%target/;

+

+#

+# Collect build flags from configdata

+#

+my $flags = "";

+foreach my $f (@{$config{lib_defines}}) {

+ $flags .= " -D$f";

+}



my @cryptofilelist = ();

my @sslfilelist = ();

+my @asmfilelist = ();

+my @asmbuild = ();

foreach my $product ((@{$unified_info{libraries}},

@{$unified_info{engines}})) {

foreach my $o (@{$unified_info{sources}->{$product}}) {

foreach my $s (@{$unified_info{sources}->{$o}}) {

- next if ($unified_info{generate}->{$s});

- next if $s =~ "crypto/bio/b_print.c";

-

# No need to add unused files in UEFI.

# So it can reduce porting time, compile time, library size.

+ next if $s =~ "crypto/bio/b_print.c";

next if $s =~ "crypto/rand/randfile.c";

next if $s =~ "crypto/store/";

next if $s =~ "crypto/err/err_all.c";

next if $s =~ "crypto/aes/aes_ecb.c";



+ if ($unified_info{generate}->{$s}) {

+ if (defined $arch) {

+ my $buildstring = "perl";

+ foreach my $arg (@{$unified_info{generate}->{$s}}) {

+ if ($arg =~ ".pl") {

+ $buildstring .= " ./openssl/$arg";

+ } elsif ($arg =~ "PERLASM_SCHEME") {

+ $buildstring .= " $target{perlasm_scheme}";

+ } elsif ($arg =~ "LIB_CFLAGS") {

+ $buildstring .= "$flags";

+ }

+ }

+ ($s, my $path, undef) = fileparse($s, qr/\.[^.]*/);

+ $buildstring .= " ./$arch/$path$s.$extension";

+ make_path ("./$arch/$path");

+ push @asmbuild, "$buildstring\n";

+ push @asmfilelist, " $arch/$path$s.$extension\r\n";

+ }

+ next;

+ }

if ($product =~ "libssl") {

push @sslfilelist, ' $(OPENSSL_PATH)/' . $s . "\r\n";

next;

@@ -183,15 +298,31 @@ foreach (@headers){
}





+#

+# Generate assembly files

+#

+if (@asmbuild) {

+ print "\n--> Generating assembly files ... ";

+ foreach my $buildstring (@asmbuild) {

+ system ("$buildstring");

+ copy_license_header ($buildstring);

+ }

+ print "Done!";

+}

+

#

# Update OpensslLib.inf with autogenerated file list

#

my @new_inf = ();

my $subbing = 0;

-print "\n--> Updating OpensslLib.inf ... ";

+print "\n--> Updating $inf_file ... ";

foreach (@inf) {

+ if ($_ =~ "DEFINE OPENSSL_FLAGS_CONFIG") {

+ push @new_inf, " DEFINE OPENSSL_FLAGS_CONFIG =" . $flags .
"\r\n";

+ next;

+ }

if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist, @sslfilelist;

+ push @new_inf, $_, @asmfilelist, @cryptofilelist, @sslfilelist;

$subbing = 1;

next;

}

@@ -216,49 +347,51 @@ rename( $new_inf_file, $inf_file ) ||
die "rename $inf_file";

print "Done!";



-#

-# Update OpensslLibCrypto.inf with auto-generated file list (no libssl)

-#

-$inf_file = "OpensslLibCrypto.inf";

-

-# Read the contents of the inf file

-@inf = ();

-@new_inf = ();

-open( FD, "<" . $inf_file ) ||

- die "Cannot open \"" . $inf_file . "\"!";

-@inf = (<FD>);

-close(FD) ||

- die "Cannot close \"" . $inf_file . "\"!";

+if (!defined $arch) {

+ #

+ # Update OpensslLibCrypto.inf with auto-generated file list (no
libssl)

+ #

+ $inf_file = "OpensslLibCrypto.inf";



-$subbing = 0;

-print "\n--> Updating OpensslLibCrypto.inf ... ";

-foreach (@inf) {

- if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist;

- $subbing = 1;

- next;

- }

- if ( $_ =~ "# Autogenerated files list ends here" ) {

- push @new_inf, $_;

- $subbing = 0;

- next;

+ # Read the contents of the inf file

+ @inf = ();

+ @new_inf = ();

+ open( FD, "<" . $inf_file ) ||

+ die "Cannot open \"" . $inf_file . "\"!";

+ @inf = (<FD>);

+ close(FD) ||

+ die "Cannot close \"" . $inf_file . "\"!";

+

+ $subbing = 0;

+ print "\n--> Updating OpensslLibCrypto.inf ... ";

+ foreach (@inf) {

+ if ( $_ =~ "# Autogenerated files list starts here" ) {

+ push @new_inf, $_, @cryptofilelist;

+ $subbing = 1;

+ next;

+ }

+ if ( $_ =~ "# Autogenerated files list ends here" ) {

+ push @new_inf, $_;

+ $subbing = 0;

+ next;

+ }

+

+ push @new_inf, $_

+ unless ($subbing);

}



- push @new_inf, $_

- unless ($subbing);

+ $new_inf_file = $inf_file . ".new";

+ open( FD, ">" . $new_inf_file ) ||

+ die $new_inf_file;

+ print( FD @new_inf ) ||

+ die $new_inf_file;

+ close(FD) ||

+ die $new_inf_file;

+ rename( $new_inf_file, $inf_file ) ||

+ die "rename $inf_file";

+ print "Done!";

}



-$new_inf_file = $inf_file . ".new";

-open( FD, ">" . $new_inf_file ) ||

- die $new_inf_file;

-print( FD @new_inf ) ||

- die $new_inf_file;

-close(FD) ||

- die $new_inf_file;

-rename( $new_inf_file, $inf_file ) ||

- die "rename $inf_file";

-print "Done!";

-

#

# Copy opensslconf.h and dso_conf.h generated from OpenSSL Configuration

#

diff --git a/CryptoPkg/Library/OpensslLib/uefi-asm.conf
b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
new file mode 100644
index 0000000000..55eedbf3ba
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
@@ -0,0 +1,15 @@
+## -*- mode: perl; -*-

+## UEFI assembly openssl configuration targets.

+

+my %targets = (

+#### UEFI

+ "UEFI-x86_64" => {

+ perlasm_scheme => "nasm",

+ # inherit_from => [ "UEFI", asm("x86_64_asm") ],

+ inherit_from => [ "UEFI" ],

+ cpuid_asm_src => "x86_64cpuid.s",

+ aes_asm_src => "aes_core.c aes_cbc.c vpaes-x86_64.s aesni-
x86_64.s
aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",

+ sha1_asm_src => "sha1-x86_64.s sha256-x86_64.s sha512-
x86_64.s
sha1-mb-x86_64.s sha256-mb-x86_64.s",

+ modes_asm_src => "ghash-x86_64.s",

+ },

+);

--
2.28.0.windows.1


Yao, Jiewen
 

Below:

-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 25, 2020 5:26 AM
To: devel@edk2.groups.io; Zurcher, Christopher J
<christopher.j.zurcher@...>; Yao, Jiewen <jiewen.yao@...>
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX <xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

1) I have confirmed that the ApiHooks.c file is still required even without the AVX
instructions included. The x86_64 assembly files in OpenSSL set a flag called
$win64 and automatically include calls to the RtlVirtualUnwind function if NASM
is selected as the assembler scheme.

https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-
rtlvirtualunwind

I have submitted an issue against OpenSSL since I don't think using the NASM
assembler should force the inclusion of Windows-specific API hooks, but that
change cannot be made in OpenSSL 1.1.1 and we will have to wait for OpenSSL 3
or later to remove the stub function.

https://github.com/openssl/openssl/issues/12712
[Jiewen] Thanks.

2) So far I have only built with VS.
[Jiewen] I think we need support build with GCC and LLVM, and with X64.


3) The X64 SHA256 implementation was successfully exercised across a large
number of devices in a production environment as a verification step in a multi-
GB data transfer scenario.
[Jiewen] Since you also add other sha (sha1, sha512) and aesni, I think those need unit test for them too.


Thanks,
Christopher Zurcher

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zurcher,
Christopher J
Sent: Tuesday, August 18, 2020 15:50
To: Yao, Jiewen <jiewen.yao@...>; devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: Re: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

After further review, the ApiHooks.c file may no longer be needed since we
are no longer including the AVX instructions. I will look over the
dependencies and send a new patch set if I can eliminate the API hooks file.

Thanks,
Christopher Zurcher

-----Original Message-----
From: Yao, Jiewen <jiewen.yao@...>
Sent: Thursday, August 13, 2020 08:04
To: Zurcher, Christopher J <christopher.j.zurcher@...>;
devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native instruction
support for X64

Hi Christopher
Thanks.

1) Would you please help me understand more on "ApiHooks.c contains a
stub
function for a Windows API call" ?
Why we need this?
If it is compiler specific in openssl, should we submit patch to openssl to
exclude this with OPENSSL_SYS_UEFI? That should be a cleaner solution for
UEFI.

2) Would you please describe what compiler you have tried? VS? GCC? LLVM?

3) Would you please describe what unit test you have done?

Thank you
Yao Jiewen


-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 4, 2020 8:24 AM
To: devel@edk2.groups.io
Cc: Yao, Jiewen <jiewen.yao@...>; Wang, Jian J
<jian.j.wang@...>;
Lu, XiaoyuX <xiaoyux.lu@...>; Ard Biesheuvel
<ard.biesheuvel@...>
Subject: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native instruction
support
for X64

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2507

Adding OpensslLibX64.inf and modifying process_files.pl to process this
file and generate the necessary assembly files.
ApiHooks.c contains a stub function for a Windows API call.
uefi-asm.conf contains the limited assembly configurations for OpenSSL.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyux.lu@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Christopher J Zurcher <christopher.j.zurcher@...>
---
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibX64.inf | 656
++++++++++++++++++++
CryptoPkg/Library/Include/openssl/opensslconf.h | 3 -
CryptoPkg/Library/OpensslLib/ApiHooks.c | 18 +
CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c | 34 +
CryptoPkg/Library/OpensslLib/process_files.pl | 223 +++++--
CryptoPkg/Library/OpensslLib/uefi-asm.conf | 15 +
8 files changed, 903 insertions(+), 50 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index dbbe5386a1..bd62d86936 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 616ccd9f62..2b7324a990 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
new file mode 100644
index 0000000000..825eea0254
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
@@ -0,0 +1,656 @@
+## @file

+# This module provides OpenSSL Library implementation.

+#

+# Copyright (c) 2010 - 2020, Intel Corporation. All rights
reserved.<BR>

+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+ INF_VERSION = 0x00010005

+ BASE_NAME = OpensslLibX64

+ MODULE_UNI_FILE = OpensslLib.uni

+ FILE_GUID = 18125E50-0117-4DD0-BE54-4784AD995FEF

+ MODULE_TYPE = BASE

+ VERSION_STRING = 1.0

+ LIBRARY_CLASS = OpensslLib

+ DEFINE OPENSSL_PATH = openssl

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS_CONFIG = -DOPENSSL_CPUID_OBJ -
DSHA1_ASM -
DSHA256_ASM -DSHA512_ASM -DAESNI_ASM -DVPAES_ASM -
DGHASH_ASM

+ CONSTRUCTOR = OpensslLibConstructor

+

+#

+# VALID_ARCHITECTURES = X64

+#

+

+[Sources]

+ OpensslLibConstructor.c

+ $(OPENSSL_PATH)/e_os.h

+ $(OPENSSL_PATH)/ms/uplink.h

+# Autogenerated files list starts here

+ X64/crypto/aes/aesni-mb-x86_64.nasm

+ X64/crypto/aes/aesni-sha1-x86_64.nasm

+ X64/crypto/aes/aesni-sha256-x86_64.nasm

+ X64/crypto/aes/aesni-x86_64.nasm

+ X64/crypto/aes/vpaes-x86_64.nasm

+ X64/crypto/modes/ghash-x86_64.nasm

+ X64/crypto/sha/sha1-mb-x86_64.nasm

+ X64/crypto/sha/sha1-x86_64.nasm

+ X64/crypto/sha/sha256-mb-x86_64.nasm

+ X64/crypto/sha/sha256-x86_64.nasm

+ X64/crypto/sha/sha512-x86_64.nasm

+ X64/crypto/x86_64cpuid.nasm

+ $(OPENSSL_PATH)/crypto/aes/aes_cbc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_cfb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_core.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ige.c

+ $(OPENSSL_PATH)/crypto/aes/aes_misc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ofb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_wrap.c

+ $(OPENSSL_PATH)/crypto/aria/aria.c

+ $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_digest.c

+ $(OPENSSL_PATH)/crypto/asn1/a_dup.c

+ $(OPENSSL_PATH)/crypto/asn1/a_gentm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_int.c

+ $(OPENSSL_PATH)/crypto/asn1/a_mbstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_object.c

+ $(OPENSSL_PATH)/crypto/asn1/a_octet.c

+ $(OPENSSL_PATH)/crypto/asn1/a_print.c

+ $(OPENSSL_PATH)/crypto/asn1/a_sign.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strex.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strnid.c

+ $(OPENSSL_PATH)/crypto/asn1/a_time.c

+ $(OPENSSL_PATH)/crypto/asn1/a_type.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utctm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utf8.c

+ $(OPENSSL_PATH)/crypto/asn1/a_verify.c

+ $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_err.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_par.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mime.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_moid.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mstbl.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_pack.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/evp_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/f_int.c

+ $(OPENSSL_PATH)/crypto/asn1/f_string.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/n_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/nsseq.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbe.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_scrypt.c

+ $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_bitst.c

+ $(OPENSSL_PATH)/crypto/asn1/t_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_dec.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_enc.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_fre.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_new.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_scn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c

+ $(OPENSSL_PATH)/crypto/asn1/x_algor.c

+ $(OPENSSL_PATH)/crypto/asn1/x_bignum.c

+ $(OPENSSL_PATH)/crypto/asn1/x_info.c

+ $(OPENSSL_PATH)/crypto/asn1/x_int64.c

+ $(OPENSSL_PATH)/crypto/asn1/x_long.c

+ $(OPENSSL_PATH)/crypto/asn1/x_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/x_sig.c

+ $(OPENSSL_PATH)/crypto/asn1/x_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/x_val.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.c

+ $(OPENSSL_PATH)/crypto/async/async.c

+ $(OPENSSL_PATH)/crypto/async/async_err.c

+ $(OPENSSL_PATH)/crypto/async/async_wait.c

+ $(OPENSSL_PATH)/crypto/bio/b_addr.c

+ $(OPENSSL_PATH)/crypto/bio/b_dump.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock2.c

+ $(OPENSSL_PATH)/crypto/bio/bf_buff.c

+ $(OPENSSL_PATH)/crypto/bio/bf_lbuf.c

+ $(OPENSSL_PATH)/crypto/bio/bf_nbio.c

+ $(OPENSSL_PATH)/crypto/bio/bf_null.c

+ $(OPENSSL_PATH)/crypto/bio/bio_cb.c

+ $(OPENSSL_PATH)/crypto/bio/bio_err.c

+ $(OPENSSL_PATH)/crypto/bio/bio_lib.c

+ $(OPENSSL_PATH)/crypto/bio/bio_meth.c

+ $(OPENSSL_PATH)/crypto/bio/bss_acpt.c

+ $(OPENSSL_PATH)/crypto/bio/bss_bio.c

+ $(OPENSSL_PATH)/crypto/bio/bss_conn.c

+ $(OPENSSL_PATH)/crypto/bio/bss_dgram.c

+ $(OPENSSL_PATH)/crypto/bio/bss_fd.c

+ $(OPENSSL_PATH)/crypto/bio/bss_file.c

+ $(OPENSSL_PATH)/crypto/bio/bss_log.c

+ $(OPENSSL_PATH)/crypto/bio/bss_mem.c

+ $(OPENSSL_PATH)/crypto/bio/bss_null.c

+ $(OPENSSL_PATH)/crypto/bio/bss_sock.c

+ $(OPENSSL_PATH)/crypto/bn/bn_add.c

+ $(OPENSSL_PATH)/crypto/bn/bn_asm.c

+ $(OPENSSL_PATH)/crypto/bn/bn_blind.c

+ $(OPENSSL_PATH)/crypto/bn/bn_const.c

+ $(OPENSSL_PATH)/crypto/bn/bn_ctx.c

+ $(OPENSSL_PATH)/crypto/bn/bn_depr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_dh.c

+ $(OPENSSL_PATH)/crypto/bn/bn_div.c

+ $(OPENSSL_PATH)/crypto/bn/bn_err.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp2.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gcd.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gf2m.c

+ $(OPENSSL_PATH)/crypto/bn/bn_intern.c

+ $(OPENSSL_PATH)/crypto/bn/bn_kron.c

+ $(OPENSSL_PATH)/crypto/bn/bn_lib.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mod.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mont.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mpi.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mul.c

+ $(OPENSSL_PATH)/crypto/bn/bn_nist.c

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.c

+ $(OPENSSL_PATH)/crypto/bn/bn_print.c

+ $(OPENSSL_PATH)/crypto/bn/bn_rand.c

+ $(OPENSSL_PATH)/crypto/bn/bn_recp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_shift.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqrt.c

+ $(OPENSSL_PATH)/crypto/bn/bn_srp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_word.c

+ $(OPENSSL_PATH)/crypto/bn/bn_x931p.c

+ $(OPENSSL_PATH)/crypto/buffer/buf_err.c

+ $(OPENSSL_PATH)/crypto/buffer/buffer.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c

+ $(OPENSSL_PATH)/crypto/cmac/cmac.c

+ $(OPENSSL_PATH)/crypto/comp/c_zlib.c

+ $(OPENSSL_PATH)/crypto/comp/comp_err.c

+ $(OPENSSL_PATH)/crypto/comp/comp_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_api.c

+ $(OPENSSL_PATH)/crypto/conf/conf_def.c

+ $(OPENSSL_PATH)/crypto/conf/conf_err.c

+ $(OPENSSL_PATH)/crypto/conf/conf_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mall.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mod.c

+ $(OPENSSL_PATH)/crypto/conf/conf_sap.c

+ $(OPENSSL_PATH)/crypto/conf/conf_ssl.c

+ $(OPENSSL_PATH)/crypto/cpt_err.c

+ $(OPENSSL_PATH)/crypto/cryptlib.c

+ $(OPENSSL_PATH)/crypto/ctype.c

+ $(OPENSSL_PATH)/crypto/cversion.c

+ $(OPENSSL_PATH)/crypto/dh/dh_ameth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_asn1.c

+ $(OPENSSL_PATH)/crypto/dh/dh_check.c

+ $(OPENSSL_PATH)/crypto/dh/dh_depr.c

+ $(OPENSSL_PATH)/crypto/dh/dh_err.c

+ $(OPENSSL_PATH)/crypto/dh/dh_gen.c

+ $(OPENSSL_PATH)/crypto/dh/dh_kdf.c

+ $(OPENSSL_PATH)/crypto/dh/dh_key.c

+ $(OPENSSL_PATH)/crypto/dh/dh_lib.c

+ $(OPENSSL_PATH)/crypto/dh/dh_meth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_prn.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c

+ $(OPENSSL_PATH)/crypto/dso/dso_err.c

+ $(OPENSSL_PATH)/crypto/dso/dso_lib.c

+ $(OPENSSL_PATH)/crypto/dso/dso_openssl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_vms.c

+ $(OPENSSL_PATH)/crypto/dso/dso_win32.c

+ $(OPENSSL_PATH)/crypto/ebcdic.c

+ $(OPENSSL_PATH)/crypto/err/err.c

+ $(OPENSSL_PATH)/crypto/err/err_prn.c

+ $(OPENSSL_PATH)/crypto/evp/bio_b64.c

+ $(OPENSSL_PATH)/crypto/evp/bio_enc.c

+ $(OPENSSL_PATH)/crypto/evp/bio_md.c

+ $(OPENSSL_PATH)/crypto/evp/bio_ok.c

+ $(OPENSSL_PATH)/crypto/evp/c_allc.c

+ $(OPENSSL_PATH)/crypto/evp/c_alld.c

+ $(OPENSSL_PATH)/crypto/evp/cmeth_lib.c

+ $(OPENSSL_PATH)/crypto/evp/digest.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c

+ $(OPENSSL_PATH)/crypto/evp/e_aria.c

+ $(OPENSSL_PATH)/crypto/evp/e_bf.c

+ $(OPENSSL_PATH)/crypto/evp/e_camellia.c

+ $(OPENSSL_PATH)/crypto/evp/e_cast.c

+ $(OPENSSL_PATH)/crypto/evp/e_chacha20_poly1305.c

+ $(OPENSSL_PATH)/crypto/evp/e_des.c

+ $(OPENSSL_PATH)/crypto/evp/e_des3.c

+ $(OPENSSL_PATH)/crypto/evp/e_idea.c

+ $(OPENSSL_PATH)/crypto/evp/e_null.c

+ $(OPENSSL_PATH)/crypto/evp/e_old.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc2.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc5.c

+ $(OPENSSL_PATH)/crypto/evp/e_seed.c

+ $(OPENSSL_PATH)/crypto/evp/e_sm4.c

+ $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c

+ $(OPENSSL_PATH)/crypto/evp/encode.c

+ $(OPENSSL_PATH)/crypto/evp/evp_cnf.c

+ $(OPENSSL_PATH)/crypto/evp/evp_enc.c

+ $(OPENSSL_PATH)/crypto/evp/evp_err.c

+ $(OPENSSL_PATH)/crypto/evp/evp_key.c

+ $(OPENSSL_PATH)/crypto/evp/evp_lib.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pbe.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pkey.c

+ $(OPENSSL_PATH)/crypto/evp/m_md2.c

+ $(OPENSSL_PATH)/crypto/evp/m_md4.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_mdc2.c

+ $(OPENSSL_PATH)/crypto/evp/m_null.c

+ $(OPENSSL_PATH)/crypto/evp/m_ripemd.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha3.c

+ $(OPENSSL_PATH)/crypto/evp/m_sigver.c

+ $(OPENSSL_PATH)/crypto/evp/m_wp.c

+ $(OPENSSL_PATH)/crypto/evp/names.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c

+ $(OPENSSL_PATH)/crypto/evp/p_dec.c

+ $(OPENSSL_PATH)/crypto/evp/p_enc.c

+ $(OPENSSL_PATH)/crypto/evp/p_lib.c

+ $(OPENSSL_PATH)/crypto/evp/p_open.c

+ $(OPENSSL_PATH)/crypto/evp/p_seal.c

+ $(OPENSSL_PATH)/crypto/evp/p_sign.c

+ $(OPENSSL_PATH)/crypto/evp/p_verify.c

+ $(OPENSSL_PATH)/crypto/evp/pbe_scrypt.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c

+ $(OPENSSL_PATH)/crypto/ex_data.c

+ $(OPENSSL_PATH)/crypto/getenv.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c

+ $(OPENSSL_PATH)/crypto/hmac/hmac.c

+ $(OPENSSL_PATH)/crypto/init.c

+ $(OPENSSL_PATH)/crypto/kdf/hkdf.c

+ $(OPENSSL_PATH)/crypto/kdf/kdf_err.c

+ $(OPENSSL_PATH)/crypto/kdf/scrypt.c

+ $(OPENSSL_PATH)/crypto/kdf/tls1_prf.c

+ $(OPENSSL_PATH)/crypto/lhash/lh_stats.c

+ $(OPENSSL_PATH)/crypto/lhash/lhash.c

+ $(OPENSSL_PATH)/crypto/md5/md5_dgst.c

+ $(OPENSSL_PATH)/crypto/md5/md5_one.c

+ $(OPENSSL_PATH)/crypto/mem.c

+ $(OPENSSL_PATH)/crypto/mem_dbg.c

+ $(OPENSSL_PATH)/crypto/mem_sec.c

+ $(OPENSSL_PATH)/crypto/modes/cbc128.c

+ $(OPENSSL_PATH)/crypto/modes/ccm128.c

+ $(OPENSSL_PATH)/crypto/modes/cfb128.c

+ $(OPENSSL_PATH)/crypto/modes/ctr128.c

+ $(OPENSSL_PATH)/crypto/modes/cts128.c

+ $(OPENSSL_PATH)/crypto/modes/gcm128.c

+ $(OPENSSL_PATH)/crypto/modes/ocb128.c

+ $(OPENSSL_PATH)/crypto/modes/ofb128.c

+ $(OPENSSL_PATH)/crypto/modes/wrap128.c

+ $(OPENSSL_PATH)/crypto/modes/xts128.c

+ $(OPENSSL_PATH)/crypto/o_dir.c

+ $(OPENSSL_PATH)/crypto/o_fips.c

+ $(OPENSSL_PATH)/crypto/o_fopen.c

+ $(OPENSSL_PATH)/crypto/o_init.c

+ $(OPENSSL_PATH)/crypto/o_str.c

+ $(OPENSSL_PATH)/crypto/o_time.c

+ $(OPENSSL_PATH)/crypto/objects/o_names.c

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.c

+ $(OPENSSL_PATH)/crypto/objects/obj_err.c

+ $(OPENSSL_PATH)/crypto/objects/obj_lib.c

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c

+ $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c

+ $(OPENSSL_PATH)/crypto/pem/pem_all.c

+ $(OPENSSL_PATH)/crypto/pem/pem_err.c

+ $(OPENSSL_PATH)/crypto/pem/pem_info.c

+ $(OPENSSL_PATH)/crypto/pem/pem_lib.c

+ $(OPENSSL_PATH)/crypto/pem/pem_oth.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pk8.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pkey.c

+ $(OPENSSL_PATH)/crypto/pem/pem_sign.c

+ $(OPENSSL_PATH)/crypto/pem/pem_x509.c

+ $(OPENSSL_PATH)/crypto/pem/pem_xaux.c

+ $(OPENSSL_PATH)/crypto/pem/pvkfmt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_init.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_key.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_sbag.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c

+ $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_ctr.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_egd.c

+ $(OPENSSL_PATH)/crypto/rand/rand_err.c

+ $(OPENSSL_PATH)/crypto/rand/rand_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_unix.c

+ $(OPENSSL_PATH)/crypto/rand/rand_vms.c

+ $(OPENSSL_PATH)/crypto/rand/rand_win.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_chk.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_err.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_lib.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_meth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_mp.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_none.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ossl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_saos.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_sign.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c

+ $(OPENSSL_PATH)/crypto/sha/keccak1600.c

+ $(OPENSSL_PATH)/crypto/sha/sha1_one.c

+ $(OPENSSL_PATH)/crypto/sha/sha1dgst.c

+ $(OPENSSL_PATH)/crypto/sha/sha256.c

+ $(OPENSSL_PATH)/crypto/sha/sha512.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_ameth.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_pmeth.c

+ $(OPENSSL_PATH)/crypto/sm3/m_sm3.c

+ $(OPENSSL_PATH)/crypto/sm3/sm3.c

+ $(OPENSSL_PATH)/crypto/sm4/sm4.c

+ $(OPENSSL_PATH)/crypto/stack/stack.c

+ $(OPENSSL_PATH)/crypto/threads_none.c

+ $(OPENSSL_PATH)/crypto/threads_pthread.c

+ $(OPENSSL_PATH)/crypto/threads_win.c

+ $(OPENSSL_PATH)/crypto/txt_db/txt_db.c

+ $(OPENSSL_PATH)/crypto/ui/ui_err.c

+ $(OPENSSL_PATH)/crypto/ui/ui_lib.c

+ $(OPENSSL_PATH)/crypto/ui/ui_null.c

+ $(OPENSSL_PATH)/crypto/ui/ui_openssl.c

+ $(OPENSSL_PATH)/crypto/ui/ui_util.c

+ $(OPENSSL_PATH)/crypto/uid.c

+ $(OPENSSL_PATH)/crypto/x509/by_dir.c

+ $(OPENSSL_PATH)/crypto/x509/by_file.c

+ $(OPENSSL_PATH)/crypto/x509/t_crl.c

+ $(OPENSSL_PATH)/crypto/x509/t_req.c

+ $(OPENSSL_PATH)/crypto/x509/t_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x509_att.c

+ $(OPENSSL_PATH)/crypto/x509/x509_cmp.c

+ $(OPENSSL_PATH)/crypto/x509/x509_d2.c

+ $(OPENSSL_PATH)/crypto/x509/x509_def.c

+ $(OPENSSL_PATH)/crypto/x509/x509_err.c

+ $(OPENSSL_PATH)/crypto/x509/x509_ext.c

+ $(OPENSSL_PATH)/crypto/x509/x509_lu.c

+ $(OPENSSL_PATH)/crypto/x509/x509_meth.c

+ $(OPENSSL_PATH)/crypto/x509/x509_obj.c

+ $(OPENSSL_PATH)/crypto/x509/x509_r2x.c

+ $(OPENSSL_PATH)/crypto/x509/x509_req.c

+ $(OPENSSL_PATH)/crypto/x509/x509_set.c

+ $(OPENSSL_PATH)/crypto/x509/x509_trs.c

+ $(OPENSSL_PATH)/crypto/x509/x509_txt.c

+ $(OPENSSL_PATH)/crypto/x509/x509_v3.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vfy.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vpm.c

+ $(OPENSSL_PATH)/crypto/x509/x509cset.c

+ $(OPENSSL_PATH)/crypto/x509/x509name.c

+ $(OPENSSL_PATH)/crypto/x509/x509rset.c

+ $(OPENSSL_PATH)/crypto/x509/x509spki.c

+ $(OPENSSL_PATH)/crypto/x509/x509type.c

+ $(OPENSSL_PATH)/crypto/x509/x_all.c

+ $(OPENSSL_PATH)/crypto/x509/x_attrib.c

+ $(OPENSSL_PATH)/crypto/x509/x_crl.c

+ $(OPENSSL_PATH)/crypto/x509/x_exten.c

+ $(OPENSSL_PATH)/crypto/x509/x_name.c

+ $(OPENSSL_PATH)/crypto/x509/x_pubkey.c

+ $(OPENSSL_PATH)/crypto/x509/x_req.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509a.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_map.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_node.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_alt.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_conf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_crld.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_enum.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_extku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_genn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_info.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_int.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pci.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_prn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_purp.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_skey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_tlsf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3err.c

+ $(OPENSSL_PATH)/crypto/arm_arch.h

+ $(OPENSSL_PATH)/crypto/mips_arch.h

+ $(OPENSSL_PATH)/crypto/ppc_arch.h

+ $(OPENSSL_PATH)/crypto/s390x_arch.h

+ $(OPENSSL_PATH)/crypto/sparc_arch.h

+ $(OPENSSL_PATH)/crypto/vms_rms.h

+ $(OPENSSL_PATH)/crypto/aes/aes_local.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_local.h

+ $(OPENSSL_PATH)/crypto/asn1/charmap.h

+ $(OPENSSL_PATH)/crypto/asn1/standard_methods.h

+ $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h

+ $(OPENSSL_PATH)/crypto/async/async_local.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.h

+ $(OPENSSL_PATH)/crypto/bio/bio_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.h

+ $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h

+ $(OPENSSL_PATH)/crypto/comp/comp_local.h

+ $(OPENSSL_PATH)/crypto/conf/conf_def.h

+ $(OPENSSL_PATH)/crypto/conf/conf_local.h

+ $(OPENSSL_PATH)/crypto/dh/dh_local.h

+ $(OPENSSL_PATH)/crypto/dso/dso_local.h

+ $(OPENSSL_PATH)/crypto/evp/evp_local.h

+ $(OPENSSL_PATH)/crypto/hmac/hmac_local.h

+ $(OPENSSL_PATH)/crypto/lhash/lhash_local.h

+ $(OPENSSL_PATH)/crypto/md5/md5_local.h

+ $(OPENSSL_PATH)/crypto/modes/modes_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.h

+ $(OPENSSL_PATH)/crypto/objects/obj_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.h

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h

+ $(OPENSSL_PATH)/crypto/rand/rand_local.h

+ $(OPENSSL_PATH)/crypto/rsa/rsa_local.h

+ $(OPENSSL_PATH)/crypto/sha/sha_local.h

+ $(OPENSSL_PATH)/crypto/siphash/siphash_local.h

+ $(OPENSSL_PATH)/crypto/sm3/sm3_local.h

+ $(OPENSSL_PATH)/crypto/store/store_local.h

+ $(OPENSSL_PATH)/crypto/ui/ui_local.h

+ $(OPENSSL_PATH)/crypto/x509/x509_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h

+ $(OPENSSL_PATH)/ssl/bio_ssl.c

+ $(OPENSSL_PATH)/ssl/d1_lib.c

+ $(OPENSSL_PATH)/ssl/d1_msg.c

+ $(OPENSSL_PATH)/ssl/d1_srtp.c

+ $(OPENSSL_PATH)/ssl/methods.c

+ $(OPENSSL_PATH)/ssl/packet.c

+ $(OPENSSL_PATH)/ssl/pqueue.c

+ $(OPENSSL_PATH)/ssl/record/dtls1_bitmap.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_d1.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_s3.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_buffer.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record_tls13.c

+ $(OPENSSL_PATH)/ssl/s3_cbc.c

+ $(OPENSSL_PATH)/ssl/s3_enc.c

+ $(OPENSSL_PATH)/ssl/s3_lib.c

+ $(OPENSSL_PATH)/ssl/s3_msg.c

+ $(OPENSSL_PATH)/ssl/ssl_asn1.c

+ $(OPENSSL_PATH)/ssl/ssl_cert.c

+ $(OPENSSL_PATH)/ssl/ssl_ciph.c

+ $(OPENSSL_PATH)/ssl/ssl_conf.c

+ $(OPENSSL_PATH)/ssl/ssl_err.c

+ $(OPENSSL_PATH)/ssl/ssl_init.c

+ $(OPENSSL_PATH)/ssl/ssl_lib.c

+ $(OPENSSL_PATH)/ssl/ssl_mcnf.c

+ $(OPENSSL_PATH)/ssl/ssl_rsa.c

+ $(OPENSSL_PATH)/ssl/ssl_sess.c

+ $(OPENSSL_PATH)/ssl/ssl_stat.c

+ $(OPENSSL_PATH)/ssl/ssl_txt.c

+ $(OPENSSL_PATH)/ssl/ssl_utst.c

+ $(OPENSSL_PATH)/ssl/statem/extensions.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_cust.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_srvr.c

+ $(OPENSSL_PATH)/ssl/statem/statem.c

+ $(OPENSSL_PATH)/ssl/statem/statem_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/statem_dtls.c

+ $(OPENSSL_PATH)/ssl/statem/statem_lib.c

+ $(OPENSSL_PATH)/ssl/statem/statem_srvr.c

+ $(OPENSSL_PATH)/ssl/t1_enc.c

+ $(OPENSSL_PATH)/ssl/t1_lib.c

+ $(OPENSSL_PATH)/ssl/t1_trce.c

+ $(OPENSSL_PATH)/ssl/tls13_enc.c

+ $(OPENSSL_PATH)/ssl/tls_srp.c

+ $(OPENSSL_PATH)/ssl/packet_local.h

+ $(OPENSSL_PATH)/ssl/ssl_cert_table.h

+ $(OPENSSL_PATH)/ssl/ssl_local.h

+ $(OPENSSL_PATH)/ssl/record/record.h

+ $(OPENSSL_PATH)/ssl/record/record_local.h

+ $(OPENSSL_PATH)/ssl/statem/statem.h

+ $(OPENSSL_PATH)/ssl/statem/statem_local.h

+# Autogenerated files list ends here

+ buildinf.h

+ rand_pool_noise.h

+ ossl_store.c

+ rand_pool.c

+

+[Sources.X64]

+ rand_pool_noise_tsc.c

+ ApiHooks.c

+

+[Packages]

+ MdePkg/MdePkg.dec

+ CryptoPkg/CryptoPkg.dec

+

+[LibraryClasses]

+ BaseLib

+ DebugLib

+ TimerLib

+ PrintLib

+

+[BuildOptions]

+ #

+ # Disables the following Visual Studio compiler warnings brought by
openssl
source,

+ # so we do not break the build with /WX option:

+ # C4090: 'function' : different 'const' qualifiers

+ # C4132: 'object' : const object should be initialized (tls13_enc.c)

+ # C4210: nonstandard extension used: function given file scope

+ # C4244: conversion from type1 to type2, possible loss of data

+ # C4245: conversion from type1 to type2, signed/unsigned mismatch

+ # C4267: conversion from size_t to type, possible loss of data

+ # C4306: 'identifier' : conversion from 'type1' to 'type2' of
greater
size

+ # C4310: cast truncates constant value

+ # C4389: 'operator' : signed/unsigned mismatch (xxxx)

+ # C4700: uninitialized local variable 'name' used. (conf_sap.c(71))

+ # C4702: unreachable code

+ # C4706: assignment within conditional expression

+ # C4819: The file contains a character that cannot be represented in
the
current code page

+ #

+ MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /wd4090 /wd4132
/wd4210
/wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702
/wd4706 /wd4819

+

+ INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -
U__ICC
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /w

+

+ #

+ # Suppress the following build warnings in openssl so we don't break
the
build
with -Werror

+ # -Werror=maybe-uninitialized: there exist some other paths for
which
the
variable is not initialized.

+ # -Werror=format: Check calls to printf and scanf, etc., to make
sure
that the
arguments supplied have

+ # types appropriate to the format string specified.

+ # -Werror=unused-but-set-variable: Warn whenever a local variable is
assigned to, but otherwise unused (aside from its declaration).

+ #

+ GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS)
$(OPENSSL_FLAGS_CONFIG) -Wno-error=maybe-uninitialized -Wno-
error=format -Wno-format -Wno-error=unused-but-set-variable -
DNO_MSABI_VA_FUNCS

+

+ # suppress the following warnings in openssl so we don't break the
build
with
warnings-as-errors:

+ # 1295: Deprecated declaration <entity> - give arg types

+ # 550: <entity> was set but never used

+ # 1293: assignment in condition

+ # 111: statement is unreachable (invariably "break;" after "return
X;"
in case
statement)

+ # 68: integer conversion resulted in a change of sign ("if (Status
==
-1)")

+ # 177: <entity> was declared but never referenced

+ # 223: function <entity> declared implicitly

+ # 144: a value of type <type> cannot be used to initialize an entity
of
type
<type>

+ # 513: a value of type <type> cannot be assigned to an entity of type
<type>

+ # 188: enumerated type mixed with another type (i.e. passing an
integer
as an
enum without a cast)

+ # 1296: Extended constant initialiser used

+ # 128: loop is not reachable - may be emitted inappropriately if code
follows
a conditional return

+ # from the function that evaluates to true at compile time

+ # 546: transfer of control bypasses initialization - may be emitted
inappropriately if the uninitialized

+ # variable is never referenced after the jump

+ # 1: ignore "#1-D: last line of file ends without a newline"

+ # 3017: <entity> may be used before being set (NOTE: This was fixed in
OpenSSL 1.1 HEAD with

+ # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can
be
dropped then.)

+ XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) -w -std=c99 -Wno-
error=uninitialized

diff --git a/CryptoPkg/Library/Include/openssl/opensslconf.h
b/CryptoPkg/Library/Include/openssl/opensslconf.h
index 3a2544ea5c..e8f73c4d10 100644
--- a/CryptoPkg/Library/Include/openssl/opensslconf.h
+++ b/CryptoPkg/Library/Include/openssl/opensslconf.h
@@ -112,9 +112,6 @@ extern "C" {
#ifndef OPENSSL_NO_ASAN

# define OPENSSL_NO_ASAN

#endif

-#ifndef OPENSSL_NO_ASM

-# define OPENSSL_NO_ASM

-#endif

#ifndef OPENSSL_NO_ASYNC

# define OPENSSL_NO_ASYNC

#endif

diff --git a/CryptoPkg/Library/OpensslLib/ApiHooks.c
b/CryptoPkg/Library/OpensslLib/ApiHooks.c
new file mode 100644
index 0000000000..58cff16838
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/ApiHooks.c
@@ -0,0 +1,18 @@
+/** @file

+ OpenSSL Library API hooks.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+VOID *

+__imp_RtlVirtualUnwind (

+ VOID * Args

+ )

+{

+ return NULL;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
new file mode 100644
index 0000000000..ef20d2b84e
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
@@ -0,0 +1,34 @@
+/** @file

+ Constructor to initialize CPUID data for OpenSSL assembly operations.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+extern void OPENSSL_cpuid_setup (void);

+

+/**

+ Constructor routine for OpensslLib.

+

+ The constructor calls an internal OpenSSL function which fetches a
local
copy

+ of the hardware capability flags, used to enable native crypto
instructions.

+

+ @param None

+

+ @retval EFI_SUCCESS The construction succeeded.

+

+**/

+EFI_STATUS

+EFIAPI

+OpensslLibConstructor (

+ VOID

+ )

+{

+ OPENSSL_cpuid_setup ();

+

+ return EFI_SUCCESS;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl
b/CryptoPkg/Library/OpensslLib/process_files.pl
index 57ce195394..472f59bc8e 100755
--- a/CryptoPkg/Library/OpensslLib/process_files.pl
+++ b/CryptoPkg/Library/OpensslLib/process_files.pl
@@ -9,9 +9,63 @@
# do not need to do this, since the results are stored in the EDK2

# git repository for them.

#

+# Due to the script wrapping required to process the OpenSSL

+# configuration data, each native architecture must be processed

+# individually by the maintainer (in addition to the standard version):

+# ./process_files.pl

+# ./process_files.pl X64

+# ./process_files.pl [Arch]

+

use strict;

use Cwd;

use File::Copy;

+use File::Basename;

+use File::Path qw(make_path remove_tree);

+use Text::Tabs;

+

+#

+# OpenSSL perlasm generator script does not transfer the copyright
header

+#

+sub copy_license_header

+{

+ my @args = split / /, shift; #Separate args by spaces

+ my $source = $args[1]; #Source file is second (after
"perl")

+ my $target = pop @args; #Target file is always last

+ chop ($target); #Remove newline char

+

+ my $temp_file_name = "license.tmp";

+ open (my $source_file, "<" . $source) || die $source;

+ open (my $target_file, "<" . $target) || die $target;

+ open (my $temp_file, ">" . $temp_file_name) || die $temp_file_name;

+

+ #Add "generated file" warning

+ $source =~ s/^..//; #Remove leading "./"

+ print ($temp_file "; WARNING: do not edit!\r\n");

+ print ($temp_file "; Generated from $source\r\n");

+ print ($temp_file ";\r\n");

+

+ #Copy source file header to temp file

+ while (my $line = <$source_file>) {

+ next if ($line =~ /#!/); #Ignore shebang line

+ $line =~ s/#/;/; #Fix comment character for assembly

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace, fixup
line
endings

+ print ($temp_file $line);

+ last if ($line =~ /http/); #Last line of copyright header
contains a web link

+ }

+ print ($temp_file "\r\n");

+ #Retrieve generated assembly contents

+ while (my $line = <$target_file>) {

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace, fixup
line
endings

+ print ($temp_file expand ($line)); #expand() replaces tabs with
spaces

+ }

+

+ close ($source_file);

+ close ($target_file);

+ close ($temp_file);

+

+ move ($temp_file_name, $target) ||

+ die "Cannot replace \"" . $target . "\"!";

+}



#

# Find the openssl directory name for use lib. We have to do this

@@ -21,10 +75,41 @@ use File::Copy;
#

my $inf_file;

my $OPENSSL_PATH;

+my $uefi_config;

+my $extension;

+my $arch;

my @inf;



BEGIN {

$inf_file = "OpensslLib.inf";

+ $uefi_config = "UEFI";

+ $arch = shift;

+

+ if (defined $arch) {

+ if (uc ($arch) eq "X64") {

+ $arch = "X64";

+ $inf_file = "OpensslLibX64.inf";

+ $uefi_config = "UEFI-x86_64";

+ $extension = "nasm";

+ } else {

+ die "Unsupported architecture \"" . $arch . "\"!";

+ }

+ if ($extension eq "nasm") {

+ if (`nasm -v 2>&1`) {

+ #Presence of nasm executable will trigger inclusion of
AVX
instructions

+ die "\nCannot run assembly generators with NASM in
path!\n\n";

+ }

+ }

+

+ # Prepare assembly folder

+ if (-d $arch) {

+ remove_tree ($arch, {safe => 1}) ||

+ die "Cannot clean assembly folder \"" . $arch . "\"!";

+ } else {

+ mkdir $arch ||

+ die "Cannot create assembly folder \"" . $arch . "\"!";

+ }

+ }



# Read the contents of the inf file

open( FD, "<" . $inf_file ) ||

@@ -47,9 +132,9 @@ BEGIN {
# Configure UEFI

system(

"./Configure",

- "UEFI",

+ "--config=../uefi-asm.conf",

+ "$uefi_config",

"no-afalgeng",

- "no-asm",

"no-async",

"no-autoerrinit",

"no-autoload-config",

@@ -129,23 +214,53 @@ BEGIN {
# Retrieve file lists from OpenSSL configdata

#

use configdata qw/%unified_info/;

+use configdata qw/%config/;

+use configdata qw/%target/;

+

+#

+# Collect build flags from configdata

+#

+my $flags = "";

+foreach my $f (@{$config{lib_defines}}) {

+ $flags .= " -D$f";

+}



my @cryptofilelist = ();

my @sslfilelist = ();

+my @asmfilelist = ();

+my @asmbuild = ();

foreach my $product ((@{$unified_info{libraries}},

@{$unified_info{engines}})) {

foreach my $o (@{$unified_info{sources}->{$product}}) {

foreach my $s (@{$unified_info{sources}->{$o}}) {

- next if ($unified_info{generate}->{$s});

- next if $s =~ "crypto/bio/b_print.c";

-

# No need to add unused files in UEFI.

# So it can reduce porting time, compile time, library size.

+ next if $s =~ "crypto/bio/b_print.c";

next if $s =~ "crypto/rand/randfile.c";

next if $s =~ "crypto/store/";

next if $s =~ "crypto/err/err_all.c";

next if $s =~ "crypto/aes/aes_ecb.c";



+ if ($unified_info{generate}->{$s}) {

+ if (defined $arch) {

+ my $buildstring = "perl";

+ foreach my $arg (@{$unified_info{generate}->{$s}}) {

+ if ($arg =~ ".pl") {

+ $buildstring .= " ./openssl/$arg";

+ } elsif ($arg =~ "PERLASM_SCHEME") {

+ $buildstring .= " $target{perlasm_scheme}";

+ } elsif ($arg =~ "LIB_CFLAGS") {

+ $buildstring .= "$flags";

+ }

+ }

+ ($s, my $path, undef) = fileparse($s, qr/\.[^.]*/);

+ $buildstring .= " ./$arch/$path$s.$extension";

+ make_path ("./$arch/$path");

+ push @asmbuild, "$buildstring\n";

+ push @asmfilelist, " $arch/$path$s.$extension\r\n";

+ }

+ next;

+ }

if ($product =~ "libssl") {

push @sslfilelist, ' $(OPENSSL_PATH)/' . $s . "\r\n";

next;

@@ -183,15 +298,31 @@ foreach (@headers){
}





+#

+# Generate assembly files

+#

+if (@asmbuild) {

+ print "\n--> Generating assembly files ... ";

+ foreach my $buildstring (@asmbuild) {

+ system ("$buildstring");

+ copy_license_header ($buildstring);

+ }

+ print "Done!";

+}

+

#

# Update OpensslLib.inf with autogenerated file list

#

my @new_inf = ();

my $subbing = 0;

-print "\n--> Updating OpensslLib.inf ... ";

+print "\n--> Updating $inf_file ... ";

foreach (@inf) {

+ if ($_ =~ "DEFINE OPENSSL_FLAGS_CONFIG") {

+ push @new_inf, " DEFINE OPENSSL_FLAGS_CONFIG =" . $flags .
"\r\n";

+ next;

+ }

if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist, @sslfilelist;

+ push @new_inf, $_, @asmfilelist, @cryptofilelist, @sslfilelist;

$subbing = 1;

next;

}

@@ -216,49 +347,51 @@ rename( $new_inf_file, $inf_file ) ||
die "rename $inf_file";

print "Done!";



-#

-# Update OpensslLibCrypto.inf with auto-generated file list (no libssl)

-#

-$inf_file = "OpensslLibCrypto.inf";

-

-# Read the contents of the inf file

-@inf = ();

-@new_inf = ();

-open( FD, "<" . $inf_file ) ||

- die "Cannot open \"" . $inf_file . "\"!";

-@inf = (<FD>);

-close(FD) ||

- die "Cannot close \"" . $inf_file . "\"!";

+if (!defined $arch) {

+ #

+ # Update OpensslLibCrypto.inf with auto-generated file list (no
libssl)

+ #

+ $inf_file = "OpensslLibCrypto.inf";



-$subbing = 0;

-print "\n--> Updating OpensslLibCrypto.inf ... ";

-foreach (@inf) {

- if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist;

- $subbing = 1;

- next;

- }

- if ( $_ =~ "# Autogenerated files list ends here" ) {

- push @new_inf, $_;

- $subbing = 0;

- next;

+ # Read the contents of the inf file

+ @inf = ();

+ @new_inf = ();

+ open( FD, "<" . $inf_file ) ||

+ die "Cannot open \"" . $inf_file . "\"!";

+ @inf = (<FD>);

+ close(FD) ||

+ die "Cannot close \"" . $inf_file . "\"!";

+

+ $subbing = 0;

+ print "\n--> Updating OpensslLibCrypto.inf ... ";

+ foreach (@inf) {

+ if ( $_ =~ "# Autogenerated files list starts here" ) {

+ push @new_inf, $_, @cryptofilelist;

+ $subbing = 1;

+ next;

+ }

+ if ( $_ =~ "# Autogenerated files list ends here" ) {

+ push @new_inf, $_;

+ $subbing = 0;

+ next;

+ }

+

+ push @new_inf, $_

+ unless ($subbing);

}



- push @new_inf, $_

- unless ($subbing);

+ $new_inf_file = $inf_file . ".new";

+ open( FD, ">" . $new_inf_file ) ||

+ die $new_inf_file;

+ print( FD @new_inf ) ||

+ die $new_inf_file;

+ close(FD) ||

+ die $new_inf_file;

+ rename( $new_inf_file, $inf_file ) ||

+ die "rename $inf_file";

+ print "Done!";

}



-$new_inf_file = $inf_file . ".new";

-open( FD, ">" . $new_inf_file ) ||

- die $new_inf_file;

-print( FD @new_inf ) ||

- die $new_inf_file;

-close(FD) ||

- die $new_inf_file;

-rename( $new_inf_file, $inf_file ) ||

- die "rename $inf_file";

-print "Done!";

-

#

# Copy opensslconf.h and dso_conf.h generated from OpenSSL
Configuration

#

diff --git a/CryptoPkg/Library/OpensslLib/uefi-asm.conf
b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
new file mode 100644
index 0000000000..55eedbf3ba
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
@@ -0,0 +1,15 @@
+## -*- mode: perl; -*-

+## UEFI assembly openssl configuration targets.

+

+my %targets = (

+#### UEFI

+ "UEFI-x86_64" => {

+ perlasm_scheme => "nasm",

+ # inherit_from => [ "UEFI", asm("x86_64_asm") ],

+ inherit_from => [ "UEFI" ],

+ cpuid_asm_src => "x86_64cpuid.s",

+ aes_asm_src => "aes_core.c aes_cbc.c vpaes-x86_64.s aesni-
x86_64.s
aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",

+ sha1_asm_src => "sha1-x86_64.s sha256-x86_64.s sha512-
x86_64.s
sha1-mb-x86_64.s sha256-mb-x86_64.s",

+ modes_asm_src => "ghash-x86_64.s",

+ },

+);

--
2.28.0.windows.1


Guomin Jiang
 

Hi Zurcher,

[Jiewen] Since you also add other sha (sha1, sha512) and aesni, I think those
need unit test for them too.
Can you update the status about it?

[Jiewen] I think we need support build with GCC and LLVM, and with X64.
It is better to support the GCC and LLVM.

Thanks
Guomin

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao,
Jiewen
Sent: Tuesday, August 25, 2020 7:36 AM
To: Zurcher, Christopher J <christopher.j.zurcher@...>;
devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>; Ard Biesheuvel <ard.biesheuvel@...>
Subject: Re: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

Below:

-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 25, 2020 5:26 AM
To: devel@edk2.groups.io; Zurcher, Christopher J
<christopher.j.zurcher@...>; Yao, Jiewen <jiewen.yao@...>
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

1) I have confirmed that the ApiHooks.c file is still required even without
the AVX
instructions included. The x86_64 assembly files in OpenSSL set a flag called
$win64 and automatically include calls to the RtlVirtualUnwind function if
NASM
is selected as the assembler scheme.

https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-
rtlvirtualunwind

I have submitted an issue against OpenSSL since I don't think using the
NASM
assembler should force the inclusion of Windows-specific API hooks, but
that
change cannot be made in OpenSSL 1.1.1 and we will have to wait for
OpenSSL 3
or later to remove the stub function.

https://github.com/openssl/openssl/issues/12712
[Jiewen] Thanks.

2) So far I have only built with VS.
[Jiewen] I think we need support build with GCC and LLVM, and with X64.


3) The X64 SHA256 implementation was successfully exercised across a
large
number of devices in a production environment as a verification step in a
multi-
GB data transfer scenario.
[Jiewen] Since you also add other sha (sha1, sha512) and aesni, I think those
need unit test for them too.


Thanks,
Christopher Zurcher

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
Zurcher,
Christopher J
Sent: Tuesday, August 18, 2020 15:50
To: Yao, Jiewen <jiewen.yao@...>; devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: Re: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add
native
instruction support for X64

After further review, the ApiHooks.c file may no longer be needed since
we
are no longer including the AVX instructions. I will look over the
dependencies and send a new patch set if I can eliminate the API hooks
file.

Thanks,
Christopher Zurcher

-----Original Message-----
From: Yao, Jiewen <jiewen.yao@...>
Sent: Thursday, August 13, 2020 08:04
To: Zurcher, Christopher J <christopher.j.zurcher@...>;
devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction
support for X64

Hi Christopher
Thanks.

1) Would you please help me understand more on "ApiHooks.c contains
a
stub
function for a Windows API call" ?
Why we need this?
If it is compiler specific in openssl, should we submit patch to openssl to
exclude this with OPENSSL_SYS_UEFI? That should be a cleaner solution
for
UEFI.

2) Would you please describe what compiler you have tried? VS? GCC?
LLVM?

3) Would you please describe what unit test you have done?

Thank you
Yao Jiewen


-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 4, 2020 8:24 AM
To: devel@edk2.groups.io
Cc: Yao, Jiewen <jiewen.yao@...>; Wang, Jian J
<jian.j.wang@...>;
Lu, XiaoyuX <xiaoyux.lu@...>; Ard Biesheuvel
<ard.biesheuvel@...>
Subject: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native instruction
support
for X64

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2507

Adding OpensslLibX64.inf and modifying process_files.pl to process
this
file and generate the necessary assembly files.
ApiHooks.c contains a stub function for a Windows API call.
uefi-asm.conf contains the limited assembly configurations for
OpenSSL.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyux.lu@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Christopher J Zurcher
<christopher.j.zurcher@...>
---
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibX64.inf | 656
++++++++++++++++++++
CryptoPkg/Library/Include/openssl/opensslconf.h | 3 -
CryptoPkg/Library/OpensslLib/ApiHooks.c | 18 +
CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c | 34 +
CryptoPkg/Library/OpensslLib/process_files.pl | 223 +++++--
CryptoPkg/Library/OpensslLib/uefi-asm.conf | 15 +
8 files changed, 903 insertions(+), 50 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index dbbe5386a1..bd62d86936 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 616ccd9f62..2b7324a990 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
new file mode 100644
index 0000000000..825eea0254
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
@@ -0,0 +1,656 @@
+## @file

+# This module provides OpenSSL Library implementation.

+#

+# Copyright (c) 2010 - 2020, Intel Corporation. All rights
reserved.<BR>

+# (C) Copyright 2020 Hewlett Packard Enterprise Development
LP<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+ INF_VERSION = 0x00010005

+ BASE_NAME = OpensslLibX64

+ MODULE_UNI_FILE = OpensslLib.uni

+ FILE_GUID = 18125E50-0117-4DD0-BE54-4784AD995FEF

+ MODULE_TYPE = BASE

+ VERSION_STRING = 1.0

+ LIBRARY_CLASS = OpensslLib

+ DEFINE OPENSSL_PATH = openssl

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS_CONFIG = -DOPENSSL_CPUID_OBJ -
DSHA1_ASM -
DSHA256_ASM -DSHA512_ASM -DAESNI_ASM -DVPAES_ASM -
DGHASH_ASM

+ CONSTRUCTOR = OpensslLibConstructor

+

+#

+# VALID_ARCHITECTURES = X64

+#

+

+[Sources]

+ OpensslLibConstructor.c

+ $(OPENSSL_PATH)/e_os.h

+ $(OPENSSL_PATH)/ms/uplink.h

+# Autogenerated files list starts here

+ X64/crypto/aes/aesni-mb-x86_64.nasm

+ X64/crypto/aes/aesni-sha1-x86_64.nasm

+ X64/crypto/aes/aesni-sha256-x86_64.nasm

+ X64/crypto/aes/aesni-x86_64.nasm

+ X64/crypto/aes/vpaes-x86_64.nasm

+ X64/crypto/modes/ghash-x86_64.nasm

+ X64/crypto/sha/sha1-mb-x86_64.nasm

+ X64/crypto/sha/sha1-x86_64.nasm

+ X64/crypto/sha/sha256-mb-x86_64.nasm

+ X64/crypto/sha/sha256-x86_64.nasm

+ X64/crypto/sha/sha512-x86_64.nasm

+ X64/crypto/x86_64cpuid.nasm

+ $(OPENSSL_PATH)/crypto/aes/aes_cbc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_cfb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_core.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ige.c

+ $(OPENSSL_PATH)/crypto/aes/aes_misc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ofb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_wrap.c

+ $(OPENSSL_PATH)/crypto/aria/aria.c

+ $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_digest.c

+ $(OPENSSL_PATH)/crypto/asn1/a_dup.c

+ $(OPENSSL_PATH)/crypto/asn1/a_gentm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_int.c

+ $(OPENSSL_PATH)/crypto/asn1/a_mbstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_object.c

+ $(OPENSSL_PATH)/crypto/asn1/a_octet.c

+ $(OPENSSL_PATH)/crypto/asn1/a_print.c

+ $(OPENSSL_PATH)/crypto/asn1/a_sign.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strex.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strnid.c

+ $(OPENSSL_PATH)/crypto/asn1/a_time.c

+ $(OPENSSL_PATH)/crypto/asn1/a_type.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utctm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utf8.c

+ $(OPENSSL_PATH)/crypto/asn1/a_verify.c

+ $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_err.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_par.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mime.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_moid.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mstbl.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_pack.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/evp_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/f_int.c

+ $(OPENSSL_PATH)/crypto/asn1/f_string.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/n_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/nsseq.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbe.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_scrypt.c

+ $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_bitst.c

+ $(OPENSSL_PATH)/crypto/asn1/t_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_dec.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_enc.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_fre.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_new.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_scn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c

+ $(OPENSSL_PATH)/crypto/asn1/x_algor.c

+ $(OPENSSL_PATH)/crypto/asn1/x_bignum.c

+ $(OPENSSL_PATH)/crypto/asn1/x_info.c

+ $(OPENSSL_PATH)/crypto/asn1/x_int64.c

+ $(OPENSSL_PATH)/crypto/asn1/x_long.c

+ $(OPENSSL_PATH)/crypto/asn1/x_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/x_sig.c

+ $(OPENSSL_PATH)/crypto/asn1/x_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/x_val.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.c

+ $(OPENSSL_PATH)/crypto/async/async.c

+ $(OPENSSL_PATH)/crypto/async/async_err.c

+ $(OPENSSL_PATH)/crypto/async/async_wait.c

+ $(OPENSSL_PATH)/crypto/bio/b_addr.c

+ $(OPENSSL_PATH)/crypto/bio/b_dump.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock2.c

+ $(OPENSSL_PATH)/crypto/bio/bf_buff.c

+ $(OPENSSL_PATH)/crypto/bio/bf_lbuf.c

+ $(OPENSSL_PATH)/crypto/bio/bf_nbio.c

+ $(OPENSSL_PATH)/crypto/bio/bf_null.c

+ $(OPENSSL_PATH)/crypto/bio/bio_cb.c

+ $(OPENSSL_PATH)/crypto/bio/bio_err.c

+ $(OPENSSL_PATH)/crypto/bio/bio_lib.c

+ $(OPENSSL_PATH)/crypto/bio/bio_meth.c

+ $(OPENSSL_PATH)/crypto/bio/bss_acpt.c

+ $(OPENSSL_PATH)/crypto/bio/bss_bio.c

+ $(OPENSSL_PATH)/crypto/bio/bss_conn.c

+ $(OPENSSL_PATH)/crypto/bio/bss_dgram.c

+ $(OPENSSL_PATH)/crypto/bio/bss_fd.c

+ $(OPENSSL_PATH)/crypto/bio/bss_file.c

+ $(OPENSSL_PATH)/crypto/bio/bss_log.c

+ $(OPENSSL_PATH)/crypto/bio/bss_mem.c

+ $(OPENSSL_PATH)/crypto/bio/bss_null.c

+ $(OPENSSL_PATH)/crypto/bio/bss_sock.c

+ $(OPENSSL_PATH)/crypto/bn/bn_add.c

+ $(OPENSSL_PATH)/crypto/bn/bn_asm.c

+ $(OPENSSL_PATH)/crypto/bn/bn_blind.c

+ $(OPENSSL_PATH)/crypto/bn/bn_const.c

+ $(OPENSSL_PATH)/crypto/bn/bn_ctx.c

+ $(OPENSSL_PATH)/crypto/bn/bn_depr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_dh.c

+ $(OPENSSL_PATH)/crypto/bn/bn_div.c

+ $(OPENSSL_PATH)/crypto/bn/bn_err.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp2.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gcd.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gf2m.c

+ $(OPENSSL_PATH)/crypto/bn/bn_intern.c

+ $(OPENSSL_PATH)/crypto/bn/bn_kron.c

+ $(OPENSSL_PATH)/crypto/bn/bn_lib.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mod.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mont.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mpi.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mul.c

+ $(OPENSSL_PATH)/crypto/bn/bn_nist.c

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.c

+ $(OPENSSL_PATH)/crypto/bn/bn_print.c

+ $(OPENSSL_PATH)/crypto/bn/bn_rand.c

+ $(OPENSSL_PATH)/crypto/bn/bn_recp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_shift.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqrt.c

+ $(OPENSSL_PATH)/crypto/bn/bn_srp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_word.c

+ $(OPENSSL_PATH)/crypto/bn/bn_x931p.c

+ $(OPENSSL_PATH)/crypto/buffer/buf_err.c

+ $(OPENSSL_PATH)/crypto/buffer/buffer.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c

+ $(OPENSSL_PATH)/crypto/cmac/cmac.c

+ $(OPENSSL_PATH)/crypto/comp/c_zlib.c

+ $(OPENSSL_PATH)/crypto/comp/comp_err.c

+ $(OPENSSL_PATH)/crypto/comp/comp_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_api.c

+ $(OPENSSL_PATH)/crypto/conf/conf_def.c

+ $(OPENSSL_PATH)/crypto/conf/conf_err.c

+ $(OPENSSL_PATH)/crypto/conf/conf_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mall.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mod.c

+ $(OPENSSL_PATH)/crypto/conf/conf_sap.c

+ $(OPENSSL_PATH)/crypto/conf/conf_ssl.c

+ $(OPENSSL_PATH)/crypto/cpt_err.c

+ $(OPENSSL_PATH)/crypto/cryptlib.c

+ $(OPENSSL_PATH)/crypto/ctype.c

+ $(OPENSSL_PATH)/crypto/cversion.c

+ $(OPENSSL_PATH)/crypto/dh/dh_ameth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_asn1.c

+ $(OPENSSL_PATH)/crypto/dh/dh_check.c

+ $(OPENSSL_PATH)/crypto/dh/dh_depr.c

+ $(OPENSSL_PATH)/crypto/dh/dh_err.c

+ $(OPENSSL_PATH)/crypto/dh/dh_gen.c

+ $(OPENSSL_PATH)/crypto/dh/dh_kdf.c

+ $(OPENSSL_PATH)/crypto/dh/dh_key.c

+ $(OPENSSL_PATH)/crypto/dh/dh_lib.c

+ $(OPENSSL_PATH)/crypto/dh/dh_meth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_prn.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c

+ $(OPENSSL_PATH)/crypto/dso/dso_err.c

+ $(OPENSSL_PATH)/crypto/dso/dso_lib.c

+ $(OPENSSL_PATH)/crypto/dso/dso_openssl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_vms.c

+ $(OPENSSL_PATH)/crypto/dso/dso_win32.c

+ $(OPENSSL_PATH)/crypto/ebcdic.c

+ $(OPENSSL_PATH)/crypto/err/err.c

+ $(OPENSSL_PATH)/crypto/err/err_prn.c

+ $(OPENSSL_PATH)/crypto/evp/bio_b64.c

+ $(OPENSSL_PATH)/crypto/evp/bio_enc.c

+ $(OPENSSL_PATH)/crypto/evp/bio_md.c

+ $(OPENSSL_PATH)/crypto/evp/bio_ok.c

+ $(OPENSSL_PATH)/crypto/evp/c_allc.c

+ $(OPENSSL_PATH)/crypto/evp/c_alld.c

+ $(OPENSSL_PATH)/crypto/evp/cmeth_lib.c

+ $(OPENSSL_PATH)/crypto/evp/digest.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c

+ $(OPENSSL_PATH)/crypto/evp/e_aria.c

+ $(OPENSSL_PATH)/crypto/evp/e_bf.c

+ $(OPENSSL_PATH)/crypto/evp/e_camellia.c

+ $(OPENSSL_PATH)/crypto/evp/e_cast.c

+ $(OPENSSL_PATH)/crypto/evp/e_chacha20_poly1305.c

+ $(OPENSSL_PATH)/crypto/evp/e_des.c

+ $(OPENSSL_PATH)/crypto/evp/e_des3.c

+ $(OPENSSL_PATH)/crypto/evp/e_idea.c

+ $(OPENSSL_PATH)/crypto/evp/e_null.c

+ $(OPENSSL_PATH)/crypto/evp/e_old.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc2.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc5.c

+ $(OPENSSL_PATH)/crypto/evp/e_seed.c

+ $(OPENSSL_PATH)/crypto/evp/e_sm4.c

+ $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c

+ $(OPENSSL_PATH)/crypto/evp/encode.c

+ $(OPENSSL_PATH)/crypto/evp/evp_cnf.c

+ $(OPENSSL_PATH)/crypto/evp/evp_enc.c

+ $(OPENSSL_PATH)/crypto/evp/evp_err.c

+ $(OPENSSL_PATH)/crypto/evp/evp_key.c

+ $(OPENSSL_PATH)/crypto/evp/evp_lib.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pbe.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pkey.c

+ $(OPENSSL_PATH)/crypto/evp/m_md2.c

+ $(OPENSSL_PATH)/crypto/evp/m_md4.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_mdc2.c

+ $(OPENSSL_PATH)/crypto/evp/m_null.c

+ $(OPENSSL_PATH)/crypto/evp/m_ripemd.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha3.c

+ $(OPENSSL_PATH)/crypto/evp/m_sigver.c

+ $(OPENSSL_PATH)/crypto/evp/m_wp.c

+ $(OPENSSL_PATH)/crypto/evp/names.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c

+ $(OPENSSL_PATH)/crypto/evp/p_dec.c

+ $(OPENSSL_PATH)/crypto/evp/p_enc.c

+ $(OPENSSL_PATH)/crypto/evp/p_lib.c

+ $(OPENSSL_PATH)/crypto/evp/p_open.c

+ $(OPENSSL_PATH)/crypto/evp/p_seal.c

+ $(OPENSSL_PATH)/crypto/evp/p_sign.c

+ $(OPENSSL_PATH)/crypto/evp/p_verify.c

+ $(OPENSSL_PATH)/crypto/evp/pbe_scrypt.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c

+ $(OPENSSL_PATH)/crypto/ex_data.c

+ $(OPENSSL_PATH)/crypto/getenv.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c

+ $(OPENSSL_PATH)/crypto/hmac/hmac.c

+ $(OPENSSL_PATH)/crypto/init.c

+ $(OPENSSL_PATH)/crypto/kdf/hkdf.c

+ $(OPENSSL_PATH)/crypto/kdf/kdf_err.c

+ $(OPENSSL_PATH)/crypto/kdf/scrypt.c

+ $(OPENSSL_PATH)/crypto/kdf/tls1_prf.c

+ $(OPENSSL_PATH)/crypto/lhash/lh_stats.c

+ $(OPENSSL_PATH)/crypto/lhash/lhash.c

+ $(OPENSSL_PATH)/crypto/md5/md5_dgst.c

+ $(OPENSSL_PATH)/crypto/md5/md5_one.c

+ $(OPENSSL_PATH)/crypto/mem.c

+ $(OPENSSL_PATH)/crypto/mem_dbg.c

+ $(OPENSSL_PATH)/crypto/mem_sec.c

+ $(OPENSSL_PATH)/crypto/modes/cbc128.c

+ $(OPENSSL_PATH)/crypto/modes/ccm128.c

+ $(OPENSSL_PATH)/crypto/modes/cfb128.c

+ $(OPENSSL_PATH)/crypto/modes/ctr128.c

+ $(OPENSSL_PATH)/crypto/modes/cts128.c

+ $(OPENSSL_PATH)/crypto/modes/gcm128.c

+ $(OPENSSL_PATH)/crypto/modes/ocb128.c

+ $(OPENSSL_PATH)/crypto/modes/ofb128.c

+ $(OPENSSL_PATH)/crypto/modes/wrap128.c

+ $(OPENSSL_PATH)/crypto/modes/xts128.c

+ $(OPENSSL_PATH)/crypto/o_dir.c

+ $(OPENSSL_PATH)/crypto/o_fips.c

+ $(OPENSSL_PATH)/crypto/o_fopen.c

+ $(OPENSSL_PATH)/crypto/o_init.c

+ $(OPENSSL_PATH)/crypto/o_str.c

+ $(OPENSSL_PATH)/crypto/o_time.c

+ $(OPENSSL_PATH)/crypto/objects/o_names.c

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.c

+ $(OPENSSL_PATH)/crypto/objects/obj_err.c

+ $(OPENSSL_PATH)/crypto/objects/obj_lib.c

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c

+ $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c

+ $(OPENSSL_PATH)/crypto/pem/pem_all.c

+ $(OPENSSL_PATH)/crypto/pem/pem_err.c

+ $(OPENSSL_PATH)/crypto/pem/pem_info.c

+ $(OPENSSL_PATH)/crypto/pem/pem_lib.c

+ $(OPENSSL_PATH)/crypto/pem/pem_oth.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pk8.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pkey.c

+ $(OPENSSL_PATH)/crypto/pem/pem_sign.c

+ $(OPENSSL_PATH)/crypto/pem/pem_x509.c

+ $(OPENSSL_PATH)/crypto/pem/pem_xaux.c

+ $(OPENSSL_PATH)/crypto/pem/pvkfmt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_init.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_key.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_sbag.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c

+ $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_ctr.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_egd.c

+ $(OPENSSL_PATH)/crypto/rand/rand_err.c

+ $(OPENSSL_PATH)/crypto/rand/rand_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_unix.c

+ $(OPENSSL_PATH)/crypto/rand/rand_vms.c

+ $(OPENSSL_PATH)/crypto/rand/rand_win.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_chk.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_err.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_lib.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_meth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_mp.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_none.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ossl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_saos.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_sign.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c

+ $(OPENSSL_PATH)/crypto/sha/keccak1600.c

+ $(OPENSSL_PATH)/crypto/sha/sha1_one.c

+ $(OPENSSL_PATH)/crypto/sha/sha1dgst.c

+ $(OPENSSL_PATH)/crypto/sha/sha256.c

+ $(OPENSSL_PATH)/crypto/sha/sha512.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_ameth.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_pmeth.c

+ $(OPENSSL_PATH)/crypto/sm3/m_sm3.c

+ $(OPENSSL_PATH)/crypto/sm3/sm3.c

+ $(OPENSSL_PATH)/crypto/sm4/sm4.c

+ $(OPENSSL_PATH)/crypto/stack/stack.c

+ $(OPENSSL_PATH)/crypto/threads_none.c

+ $(OPENSSL_PATH)/crypto/threads_pthread.c

+ $(OPENSSL_PATH)/crypto/threads_win.c

+ $(OPENSSL_PATH)/crypto/txt_db/txt_db.c

+ $(OPENSSL_PATH)/crypto/ui/ui_err.c

+ $(OPENSSL_PATH)/crypto/ui/ui_lib.c

+ $(OPENSSL_PATH)/crypto/ui/ui_null.c

+ $(OPENSSL_PATH)/crypto/ui/ui_openssl.c

+ $(OPENSSL_PATH)/crypto/ui/ui_util.c

+ $(OPENSSL_PATH)/crypto/uid.c

+ $(OPENSSL_PATH)/crypto/x509/by_dir.c

+ $(OPENSSL_PATH)/crypto/x509/by_file.c

+ $(OPENSSL_PATH)/crypto/x509/t_crl.c

+ $(OPENSSL_PATH)/crypto/x509/t_req.c

+ $(OPENSSL_PATH)/crypto/x509/t_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x509_att.c

+ $(OPENSSL_PATH)/crypto/x509/x509_cmp.c

+ $(OPENSSL_PATH)/crypto/x509/x509_d2.c

+ $(OPENSSL_PATH)/crypto/x509/x509_def.c

+ $(OPENSSL_PATH)/crypto/x509/x509_err.c

+ $(OPENSSL_PATH)/crypto/x509/x509_ext.c

+ $(OPENSSL_PATH)/crypto/x509/x509_lu.c

+ $(OPENSSL_PATH)/crypto/x509/x509_meth.c

+ $(OPENSSL_PATH)/crypto/x509/x509_obj.c

+ $(OPENSSL_PATH)/crypto/x509/x509_r2x.c

+ $(OPENSSL_PATH)/crypto/x509/x509_req.c

+ $(OPENSSL_PATH)/crypto/x509/x509_set.c

+ $(OPENSSL_PATH)/crypto/x509/x509_trs.c

+ $(OPENSSL_PATH)/crypto/x509/x509_txt.c

+ $(OPENSSL_PATH)/crypto/x509/x509_v3.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vfy.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vpm.c

+ $(OPENSSL_PATH)/crypto/x509/x509cset.c

+ $(OPENSSL_PATH)/crypto/x509/x509name.c

+ $(OPENSSL_PATH)/crypto/x509/x509rset.c

+ $(OPENSSL_PATH)/crypto/x509/x509spki.c

+ $(OPENSSL_PATH)/crypto/x509/x509type.c

+ $(OPENSSL_PATH)/crypto/x509/x_all.c

+ $(OPENSSL_PATH)/crypto/x509/x_attrib.c

+ $(OPENSSL_PATH)/crypto/x509/x_crl.c

+ $(OPENSSL_PATH)/crypto/x509/x_exten.c

+ $(OPENSSL_PATH)/crypto/x509/x_name.c

+ $(OPENSSL_PATH)/crypto/x509/x_pubkey.c

+ $(OPENSSL_PATH)/crypto/x509/x_req.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509a.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_map.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_node.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_alt.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_conf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_crld.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_enum.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_extku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_genn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_info.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_int.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pci.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_prn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_purp.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_skey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_tlsf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3err.c

+ $(OPENSSL_PATH)/crypto/arm_arch.h

+ $(OPENSSL_PATH)/crypto/mips_arch.h

+ $(OPENSSL_PATH)/crypto/ppc_arch.h

+ $(OPENSSL_PATH)/crypto/s390x_arch.h

+ $(OPENSSL_PATH)/crypto/sparc_arch.h

+ $(OPENSSL_PATH)/crypto/vms_rms.h

+ $(OPENSSL_PATH)/crypto/aes/aes_local.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_local.h

+ $(OPENSSL_PATH)/crypto/asn1/charmap.h

+ $(OPENSSL_PATH)/crypto/asn1/standard_methods.h

+ $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h

+ $(OPENSSL_PATH)/crypto/async/async_local.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.h

+ $(OPENSSL_PATH)/crypto/bio/bio_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.h

+ $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h

+ $(OPENSSL_PATH)/crypto/comp/comp_local.h

+ $(OPENSSL_PATH)/crypto/conf/conf_def.h

+ $(OPENSSL_PATH)/crypto/conf/conf_local.h

+ $(OPENSSL_PATH)/crypto/dh/dh_local.h

+ $(OPENSSL_PATH)/crypto/dso/dso_local.h

+ $(OPENSSL_PATH)/crypto/evp/evp_local.h

+ $(OPENSSL_PATH)/crypto/hmac/hmac_local.h

+ $(OPENSSL_PATH)/crypto/lhash/lhash_local.h

+ $(OPENSSL_PATH)/crypto/md5/md5_local.h

+ $(OPENSSL_PATH)/crypto/modes/modes_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.h

+ $(OPENSSL_PATH)/crypto/objects/obj_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.h

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h

+ $(OPENSSL_PATH)/crypto/rand/rand_local.h

+ $(OPENSSL_PATH)/crypto/rsa/rsa_local.h

+ $(OPENSSL_PATH)/crypto/sha/sha_local.h

+ $(OPENSSL_PATH)/crypto/siphash/siphash_local.h

+ $(OPENSSL_PATH)/crypto/sm3/sm3_local.h

+ $(OPENSSL_PATH)/crypto/store/store_local.h

+ $(OPENSSL_PATH)/crypto/ui/ui_local.h

+ $(OPENSSL_PATH)/crypto/x509/x509_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h

+ $(OPENSSL_PATH)/ssl/bio_ssl.c

+ $(OPENSSL_PATH)/ssl/d1_lib.c

+ $(OPENSSL_PATH)/ssl/d1_msg.c

+ $(OPENSSL_PATH)/ssl/d1_srtp.c

+ $(OPENSSL_PATH)/ssl/methods.c

+ $(OPENSSL_PATH)/ssl/packet.c

+ $(OPENSSL_PATH)/ssl/pqueue.c

+ $(OPENSSL_PATH)/ssl/record/dtls1_bitmap.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_d1.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_s3.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_buffer.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record_tls13.c

+ $(OPENSSL_PATH)/ssl/s3_cbc.c

+ $(OPENSSL_PATH)/ssl/s3_enc.c

+ $(OPENSSL_PATH)/ssl/s3_lib.c

+ $(OPENSSL_PATH)/ssl/s3_msg.c

+ $(OPENSSL_PATH)/ssl/ssl_asn1.c

+ $(OPENSSL_PATH)/ssl/ssl_cert.c

+ $(OPENSSL_PATH)/ssl/ssl_ciph.c

+ $(OPENSSL_PATH)/ssl/ssl_conf.c

+ $(OPENSSL_PATH)/ssl/ssl_err.c

+ $(OPENSSL_PATH)/ssl/ssl_init.c

+ $(OPENSSL_PATH)/ssl/ssl_lib.c

+ $(OPENSSL_PATH)/ssl/ssl_mcnf.c

+ $(OPENSSL_PATH)/ssl/ssl_rsa.c

+ $(OPENSSL_PATH)/ssl/ssl_sess.c

+ $(OPENSSL_PATH)/ssl/ssl_stat.c

+ $(OPENSSL_PATH)/ssl/ssl_txt.c

+ $(OPENSSL_PATH)/ssl/ssl_utst.c

+ $(OPENSSL_PATH)/ssl/statem/extensions.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_cust.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_srvr.c

+ $(OPENSSL_PATH)/ssl/statem/statem.c

+ $(OPENSSL_PATH)/ssl/statem/statem_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/statem_dtls.c

+ $(OPENSSL_PATH)/ssl/statem/statem_lib.c

+ $(OPENSSL_PATH)/ssl/statem/statem_srvr.c

+ $(OPENSSL_PATH)/ssl/t1_enc.c

+ $(OPENSSL_PATH)/ssl/t1_lib.c

+ $(OPENSSL_PATH)/ssl/t1_trce.c

+ $(OPENSSL_PATH)/ssl/tls13_enc.c

+ $(OPENSSL_PATH)/ssl/tls_srp.c

+ $(OPENSSL_PATH)/ssl/packet_local.h

+ $(OPENSSL_PATH)/ssl/ssl_cert_table.h

+ $(OPENSSL_PATH)/ssl/ssl_local.h

+ $(OPENSSL_PATH)/ssl/record/record.h

+ $(OPENSSL_PATH)/ssl/record/record_local.h

+ $(OPENSSL_PATH)/ssl/statem/statem.h

+ $(OPENSSL_PATH)/ssl/statem/statem_local.h

+# Autogenerated files list ends here

+ buildinf.h

+ rand_pool_noise.h

+ ossl_store.c

+ rand_pool.c

+

+[Sources.X64]

+ rand_pool_noise_tsc.c

+ ApiHooks.c

+

+[Packages]

+ MdePkg/MdePkg.dec

+ CryptoPkg/CryptoPkg.dec

+

+[LibraryClasses]

+ BaseLib

+ DebugLib

+ TimerLib

+ PrintLib

+

+[BuildOptions]

+ #

+ # Disables the following Visual Studio compiler warnings brought by
openssl
source,

+ # so we do not break the build with /WX option:

+ # C4090: 'function' : different 'const' qualifiers

+ # C4132: 'object' : const object should be initialized (tls13_enc.c)

+ # C4210: nonstandard extension used: function given file scope

+ # C4244: conversion from type1 to type2, possible loss of data

+ # C4245: conversion from type1 to type2, signed/unsigned
mismatch

+ # C4267: conversion from size_t to type, possible loss of data

+ # C4306: 'identifier' : conversion from 'type1' to 'type2' of
greater
size

+ # C4310: cast truncates constant value

+ # C4389: 'operator' : signed/unsigned mismatch (xxxx)

+ # C4700: uninitialized local variable 'name' used. (conf_sap.c(71))

+ # C4702: unreachable code

+ # C4706: assignment within conditional expression

+ # C4819: The file contains a character that cannot be represented
in
the
current code page

+ #

+ MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /wd4090 /wd4132
/wd4210
/wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389
/wd4702
/wd4706 /wd4819

+

+ INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -
U__ICC
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /w

+

+ #

+ # Suppress the following build warnings in openssl so we don't
break
the
build
with -Werror

+ # -Werror=maybe-uninitialized: there exist some other paths for
which
the
variable is not initialized.

+ # -Werror=format: Check calls to printf and scanf, etc., to make
sure
that the
arguments supplied have

+ # types appropriate to the format string specified.

+ # -Werror=unused-but-set-variable: Warn whenever a local
variable is
assigned to, but otherwise unused (aside from its declaration).

+ #

+ GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64
$(OPENSSL_FLAGS)
$(OPENSSL_FLAGS_CONFIG) -Wno-error=maybe-uninitialized -Wno-
error=format -Wno-format -Wno-error=unused-but-set-variable -
DNO_MSABI_VA_FUNCS

+

+ # suppress the following warnings in openssl so we don't break the
build
with
warnings-as-errors:

+ # 1295: Deprecated declaration <entity> - give arg types

+ # 550: <entity> was set but never used

+ # 1293: assignment in condition

+ # 111: statement is unreachable (invariably "break;" after "return
X;"
in case
statement)

+ # 68: integer conversion resulted in a change of sign ("if (Status
==
-1)")

+ # 177: <entity> was declared but never referenced

+ # 223: function <entity> declared implicitly

+ # 144: a value of type <type> cannot be used to initialize an entity
of
type
<type>

+ # 513: a value of type <type> cannot be assigned to an entity of
type
<type>

+ # 188: enumerated type mixed with another type (i.e. passing an
integer
as an
enum without a cast)

+ # 1296: Extended constant initialiser used

+ # 128: loop is not reachable - may be emitted inappropriately if
code
follows
a conditional return

+ # from the function that evaluates to true at compile time

+ # 546: transfer of control bypasses initialization - may be emitted
inappropriately if the uninitialized

+ # variable is never referenced after the jump

+ # 1: ignore "#1-D: last line of file ends without a newline"

+ # 3017: <entity> may be used before being set (NOTE: This was
fixed in
OpenSSL 1.1 HEAD with

+ # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and
can
be
dropped then.)

+ XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -
U_WIN64
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) -w -std=c99 -Wno-
error=uninitialized

diff --git a/CryptoPkg/Library/Include/openssl/opensslconf.h
b/CryptoPkg/Library/Include/openssl/opensslconf.h
index 3a2544ea5c..e8f73c4d10 100644
--- a/CryptoPkg/Library/Include/openssl/opensslconf.h
+++ b/CryptoPkg/Library/Include/openssl/opensslconf.h
@@ -112,9 +112,6 @@ extern "C" {
#ifndef OPENSSL_NO_ASAN

# define OPENSSL_NO_ASAN

#endif

-#ifndef OPENSSL_NO_ASM

-# define OPENSSL_NO_ASM

-#endif

#ifndef OPENSSL_NO_ASYNC

# define OPENSSL_NO_ASYNC

#endif

diff --git a/CryptoPkg/Library/OpensslLib/ApiHooks.c
b/CryptoPkg/Library/OpensslLib/ApiHooks.c
new file mode 100644
index 0000000000..58cff16838
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/ApiHooks.c
@@ -0,0 +1,18 @@
+/** @file

+ OpenSSL Library API hooks.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+VOID *

+__imp_RtlVirtualUnwind (

+ VOID * Args

+ )

+{

+ return NULL;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
new file mode 100644
index 0000000000..ef20d2b84e
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
@@ -0,0 +1,34 @@
+/** @file

+ Constructor to initialize CPUID data for OpenSSL assembly
operations.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+extern void OPENSSL_cpuid_setup (void);

+

+/**

+ Constructor routine for OpensslLib.

+

+ The constructor calls an internal OpenSSL function which fetches a
local
copy

+ of the hardware capability flags, used to enable native crypto
instructions.

+

+ @param None

+

+ @retval EFI_SUCCESS The construction succeeded.

+

+**/

+EFI_STATUS

+EFIAPI

+OpensslLibConstructor (

+ VOID

+ )

+{

+ OPENSSL_cpuid_setup ();

+

+ return EFI_SUCCESS;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl
b/CryptoPkg/Library/OpensslLib/process_files.pl
index 57ce195394..472f59bc8e 100755
--- a/CryptoPkg/Library/OpensslLib/process_files.pl
+++ b/CryptoPkg/Library/OpensslLib/process_files.pl
@@ -9,9 +9,63 @@
# do not need to do this, since the results are stored in the EDK2

# git repository for them.

#

+# Due to the script wrapping required to process the OpenSSL

+# configuration data, each native architecture must be processed

+# individually by the maintainer (in addition to the standard version):

+# ./process_files.pl

+# ./process_files.pl X64

+# ./process_files.pl [Arch]

+

use strict;

use Cwd;

use File::Copy;

+use File::Basename;

+use File::Path qw(make_path remove_tree);

+use Text::Tabs;

+

+#

+# OpenSSL perlasm generator script does not transfer the copyright
header

+#

+sub copy_license_header

+{

+ my @args = split / /, shift; #Separate args by spaces

+ my $source = $args[1]; #Source file is second (after
"perl")

+ my $target = pop @args; #Target file is always last

+ chop ($target); #Remove newline char

+

+ my $temp_file_name = "license.tmp";

+ open (my $source_file, "<" . $source) || die $source;

+ open (my $target_file, "<" . $target) || die $target;

+ open (my $temp_file, ">" . $temp_file_name) || die
$temp_file_name;

+

+ #Add "generated file" warning

+ $source =~ s/^..//; #Remove leading "./"

+ print ($temp_file "; WARNING: do not edit!\r\n");

+ print ($temp_file "; Generated from $source\r\n");

+ print ($temp_file ";\r\n");

+

+ #Copy source file header to temp file

+ while (my $line = <$source_file>) {

+ next if ($line =~ /#!/); #Ignore shebang line

+ $line =~ s/#/;/; #Fix comment character for assembly

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace, fixup
line
endings

+ print ($temp_file $line);

+ last if ($line =~ /http/); #Last line of copyright header
contains a web link

+ }

+ print ($temp_file "\r\n");

+ #Retrieve generated assembly contents

+ while (my $line = <$target_file>) {

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace, fixup
line
endings

+ print ($temp_file expand ($line)); #expand() replaces tabs with
spaces

+ }

+

+ close ($source_file);

+ close ($target_file);

+ close ($temp_file);

+

+ move ($temp_file_name, $target) ||

+ die "Cannot replace \"" . $target . "\"!";

+}



#

# Find the openssl directory name for use lib. We have to do this

@@ -21,10 +75,41 @@ use File::Copy;
#

my $inf_file;

my $OPENSSL_PATH;

+my $uefi_config;

+my $extension;

+my $arch;

my @inf;



BEGIN {

$inf_file = "OpensslLib.inf";

+ $uefi_config = "UEFI";

+ $arch = shift;

+

+ if (defined $arch) {

+ if (uc ($arch) eq "X64") {

+ $arch = "X64";

+ $inf_file = "OpensslLibX64.inf";

+ $uefi_config = "UEFI-x86_64";

+ $extension = "nasm";

+ } else {

+ die "Unsupported architecture \"" . $arch . "\"!";

+ }

+ if ($extension eq "nasm") {

+ if (`nasm -v 2>&1`) {

+ #Presence of nasm executable will trigger inclusion of
AVX
instructions

+ die "\nCannot run assembly generators with NASM in
path!\n\n";

+ }

+ }

+

+ # Prepare assembly folder

+ if (-d $arch) {

+ remove_tree ($arch, {safe => 1}) ||

+ die "Cannot clean assembly folder \"" . $arch . "\"!";

+ } else {

+ mkdir $arch ||

+ die "Cannot create assembly folder \"" . $arch . "\"!";

+ }

+ }



# Read the contents of the inf file

open( FD, "<" . $inf_file ) ||

@@ -47,9 +132,9 @@ BEGIN {
# Configure UEFI

system(

"./Configure",

- "UEFI",

+ "--config=../uefi-asm.conf",

+ "$uefi_config",

"no-afalgeng",

- "no-asm",

"no-async",

"no-autoerrinit",

"no-autoload-config",

@@ -129,23 +214,53 @@ BEGIN {
# Retrieve file lists from OpenSSL configdata

#

use configdata qw/%unified_info/;

+use configdata qw/%config/;

+use configdata qw/%target/;

+

+#

+# Collect build flags from configdata

+#

+my $flags = "";

+foreach my $f (@{$config{lib_defines}}) {

+ $flags .= " -D$f";

+}



my @cryptofilelist = ();

my @sslfilelist = ();

+my @asmfilelist = ();

+my @asmbuild = ();

foreach my $product ((@{$unified_info{libraries}},

@{$unified_info{engines}})) {

foreach my $o (@{$unified_info{sources}->{$product}}) {

foreach my $s (@{$unified_info{sources}->{$o}}) {

- next if ($unified_info{generate}->{$s});

- next if $s =~ "crypto/bio/b_print.c";

-

# No need to add unused files in UEFI.

# So it can reduce porting time, compile time, library size.

+ next if $s =~ "crypto/bio/b_print.c";

next if $s =~ "crypto/rand/randfile.c";

next if $s =~ "crypto/store/";

next if $s =~ "crypto/err/err_all.c";

next if $s =~ "crypto/aes/aes_ecb.c";



+ if ($unified_info{generate}->{$s}) {

+ if (defined $arch) {

+ my $buildstring = "perl";

+ foreach my $arg (@{$unified_info{generate}->{$s}}) {

+ if ($arg =~ ".pl") {

+ $buildstring .= " ./openssl/$arg";

+ } elsif ($arg =~ "PERLASM_SCHEME") {

+ $buildstring .= " $target{perlasm_scheme}";

+ } elsif ($arg =~ "LIB_CFLAGS") {

+ $buildstring .= "$flags";

+ }

+ }

+ ($s, my $path, undef) = fileparse($s, qr/\.[^.]*/);

+ $buildstring .= " ./$arch/$path$s.$extension";

+ make_path ("./$arch/$path");

+ push @asmbuild, "$buildstring\n";

+ push @asmfilelist, " $arch/$path$s.$extension\r\n";

+ }

+ next;

+ }

if ($product =~ "libssl") {

push @sslfilelist, ' $(OPENSSL_PATH)/' . $s . "\r\n";

next;

@@ -183,15 +298,31 @@ foreach (@headers){
}





+#

+# Generate assembly files

+#

+if (@asmbuild) {

+ print "\n--> Generating assembly files ... ";

+ foreach my $buildstring (@asmbuild) {

+ system ("$buildstring");

+ copy_license_header ($buildstring);

+ }

+ print "Done!";

+}

+

#

# Update OpensslLib.inf with autogenerated file list

#

my @new_inf = ();

my $subbing = 0;

-print "\n--> Updating OpensslLib.inf ... ";

+print "\n--> Updating $inf_file ... ";

foreach (@inf) {

+ if ($_ =~ "DEFINE OPENSSL_FLAGS_CONFIG") {

+ push @new_inf, " DEFINE OPENSSL_FLAGS_CONFIG =" . $flags
.
"\r\n";

+ next;

+ }

if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist, @sslfilelist;

+ push @new_inf, $_, @asmfilelist, @cryptofilelist, @sslfilelist;

$subbing = 1;

next;

}

@@ -216,49 +347,51 @@ rename( $new_inf_file, $inf_file ) ||
die "rename $inf_file";

print "Done!";



-#

-# Update OpensslLibCrypto.inf with auto-generated file list (no libssl)

-#

-$inf_file = "OpensslLibCrypto.inf";

-

-# Read the contents of the inf file

-@inf = ();

-@new_inf = ();

-open( FD, "<" . $inf_file ) ||

- die "Cannot open \"" . $inf_file . "\"!";

-@inf = (<FD>);

-close(FD) ||

- die "Cannot close \"" . $inf_file . "\"!";

+if (!defined $arch) {

+ #

+ # Update OpensslLibCrypto.inf with auto-generated file list (no
libssl)

+ #

+ $inf_file = "OpensslLibCrypto.inf";



-$subbing = 0;

-print "\n--> Updating OpensslLibCrypto.inf ... ";

-foreach (@inf) {

- if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist;

- $subbing = 1;

- next;

- }

- if ( $_ =~ "# Autogenerated files list ends here" ) {

- push @new_inf, $_;

- $subbing = 0;

- next;

+ # Read the contents of the inf file

+ @inf = ();

+ @new_inf = ();

+ open( FD, "<" . $inf_file ) ||

+ die "Cannot open \"" . $inf_file . "\"!";

+ @inf = (<FD>);

+ close(FD) ||

+ die "Cannot close \"" . $inf_file . "\"!";

+

+ $subbing = 0;

+ print "\n--> Updating OpensslLibCrypto.inf ... ";

+ foreach (@inf) {

+ if ( $_ =~ "# Autogenerated files list starts here" ) {

+ push @new_inf, $_, @cryptofilelist;

+ $subbing = 1;

+ next;

+ }

+ if ( $_ =~ "# Autogenerated files list ends here" ) {

+ push @new_inf, $_;

+ $subbing = 0;

+ next;

+ }

+

+ push @new_inf, $_

+ unless ($subbing);

}



- push @new_inf, $_

- unless ($subbing);

+ $new_inf_file = $inf_file . ".new";

+ open( FD, ">" . $new_inf_file ) ||

+ die $new_inf_file;

+ print( FD @new_inf ) ||

+ die $new_inf_file;

+ close(FD) ||

+ die $new_inf_file;

+ rename( $new_inf_file, $inf_file ) ||

+ die "rename $inf_file";

+ print "Done!";

}



-$new_inf_file = $inf_file . ".new";

-open( FD, ">" . $new_inf_file ) ||

- die $new_inf_file;

-print( FD @new_inf ) ||

- die $new_inf_file;

-close(FD) ||

- die $new_inf_file;

-rename( $new_inf_file, $inf_file ) ||

- die "rename $inf_file";

-print "Done!";

-

#

# Copy opensslconf.h and dso_conf.h generated from OpenSSL
Configuration

#

diff --git a/CryptoPkg/Library/OpensslLib/uefi-asm.conf
b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
new file mode 100644
index 0000000000..55eedbf3ba
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
@@ -0,0 +1,15 @@
+## -*- mode: perl; -*-

+## UEFI assembly openssl configuration targets.

+

+my %targets = (

+#### UEFI

+ "UEFI-x86_64" => {

+ perlasm_scheme => "nasm",

+ # inherit_from => [ "UEFI", asm("x86_64_asm") ],

+ inherit_from => [ "UEFI" ],

+ cpuid_asm_src => "x86_64cpuid.s",

+ aes_asm_src => "aes_core.c aes_cbc.c vpaes-x86_64.s aesni-
x86_64.s
aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",

+ sha1_asm_src => "sha1-x86_64.s sha256-x86_64.s sha512-
x86_64.s
sha1-mb-x86_64.s sha256-mb-x86_64.s",

+ modes_asm_src => "ghash-x86_64.s",

+ },

+);

--
2.28.0.windows.1



Zurcher, Christopher J
 

I have unit tested SHA1, SHA512, and AES as well.
I do not have the build environment available to test GCC and LLVM.

--
Christopher Zurcher

-----Original Message-----
From: Jiang, Guomin <guomin.jiang@...>
Sent: Wednesday, September 16, 2020 02:17
To: devel@edk2.groups.io; Yao, Jiewen <jiewen.yao@...>; Zurcher,
Christopher J <christopher.j.zurcher@...>
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX <xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

Hi Zurcher,

[Jiewen] Since you also add other sha (sha1, sha512) and aesni, I think
those
need unit test for them too.
Can you update the status about it?

[Jiewen] I think we need support build with GCC and LLVM, and with X64.
It is better to support the GCC and LLVM.

Thanks
Guomin

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao,
Jiewen
Sent: Tuesday, August 25, 2020 7:36 AM
To: Zurcher, Christopher J <christopher.j.zurcher@...>;
devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>; Ard Biesheuvel <ard.biesheuvel@...>
Subject: Re: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

Below:

-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 25, 2020 5:26 AM
To: devel@edk2.groups.io; Zurcher, Christopher J
<christopher.j.zurcher@...>; Yao, Jiewen <jiewen.yao@...>
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

1) I have confirmed that the ApiHooks.c file is still required even
without
the AVX
instructions included. The x86_64 assembly files in OpenSSL set a flag
called
$win64 and automatically include calls to the RtlVirtualUnwind function
if
NASM
is selected as the assembler scheme.

https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-
rtlvirtualunwind

I have submitted an issue against OpenSSL since I don't think using the
NASM
assembler should force the inclusion of Windows-specific API hooks, but
that
change cannot be made in OpenSSL 1.1.1 and we will have to wait for
OpenSSL 3
or later to remove the stub function.

https://github.com/openssl/openssl/issues/12712
[Jiewen] Thanks.

2) So far I have only built with VS.
[Jiewen] I think we need support build with GCC and LLVM, and with X64.


3) The X64 SHA256 implementation was successfully exercised across a
large
number of devices in a production environment as a verification step in a
multi-
GB data transfer scenario.
[Jiewen] Since you also add other sha (sha1, sha512) and aesni, I think
those
need unit test for them too.


Thanks,
Christopher Zurcher

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
Zurcher,
Christopher J
Sent: Tuesday, August 18, 2020 15:50
To: Yao, Jiewen <jiewen.yao@...>; devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: Re: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add
native
instruction support for X64

After further review, the ApiHooks.c file may no longer be needed since
we
are no longer including the AVX instructions. I will look over the
dependencies and send a new patch set if I can eliminate the API hooks
file.

Thanks,
Christopher Zurcher

-----Original Message-----
From: Yao, Jiewen <jiewen.yao@...>
Sent: Thursday, August 13, 2020 08:04
To: Zurcher, Christopher J <christopher.j.zurcher@...>;
devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction
support for X64

Hi Christopher
Thanks.

1) Would you please help me understand more on "ApiHooks.c contains
a
stub
function for a Windows API call" ?
Why we need this?
If it is compiler specific in openssl, should we submit patch to
openssl to
exclude this with OPENSSL_SYS_UEFI? That should be a cleaner solution
for
UEFI.

2) Would you please describe what compiler you have tried? VS? GCC?
LLVM?

3) Would you please describe what unit test you have done?

Thank you
Yao Jiewen


-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 4, 2020 8:24 AM
To: devel@edk2.groups.io
Cc: Yao, Jiewen <jiewen.yao@...>; Wang, Jian J
<jian.j.wang@...>;
Lu, XiaoyuX <xiaoyux.lu@...>; Ard Biesheuvel
<ard.biesheuvel@...>
Subject: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction
support
for X64

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2507

Adding OpensslLibX64.inf and modifying process_files.pl to process
this
file and generate the necessary assembly files.
ApiHooks.c contains a stub function for a Windows API call.
uefi-asm.conf contains the limited assembly configurations for
OpenSSL.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyux.lu@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Christopher J Zurcher
<christopher.j.zurcher@...>
---
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibX64.inf | 656
++++++++++++++++++++
CryptoPkg/Library/Include/openssl/opensslconf.h | 3 -
CryptoPkg/Library/OpensslLib/ApiHooks.c | 18 +
CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c | 34 +
CryptoPkg/Library/OpensslLib/process_files.pl | 223 +++++--
CryptoPkg/Library/OpensslLib/uefi-asm.conf | 15 +
8 files changed, 903 insertions(+), 50 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index dbbe5386a1..bd62d86936 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 616ccd9f62..2b7324a990 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
new file mode 100644
index 0000000000..825eea0254
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
@@ -0,0 +1,656 @@
+## @file

+# This module provides OpenSSL Library implementation.

+#

+# Copyright (c) 2010 - 2020, Intel Corporation. All rights
reserved.<BR>

+# (C) Copyright 2020 Hewlett Packard Enterprise Development
LP<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+ INF_VERSION = 0x00010005

+ BASE_NAME = OpensslLibX64

+ MODULE_UNI_FILE = OpensslLib.uni

+ FILE_GUID = 18125E50-0117-4DD0-BE54-
4784AD995FEF

+ MODULE_TYPE = BASE

+ VERSION_STRING = 1.0

+ LIBRARY_CLASS = OpensslLib

+ DEFINE OPENSSL_PATH = openssl

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS_CONFIG = -DOPENSSL_CPUID_OBJ -
DSHA1_ASM -
DSHA256_ASM -DSHA512_ASM -DAESNI_ASM -DVPAES_ASM -
DGHASH_ASM

+ CONSTRUCTOR = OpensslLibConstructor

+

+#

+# VALID_ARCHITECTURES = X64

+#

+

+[Sources]

+ OpensslLibConstructor.c

+ $(OPENSSL_PATH)/e_os.h

+ $(OPENSSL_PATH)/ms/uplink.h

+# Autogenerated files list starts here

+ X64/crypto/aes/aesni-mb-x86_64.nasm

+ X64/crypto/aes/aesni-sha1-x86_64.nasm

+ X64/crypto/aes/aesni-sha256-x86_64.nasm

+ X64/crypto/aes/aesni-x86_64.nasm

+ X64/crypto/aes/vpaes-x86_64.nasm

+ X64/crypto/modes/ghash-x86_64.nasm

+ X64/crypto/sha/sha1-mb-x86_64.nasm

+ X64/crypto/sha/sha1-x86_64.nasm

+ X64/crypto/sha/sha256-mb-x86_64.nasm

+ X64/crypto/sha/sha256-x86_64.nasm

+ X64/crypto/sha/sha512-x86_64.nasm

+ X64/crypto/x86_64cpuid.nasm

+ $(OPENSSL_PATH)/crypto/aes/aes_cbc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_cfb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_core.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ige.c

+ $(OPENSSL_PATH)/crypto/aes/aes_misc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ofb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_wrap.c

+ $(OPENSSL_PATH)/crypto/aria/aria.c

+ $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_digest.c

+ $(OPENSSL_PATH)/crypto/asn1/a_dup.c

+ $(OPENSSL_PATH)/crypto/asn1/a_gentm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_int.c

+ $(OPENSSL_PATH)/crypto/asn1/a_mbstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_object.c

+ $(OPENSSL_PATH)/crypto/asn1/a_octet.c

+ $(OPENSSL_PATH)/crypto/asn1/a_print.c

+ $(OPENSSL_PATH)/crypto/asn1/a_sign.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strex.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strnid.c

+ $(OPENSSL_PATH)/crypto/asn1/a_time.c

+ $(OPENSSL_PATH)/crypto/asn1/a_type.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utctm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utf8.c

+ $(OPENSSL_PATH)/crypto/asn1/a_verify.c

+ $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_err.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_par.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mime.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_moid.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mstbl.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_pack.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/evp_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/f_int.c

+ $(OPENSSL_PATH)/crypto/asn1/f_string.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/n_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/nsseq.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbe.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_scrypt.c

+ $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_bitst.c

+ $(OPENSSL_PATH)/crypto/asn1/t_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_dec.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_enc.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_fre.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_new.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_scn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c

+ $(OPENSSL_PATH)/crypto/asn1/x_algor.c

+ $(OPENSSL_PATH)/crypto/asn1/x_bignum.c

+ $(OPENSSL_PATH)/crypto/asn1/x_info.c

+ $(OPENSSL_PATH)/crypto/asn1/x_int64.c

+ $(OPENSSL_PATH)/crypto/asn1/x_long.c

+ $(OPENSSL_PATH)/crypto/asn1/x_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/x_sig.c

+ $(OPENSSL_PATH)/crypto/asn1/x_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/x_val.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.c

+ $(OPENSSL_PATH)/crypto/async/async.c

+ $(OPENSSL_PATH)/crypto/async/async_err.c

+ $(OPENSSL_PATH)/crypto/async/async_wait.c

+ $(OPENSSL_PATH)/crypto/bio/b_addr.c

+ $(OPENSSL_PATH)/crypto/bio/b_dump.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock2.c

+ $(OPENSSL_PATH)/crypto/bio/bf_buff.c

+ $(OPENSSL_PATH)/crypto/bio/bf_lbuf.c

+ $(OPENSSL_PATH)/crypto/bio/bf_nbio.c

+ $(OPENSSL_PATH)/crypto/bio/bf_null.c

+ $(OPENSSL_PATH)/crypto/bio/bio_cb.c

+ $(OPENSSL_PATH)/crypto/bio/bio_err.c

+ $(OPENSSL_PATH)/crypto/bio/bio_lib.c

+ $(OPENSSL_PATH)/crypto/bio/bio_meth.c

+ $(OPENSSL_PATH)/crypto/bio/bss_acpt.c

+ $(OPENSSL_PATH)/crypto/bio/bss_bio.c

+ $(OPENSSL_PATH)/crypto/bio/bss_conn.c

+ $(OPENSSL_PATH)/crypto/bio/bss_dgram.c

+ $(OPENSSL_PATH)/crypto/bio/bss_fd.c

+ $(OPENSSL_PATH)/crypto/bio/bss_file.c

+ $(OPENSSL_PATH)/crypto/bio/bss_log.c

+ $(OPENSSL_PATH)/crypto/bio/bss_mem.c

+ $(OPENSSL_PATH)/crypto/bio/bss_null.c

+ $(OPENSSL_PATH)/crypto/bio/bss_sock.c

+ $(OPENSSL_PATH)/crypto/bn/bn_add.c

+ $(OPENSSL_PATH)/crypto/bn/bn_asm.c

+ $(OPENSSL_PATH)/crypto/bn/bn_blind.c

+ $(OPENSSL_PATH)/crypto/bn/bn_const.c

+ $(OPENSSL_PATH)/crypto/bn/bn_ctx.c

+ $(OPENSSL_PATH)/crypto/bn/bn_depr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_dh.c

+ $(OPENSSL_PATH)/crypto/bn/bn_div.c

+ $(OPENSSL_PATH)/crypto/bn/bn_err.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp2.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gcd.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gf2m.c

+ $(OPENSSL_PATH)/crypto/bn/bn_intern.c

+ $(OPENSSL_PATH)/crypto/bn/bn_kron.c

+ $(OPENSSL_PATH)/crypto/bn/bn_lib.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mod.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mont.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mpi.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mul.c

+ $(OPENSSL_PATH)/crypto/bn/bn_nist.c

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.c

+ $(OPENSSL_PATH)/crypto/bn/bn_print.c

+ $(OPENSSL_PATH)/crypto/bn/bn_rand.c

+ $(OPENSSL_PATH)/crypto/bn/bn_recp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_shift.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqrt.c

+ $(OPENSSL_PATH)/crypto/bn/bn_srp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_word.c

+ $(OPENSSL_PATH)/crypto/bn/bn_x931p.c

+ $(OPENSSL_PATH)/crypto/buffer/buf_err.c

+ $(OPENSSL_PATH)/crypto/buffer/buffer.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c

+ $(OPENSSL_PATH)/crypto/cmac/cmac.c

+ $(OPENSSL_PATH)/crypto/comp/c_zlib.c

+ $(OPENSSL_PATH)/crypto/comp/comp_err.c

+ $(OPENSSL_PATH)/crypto/comp/comp_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_api.c

+ $(OPENSSL_PATH)/crypto/conf/conf_def.c

+ $(OPENSSL_PATH)/crypto/conf/conf_err.c

+ $(OPENSSL_PATH)/crypto/conf/conf_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mall.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mod.c

+ $(OPENSSL_PATH)/crypto/conf/conf_sap.c

+ $(OPENSSL_PATH)/crypto/conf/conf_ssl.c

+ $(OPENSSL_PATH)/crypto/cpt_err.c

+ $(OPENSSL_PATH)/crypto/cryptlib.c

+ $(OPENSSL_PATH)/crypto/ctype.c

+ $(OPENSSL_PATH)/crypto/cversion.c

+ $(OPENSSL_PATH)/crypto/dh/dh_ameth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_asn1.c

+ $(OPENSSL_PATH)/crypto/dh/dh_check.c

+ $(OPENSSL_PATH)/crypto/dh/dh_depr.c

+ $(OPENSSL_PATH)/crypto/dh/dh_err.c

+ $(OPENSSL_PATH)/crypto/dh/dh_gen.c

+ $(OPENSSL_PATH)/crypto/dh/dh_kdf.c

+ $(OPENSSL_PATH)/crypto/dh/dh_key.c

+ $(OPENSSL_PATH)/crypto/dh/dh_lib.c

+ $(OPENSSL_PATH)/crypto/dh/dh_meth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_prn.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c

+ $(OPENSSL_PATH)/crypto/dso/dso_err.c

+ $(OPENSSL_PATH)/crypto/dso/dso_lib.c

+ $(OPENSSL_PATH)/crypto/dso/dso_openssl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_vms.c

+ $(OPENSSL_PATH)/crypto/dso/dso_win32.c

+ $(OPENSSL_PATH)/crypto/ebcdic.c

+ $(OPENSSL_PATH)/crypto/err/err.c

+ $(OPENSSL_PATH)/crypto/err/err_prn.c

+ $(OPENSSL_PATH)/crypto/evp/bio_b64.c

+ $(OPENSSL_PATH)/crypto/evp/bio_enc.c

+ $(OPENSSL_PATH)/crypto/evp/bio_md.c

+ $(OPENSSL_PATH)/crypto/evp/bio_ok.c

+ $(OPENSSL_PATH)/crypto/evp/c_allc.c

+ $(OPENSSL_PATH)/crypto/evp/c_alld.c

+ $(OPENSSL_PATH)/crypto/evp/cmeth_lib.c

+ $(OPENSSL_PATH)/crypto/evp/digest.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c

+ $(OPENSSL_PATH)/crypto/evp/e_aria.c

+ $(OPENSSL_PATH)/crypto/evp/e_bf.c

+ $(OPENSSL_PATH)/crypto/evp/e_camellia.c

+ $(OPENSSL_PATH)/crypto/evp/e_cast.c

+ $(OPENSSL_PATH)/crypto/evp/e_chacha20_poly1305.c

+ $(OPENSSL_PATH)/crypto/evp/e_des.c

+ $(OPENSSL_PATH)/crypto/evp/e_des3.c

+ $(OPENSSL_PATH)/crypto/evp/e_idea.c

+ $(OPENSSL_PATH)/crypto/evp/e_null.c

+ $(OPENSSL_PATH)/crypto/evp/e_old.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc2.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc5.c

+ $(OPENSSL_PATH)/crypto/evp/e_seed.c

+ $(OPENSSL_PATH)/crypto/evp/e_sm4.c

+ $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c

+ $(OPENSSL_PATH)/crypto/evp/encode.c

+ $(OPENSSL_PATH)/crypto/evp/evp_cnf.c

+ $(OPENSSL_PATH)/crypto/evp/evp_enc.c

+ $(OPENSSL_PATH)/crypto/evp/evp_err.c

+ $(OPENSSL_PATH)/crypto/evp/evp_key.c

+ $(OPENSSL_PATH)/crypto/evp/evp_lib.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pbe.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pkey.c

+ $(OPENSSL_PATH)/crypto/evp/m_md2.c

+ $(OPENSSL_PATH)/crypto/evp/m_md4.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_mdc2.c

+ $(OPENSSL_PATH)/crypto/evp/m_null.c

+ $(OPENSSL_PATH)/crypto/evp/m_ripemd.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha3.c

+ $(OPENSSL_PATH)/crypto/evp/m_sigver.c

+ $(OPENSSL_PATH)/crypto/evp/m_wp.c

+ $(OPENSSL_PATH)/crypto/evp/names.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c

+ $(OPENSSL_PATH)/crypto/evp/p_dec.c

+ $(OPENSSL_PATH)/crypto/evp/p_enc.c

+ $(OPENSSL_PATH)/crypto/evp/p_lib.c

+ $(OPENSSL_PATH)/crypto/evp/p_open.c

+ $(OPENSSL_PATH)/crypto/evp/p_seal.c

+ $(OPENSSL_PATH)/crypto/evp/p_sign.c

+ $(OPENSSL_PATH)/crypto/evp/p_verify.c

+ $(OPENSSL_PATH)/crypto/evp/pbe_scrypt.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c

+ $(OPENSSL_PATH)/crypto/ex_data.c

+ $(OPENSSL_PATH)/crypto/getenv.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c

+ $(OPENSSL_PATH)/crypto/hmac/hmac.c

+ $(OPENSSL_PATH)/crypto/init.c

+ $(OPENSSL_PATH)/crypto/kdf/hkdf.c

+ $(OPENSSL_PATH)/crypto/kdf/kdf_err.c

+ $(OPENSSL_PATH)/crypto/kdf/scrypt.c

+ $(OPENSSL_PATH)/crypto/kdf/tls1_prf.c

+ $(OPENSSL_PATH)/crypto/lhash/lh_stats.c

+ $(OPENSSL_PATH)/crypto/lhash/lhash.c

+ $(OPENSSL_PATH)/crypto/md5/md5_dgst.c

+ $(OPENSSL_PATH)/crypto/md5/md5_one.c

+ $(OPENSSL_PATH)/crypto/mem.c

+ $(OPENSSL_PATH)/crypto/mem_dbg.c

+ $(OPENSSL_PATH)/crypto/mem_sec.c

+ $(OPENSSL_PATH)/crypto/modes/cbc128.c

+ $(OPENSSL_PATH)/crypto/modes/ccm128.c

+ $(OPENSSL_PATH)/crypto/modes/cfb128.c

+ $(OPENSSL_PATH)/crypto/modes/ctr128.c

+ $(OPENSSL_PATH)/crypto/modes/cts128.c

+ $(OPENSSL_PATH)/crypto/modes/gcm128.c

+ $(OPENSSL_PATH)/crypto/modes/ocb128.c

+ $(OPENSSL_PATH)/crypto/modes/ofb128.c

+ $(OPENSSL_PATH)/crypto/modes/wrap128.c

+ $(OPENSSL_PATH)/crypto/modes/xts128.c

+ $(OPENSSL_PATH)/crypto/o_dir.c

+ $(OPENSSL_PATH)/crypto/o_fips.c

+ $(OPENSSL_PATH)/crypto/o_fopen.c

+ $(OPENSSL_PATH)/crypto/o_init.c

+ $(OPENSSL_PATH)/crypto/o_str.c

+ $(OPENSSL_PATH)/crypto/o_time.c

+ $(OPENSSL_PATH)/crypto/objects/o_names.c

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.c

+ $(OPENSSL_PATH)/crypto/objects/obj_err.c

+ $(OPENSSL_PATH)/crypto/objects/obj_lib.c

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c

+ $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c

+ $(OPENSSL_PATH)/crypto/pem/pem_all.c

+ $(OPENSSL_PATH)/crypto/pem/pem_err.c

+ $(OPENSSL_PATH)/crypto/pem/pem_info.c

+ $(OPENSSL_PATH)/crypto/pem/pem_lib.c

+ $(OPENSSL_PATH)/crypto/pem/pem_oth.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pk8.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pkey.c

+ $(OPENSSL_PATH)/crypto/pem/pem_sign.c

+ $(OPENSSL_PATH)/crypto/pem/pem_x509.c

+ $(OPENSSL_PATH)/crypto/pem/pem_xaux.c

+ $(OPENSSL_PATH)/crypto/pem/pvkfmt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_init.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_key.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_sbag.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c

+ $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_ctr.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_egd.c

+ $(OPENSSL_PATH)/crypto/rand/rand_err.c

+ $(OPENSSL_PATH)/crypto/rand/rand_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_unix.c

+ $(OPENSSL_PATH)/crypto/rand/rand_vms.c

+ $(OPENSSL_PATH)/crypto/rand/rand_win.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_chk.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_err.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_lib.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_meth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_mp.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_none.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ossl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_saos.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_sign.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c

+ $(OPENSSL_PATH)/crypto/sha/keccak1600.c

+ $(OPENSSL_PATH)/crypto/sha/sha1_one.c

+ $(OPENSSL_PATH)/crypto/sha/sha1dgst.c

+ $(OPENSSL_PATH)/crypto/sha/sha256.c

+ $(OPENSSL_PATH)/crypto/sha/sha512.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_ameth.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_pmeth.c

+ $(OPENSSL_PATH)/crypto/sm3/m_sm3.c

+ $(OPENSSL_PATH)/crypto/sm3/sm3.c

+ $(OPENSSL_PATH)/crypto/sm4/sm4.c

+ $(OPENSSL_PATH)/crypto/stack/stack.c

+ $(OPENSSL_PATH)/crypto/threads_none.c

+ $(OPENSSL_PATH)/crypto/threads_pthread.c

+ $(OPENSSL_PATH)/crypto/threads_win.c

+ $(OPENSSL_PATH)/crypto/txt_db/txt_db.c

+ $(OPENSSL_PATH)/crypto/ui/ui_err.c

+ $(OPENSSL_PATH)/crypto/ui/ui_lib.c

+ $(OPENSSL_PATH)/crypto/ui/ui_null.c

+ $(OPENSSL_PATH)/crypto/ui/ui_openssl.c

+ $(OPENSSL_PATH)/crypto/ui/ui_util.c

+ $(OPENSSL_PATH)/crypto/uid.c

+ $(OPENSSL_PATH)/crypto/x509/by_dir.c

+ $(OPENSSL_PATH)/crypto/x509/by_file.c

+ $(OPENSSL_PATH)/crypto/x509/t_crl.c

+ $(OPENSSL_PATH)/crypto/x509/t_req.c

+ $(OPENSSL_PATH)/crypto/x509/t_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x509_att.c

+ $(OPENSSL_PATH)/crypto/x509/x509_cmp.c

+ $(OPENSSL_PATH)/crypto/x509/x509_d2.c

+ $(OPENSSL_PATH)/crypto/x509/x509_def.c

+ $(OPENSSL_PATH)/crypto/x509/x509_err.c

+ $(OPENSSL_PATH)/crypto/x509/x509_ext.c

+ $(OPENSSL_PATH)/crypto/x509/x509_lu.c

+ $(OPENSSL_PATH)/crypto/x509/x509_meth.c

+ $(OPENSSL_PATH)/crypto/x509/x509_obj.c

+ $(OPENSSL_PATH)/crypto/x509/x509_r2x.c

+ $(OPENSSL_PATH)/crypto/x509/x509_req.c

+ $(OPENSSL_PATH)/crypto/x509/x509_set.c

+ $(OPENSSL_PATH)/crypto/x509/x509_trs.c

+ $(OPENSSL_PATH)/crypto/x509/x509_txt.c

+ $(OPENSSL_PATH)/crypto/x509/x509_v3.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vfy.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vpm.c

+ $(OPENSSL_PATH)/crypto/x509/x509cset.c

+ $(OPENSSL_PATH)/crypto/x509/x509name.c

+ $(OPENSSL_PATH)/crypto/x509/x509rset.c

+ $(OPENSSL_PATH)/crypto/x509/x509spki.c

+ $(OPENSSL_PATH)/crypto/x509/x509type.c

+ $(OPENSSL_PATH)/crypto/x509/x_all.c

+ $(OPENSSL_PATH)/crypto/x509/x_attrib.c

+ $(OPENSSL_PATH)/crypto/x509/x_crl.c

+ $(OPENSSL_PATH)/crypto/x509/x_exten.c

+ $(OPENSSL_PATH)/crypto/x509/x_name.c

+ $(OPENSSL_PATH)/crypto/x509/x_pubkey.c

+ $(OPENSSL_PATH)/crypto/x509/x_req.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509a.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_map.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_node.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_alt.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_conf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_crld.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_enum.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_extku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_genn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_info.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_int.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pci.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_prn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_purp.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_skey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_tlsf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3err.c

+ $(OPENSSL_PATH)/crypto/arm_arch.h

+ $(OPENSSL_PATH)/crypto/mips_arch.h

+ $(OPENSSL_PATH)/crypto/ppc_arch.h

+ $(OPENSSL_PATH)/crypto/s390x_arch.h

+ $(OPENSSL_PATH)/crypto/sparc_arch.h

+ $(OPENSSL_PATH)/crypto/vms_rms.h

+ $(OPENSSL_PATH)/crypto/aes/aes_local.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_local.h

+ $(OPENSSL_PATH)/crypto/asn1/charmap.h

+ $(OPENSSL_PATH)/crypto/asn1/standard_methods.h

+ $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h

+ $(OPENSSL_PATH)/crypto/async/async_local.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.h

+ $(OPENSSL_PATH)/crypto/bio/bio_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.h

+ $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h

+ $(OPENSSL_PATH)/crypto/comp/comp_local.h

+ $(OPENSSL_PATH)/crypto/conf/conf_def.h

+ $(OPENSSL_PATH)/crypto/conf/conf_local.h

+ $(OPENSSL_PATH)/crypto/dh/dh_local.h

+ $(OPENSSL_PATH)/crypto/dso/dso_local.h

+ $(OPENSSL_PATH)/crypto/evp/evp_local.h

+ $(OPENSSL_PATH)/crypto/hmac/hmac_local.h

+ $(OPENSSL_PATH)/crypto/lhash/lhash_local.h

+ $(OPENSSL_PATH)/crypto/md5/md5_local.h

+ $(OPENSSL_PATH)/crypto/modes/modes_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.h

+ $(OPENSSL_PATH)/crypto/objects/obj_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.h

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h

+ $(OPENSSL_PATH)/crypto/rand/rand_local.h

+ $(OPENSSL_PATH)/crypto/rsa/rsa_local.h

+ $(OPENSSL_PATH)/crypto/sha/sha_local.h

+ $(OPENSSL_PATH)/crypto/siphash/siphash_local.h

+ $(OPENSSL_PATH)/crypto/sm3/sm3_local.h

+ $(OPENSSL_PATH)/crypto/store/store_local.h

+ $(OPENSSL_PATH)/crypto/ui/ui_local.h

+ $(OPENSSL_PATH)/crypto/x509/x509_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h

+ $(OPENSSL_PATH)/ssl/bio_ssl.c

+ $(OPENSSL_PATH)/ssl/d1_lib.c

+ $(OPENSSL_PATH)/ssl/d1_msg.c

+ $(OPENSSL_PATH)/ssl/d1_srtp.c

+ $(OPENSSL_PATH)/ssl/methods.c

+ $(OPENSSL_PATH)/ssl/packet.c

+ $(OPENSSL_PATH)/ssl/pqueue.c

+ $(OPENSSL_PATH)/ssl/record/dtls1_bitmap.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_d1.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_s3.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_buffer.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record_tls13.c

+ $(OPENSSL_PATH)/ssl/s3_cbc.c

+ $(OPENSSL_PATH)/ssl/s3_enc.c

+ $(OPENSSL_PATH)/ssl/s3_lib.c

+ $(OPENSSL_PATH)/ssl/s3_msg.c

+ $(OPENSSL_PATH)/ssl/ssl_asn1.c

+ $(OPENSSL_PATH)/ssl/ssl_cert.c

+ $(OPENSSL_PATH)/ssl/ssl_ciph.c

+ $(OPENSSL_PATH)/ssl/ssl_conf.c

+ $(OPENSSL_PATH)/ssl/ssl_err.c

+ $(OPENSSL_PATH)/ssl/ssl_init.c

+ $(OPENSSL_PATH)/ssl/ssl_lib.c

+ $(OPENSSL_PATH)/ssl/ssl_mcnf.c

+ $(OPENSSL_PATH)/ssl/ssl_rsa.c

+ $(OPENSSL_PATH)/ssl/ssl_sess.c

+ $(OPENSSL_PATH)/ssl/ssl_stat.c

+ $(OPENSSL_PATH)/ssl/ssl_txt.c

+ $(OPENSSL_PATH)/ssl/ssl_utst.c

+ $(OPENSSL_PATH)/ssl/statem/extensions.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_cust.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_srvr.c

+ $(OPENSSL_PATH)/ssl/statem/statem.c

+ $(OPENSSL_PATH)/ssl/statem/statem_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/statem_dtls.c

+ $(OPENSSL_PATH)/ssl/statem/statem_lib.c

+ $(OPENSSL_PATH)/ssl/statem/statem_srvr.c

+ $(OPENSSL_PATH)/ssl/t1_enc.c

+ $(OPENSSL_PATH)/ssl/t1_lib.c

+ $(OPENSSL_PATH)/ssl/t1_trce.c

+ $(OPENSSL_PATH)/ssl/tls13_enc.c

+ $(OPENSSL_PATH)/ssl/tls_srp.c

+ $(OPENSSL_PATH)/ssl/packet_local.h

+ $(OPENSSL_PATH)/ssl/ssl_cert_table.h

+ $(OPENSSL_PATH)/ssl/ssl_local.h

+ $(OPENSSL_PATH)/ssl/record/record.h

+ $(OPENSSL_PATH)/ssl/record/record_local.h

+ $(OPENSSL_PATH)/ssl/statem/statem.h

+ $(OPENSSL_PATH)/ssl/statem/statem_local.h

+# Autogenerated files list ends here

+ buildinf.h

+ rand_pool_noise.h

+ ossl_store.c

+ rand_pool.c

+

+[Sources.X64]

+ rand_pool_noise_tsc.c

+ ApiHooks.c

+

+[Packages]

+ MdePkg/MdePkg.dec

+ CryptoPkg/CryptoPkg.dec

+

+[LibraryClasses]

+ BaseLib

+ DebugLib

+ TimerLib

+ PrintLib

+

+[BuildOptions]

+ #

+ # Disables the following Visual Studio compiler warnings brought
by
openssl
source,

+ # so we do not break the build with /WX option:

+ # C4090: 'function' : different 'const' qualifiers

+ # C4132: 'object' : const object should be initialized
(tls13_enc.c)

+ # C4210: nonstandard extension used: function given file scope

+ # C4244: conversion from type1 to type2, possible loss of data

+ # C4245: conversion from type1 to type2, signed/unsigned
mismatch

+ # C4267: conversion from size_t to type, possible loss of data

+ # C4306: 'identifier' : conversion from 'type1' to 'type2' of
greater
size

+ # C4310: cast truncates constant value

+ # C4389: 'operator' : signed/unsigned mismatch (xxxx)

+ # C4700: uninitialized local variable 'name' used.
(conf_sap.c(71))

+ # C4702: unreachable code

+ # C4706: assignment within conditional expression

+ # C4819: The file contains a character that cannot be
represented
in
the
current code page

+ #

+ MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /wd4090 /wd4132
/wd4210
/wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389
/wd4702
/wd4706 /wd4819

+

+ INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -
U__ICC
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /w

+

+ #

+ # Suppress the following build warnings in openssl so we don't
break
the
build
with -Werror

+ # -Werror=maybe-uninitialized: there exist some other paths
for
which
the
variable is not initialized.

+ # -Werror=format: Check calls to printf and scanf, etc., to
make
sure
that the
arguments supplied have

+ # types appropriate to the format string
specified.

+ # -Werror=unused-but-set-variable: Warn whenever a local
variable is
assigned to, but otherwise unused (aside from its declaration).

+ #

+ GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64
$(OPENSSL_FLAGS)
$(OPENSSL_FLAGS_CONFIG) -Wno-error=maybe-uninitialized -Wno-
error=format -Wno-format -Wno-error=unused-but-set-variable -
DNO_MSABI_VA_FUNCS

+

+ # suppress the following warnings in openssl so we don't break
the
build
with
warnings-as-errors:

+ # 1295: Deprecated declaration <entity> - give arg types

+ # 550: <entity> was set but never used

+ # 1293: assignment in condition

+ # 111: statement is unreachable (invariably "break;" after
"return
X;"
in case
statement)

+ # 68: integer conversion resulted in a change of sign ("if
(Status
==
-1)")

+ # 177: <entity> was declared but never referenced

+ # 223: function <entity> declared implicitly

+ # 144: a value of type <type> cannot be used to initialize an
entity
of
type
<type>

+ # 513: a value of type <type> cannot be assigned to an entity
of
type
<type>

+ # 188: enumerated type mixed with another type (i.e. passing an
integer
as an
enum without a cast)

+ # 1296: Extended constant initialiser used

+ # 128: loop is not reachable - may be emitted inappropriately
if
code
follows
a conditional return

+ # from the function that evaluates to true at compile time

+ # 546: transfer of control bypasses initialization - may be
emitted
inappropriately if the uninitialized

+ # variable is never referenced after the jump

+ # 1: ignore "#1-D: last line of file ends without a newline"

+ # 3017: <entity> may be used before being set (NOTE: This was
fixed in
OpenSSL 1.1 HEAD with

+ # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and
can
be
dropped then.)

+ XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -
U_WIN64
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) -w -std=c99 -Wno-
error=uninitialized

diff --git a/CryptoPkg/Library/Include/openssl/opensslconf.h
b/CryptoPkg/Library/Include/openssl/opensslconf.h
index 3a2544ea5c..e8f73c4d10 100644
--- a/CryptoPkg/Library/Include/openssl/opensslconf.h
+++ b/CryptoPkg/Library/Include/openssl/opensslconf.h
@@ -112,9 +112,6 @@ extern "C" {
#ifndef OPENSSL_NO_ASAN

# define OPENSSL_NO_ASAN

#endif

-#ifndef OPENSSL_NO_ASM

-# define OPENSSL_NO_ASM

-#endif

#ifndef OPENSSL_NO_ASYNC

# define OPENSSL_NO_ASYNC

#endif

diff --git a/CryptoPkg/Library/OpensslLib/ApiHooks.c
b/CryptoPkg/Library/OpensslLib/ApiHooks.c
new file mode 100644
index 0000000000..58cff16838
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/ApiHooks.c
@@ -0,0 +1,18 @@
+/** @file

+ OpenSSL Library API hooks.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+VOID *

+__imp_RtlVirtualUnwind (

+ VOID * Args

+ )

+{

+ return NULL;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
new file mode 100644
index 0000000000..ef20d2b84e
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
@@ -0,0 +1,34 @@
+/** @file

+ Constructor to initialize CPUID data for OpenSSL assembly
operations.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+extern void OPENSSL_cpuid_setup (void);

+

+/**

+ Constructor routine for OpensslLib.

+

+ The constructor calls an internal OpenSSL function which fetches
a
local
copy

+ of the hardware capability flags, used to enable native crypto
instructions.

+

+ @param None

+

+ @retval EFI_SUCCESS The construction succeeded.

+

+**/

+EFI_STATUS

+EFIAPI

+OpensslLibConstructor (

+ VOID

+ )

+{

+ OPENSSL_cpuid_setup ();

+

+ return EFI_SUCCESS;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl
b/CryptoPkg/Library/OpensslLib/process_files.pl
index 57ce195394..472f59bc8e 100755
--- a/CryptoPkg/Library/OpensslLib/process_files.pl
+++ b/CryptoPkg/Library/OpensslLib/process_files.pl
@@ -9,9 +9,63 @@
# do not need to do this, since the results are stored in the EDK2

# git repository for them.

#

+# Due to the script wrapping required to process the OpenSSL

+# configuration data, each native architecture must be processed

+# individually by the maintainer (in addition to the standard
version):

+# ./process_files.pl

+# ./process_files.pl X64

+# ./process_files.pl [Arch]

+

use strict;

use Cwd;

use File::Copy;

+use File::Basename;

+use File::Path qw(make_path remove_tree);

+use Text::Tabs;

+

+#

+# OpenSSL perlasm generator script does not transfer the copyright
header

+#

+sub copy_license_header

+{

+ my @args = split / /, shift; #Separate args by spaces

+ my $source = $args[1]; #Source file is second (after
"perl")

+ my $target = pop @args; #Target file is always last

+ chop ($target); #Remove newline char

+

+ my $temp_file_name = "license.tmp";

+ open (my $source_file, "<" . $source) || die $source;

+ open (my $target_file, "<" . $target) || die $target;

+ open (my $temp_file, ">" . $temp_file_name) || die
$temp_file_name;

+

+ #Add "generated file" warning

+ $source =~ s/^..//; #Remove leading "./"

+ print ($temp_file "; WARNING: do not edit!\r\n");

+ print ($temp_file "; Generated from $source\r\n");

+ print ($temp_file ";\r\n");

+

+ #Copy source file header to temp file

+ while (my $line = <$source_file>) {

+ next if ($line =~ /#!/); #Ignore shebang line

+ $line =~ s/#/;/; #Fix comment character for
assembly

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace,
fixup
line
endings

+ print ($temp_file $line);

+ last if ($line =~ /http/); #Last line of copyright header
contains a web link

+ }

+ print ($temp_file "\r\n");

+ #Retrieve generated assembly contents

+ while (my $line = <$target_file>) {

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace,
fixup
line
endings

+ print ($temp_file expand ($line)); #expand() replaces
tabs with
spaces

+ }

+

+ close ($source_file);

+ close ($target_file);

+ close ($temp_file);

+

+ move ($temp_file_name, $target) ||

+ die "Cannot replace \"" . $target . "\"!";

+}



#

# Find the openssl directory name for use lib. We have to do this

@@ -21,10 +75,41 @@ use File::Copy;
#

my $inf_file;

my $OPENSSL_PATH;

+my $uefi_config;

+my $extension;

+my $arch;

my @inf;



BEGIN {

$inf_file = "OpensslLib.inf";

+ $uefi_config = "UEFI";

+ $arch = shift;

+

+ if (defined $arch) {

+ if (uc ($arch) eq "X64") {

+ $arch = "X64";

+ $inf_file = "OpensslLibX64.inf";

+ $uefi_config = "UEFI-x86_64";

+ $extension = "nasm";

+ } else {

+ die "Unsupported architecture \"" . $arch . "\"!";

+ }

+ if ($extension eq "nasm") {

+ if (`nasm -v 2>&1`) {

+ #Presence of nasm executable will trigger
inclusion of
AVX
instructions

+ die "\nCannot run assembly generators with NASM in
path!\n\n";

+ }

+ }

+

+ # Prepare assembly folder

+ if (-d $arch) {

+ remove_tree ($arch, {safe => 1}) ||

+ die "Cannot clean assembly folder \"" . $arch .
"\"!";

+ } else {

+ mkdir $arch ||

+ die "Cannot create assembly folder \"" . $arch .
"\"!";

+ }

+ }



# Read the contents of the inf file

open( FD, "<" . $inf_file ) ||

@@ -47,9 +132,9 @@ BEGIN {
# Configure UEFI

system(

"./Configure",

- "UEFI",

+ "--config=../uefi-asm.conf",

+ "$uefi_config",

"no-afalgeng",

- "no-asm",

"no-async",

"no-autoerrinit",

"no-autoload-config",

@@ -129,23 +214,53 @@ BEGIN {
# Retrieve file lists from OpenSSL configdata

#

use configdata qw/%unified_info/;

+use configdata qw/%config/;

+use configdata qw/%target/;

+

+#

+# Collect build flags from configdata

+#

+my $flags = "";

+foreach my $f (@{$config{lib_defines}}) {

+ $flags .= " -D$f";

+}



my @cryptofilelist = ();

my @sslfilelist = ();

+my @asmfilelist = ();

+my @asmbuild = ();

foreach my $product ((@{$unified_info{libraries}},

@{$unified_info{engines}})) {

foreach my $o (@{$unified_info{sources}->{$product}}) {

foreach my $s (@{$unified_info{sources}->{$o}}) {

- next if ($unified_info{generate}->{$s});

- next if $s =~ "crypto/bio/b_print.c";

-

# No need to add unused files in UEFI.

# So it can reduce porting time, compile time, library
size.

+ next if $s =~ "crypto/bio/b_print.c";

next if $s =~ "crypto/rand/randfile.c";

next if $s =~ "crypto/store/";

next if $s =~ "crypto/err/err_all.c";

next if $s =~ "crypto/aes/aes_ecb.c";



+ if ($unified_info{generate}->{$s}) {

+ if (defined $arch) {

+ my $buildstring = "perl";

+ foreach my $arg (@{$unified_info{generate}-
{$s}}) {

+ if ($arg =~ ".pl") {

+ $buildstring .= " ./openssl/$arg";

+ } elsif ($arg =~ "PERLASM_SCHEME") {

+ $buildstring .= "
$target{perlasm_scheme}";

+ } elsif ($arg =~ "LIB_CFLAGS") {

+ $buildstring .= "$flags";

+ }

+ }

+ ($s, my $path, undef) = fileparse($s,
qr/\.[^.]*/);

+ $buildstring .= " ./$arch/$path$s.$extension";

+ make_path ("./$arch/$path");

+ push @asmbuild, "$buildstring\n";

+ push @asmfilelist, "
$arch/$path$s.$extension\r\n";

+ }

+ next;

+ }

if ($product =~ "libssl") {

push @sslfilelist, ' $(OPENSSL_PATH)/' . $s .
"\r\n";

next;

@@ -183,15 +298,31 @@ foreach (@headers){
}





+#

+# Generate assembly files

+#

+if (@asmbuild) {

+ print "\n--> Generating assembly files ... ";

+ foreach my $buildstring (@asmbuild) {

+ system ("$buildstring");

+ copy_license_header ($buildstring);

+ }

+ print "Done!";

+}

+

#

# Update OpensslLib.inf with autogenerated file list

#

my @new_inf = ();

my $subbing = 0;

-print "\n--> Updating OpensslLib.inf ... ";

+print "\n--> Updating $inf_file ... ";

foreach (@inf) {

+ if ($_ =~ "DEFINE OPENSSL_FLAGS_CONFIG") {

+ push @new_inf, " DEFINE OPENSSL_FLAGS_CONFIG =" .
$flags
.
"\r\n";

+ next;

+ }

if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist, @sslfilelist;

+ push @new_inf, $_, @asmfilelist, @cryptofilelist,
@sslfilelist;

$subbing = 1;

next;

}

@@ -216,49 +347,51 @@ rename( $new_inf_file, $inf_file ) ||
die "rename $inf_file";

print "Done!";



-#

-# Update OpensslLibCrypto.inf with auto-generated file list (no
libssl)

-#

-$inf_file = "OpensslLibCrypto.inf";

-

-# Read the contents of the inf file

-@inf = ();

-@new_inf = ();

-open( FD, "<" . $inf_file ) ||

- die "Cannot open \"" . $inf_file . "\"!";

-@inf = (<FD>);

-close(FD) ||

- die "Cannot close \"" . $inf_file . "\"!";

+if (!defined $arch) {

+ #

+ # Update OpensslLibCrypto.inf with auto-generated file list
(no
libssl)

+ #

+ $inf_file = "OpensslLibCrypto.inf";



-$subbing = 0;

-print "\n--> Updating OpensslLibCrypto.inf ... ";

-foreach (@inf) {

- if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist;

- $subbing = 1;

- next;

- }

- if ( $_ =~ "# Autogenerated files list ends here" ) {

- push @new_inf, $_;

- $subbing = 0;

- next;

+ # Read the contents of the inf file

+ @inf = ();

+ @new_inf = ();

+ open( FD, "<" . $inf_file ) ||

+ die "Cannot open \"" . $inf_file . "\"!";

+ @inf = (<FD>);

+ close(FD) ||

+ die "Cannot close \"" . $inf_file . "\"!";

+

+ $subbing = 0;

+ print "\n--> Updating OpensslLibCrypto.inf ... ";

+ foreach (@inf) {

+ if ( $_ =~ "# Autogenerated files list starts here" ) {

+ push @new_inf, $_, @cryptofilelist;

+ $subbing = 1;

+ next;

+ }

+ if ( $_ =~ "# Autogenerated files list ends here" ) {

+ push @new_inf, $_;

+ $subbing = 0;

+ next;

+ }

+

+ push @new_inf, $_

+ unless ($subbing);

}



- push @new_inf, $_

- unless ($subbing);

+ $new_inf_file = $inf_file . ".new";

+ open( FD, ">" . $new_inf_file ) ||

+ die $new_inf_file;

+ print( FD @new_inf ) ||

+ die $new_inf_file;

+ close(FD) ||

+ die $new_inf_file;

+ rename( $new_inf_file, $inf_file ) ||

+ die "rename $inf_file";

+ print "Done!";

}



-$new_inf_file = $inf_file . ".new";

-open( FD, ">" . $new_inf_file ) ||

- die $new_inf_file;

-print( FD @new_inf ) ||

- die $new_inf_file;

-close(FD) ||

- die $new_inf_file;

-rename( $new_inf_file, $inf_file ) ||

- die "rename $inf_file";

-print "Done!";

-

#

# Copy opensslconf.h and dso_conf.h generated from OpenSSL
Configuration

#

diff --git a/CryptoPkg/Library/OpensslLib/uefi-asm.conf
b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
new file mode 100644
index 0000000000..55eedbf3ba
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
@@ -0,0 +1,15 @@
+## -*- mode: perl; -*-

+## UEFI assembly openssl configuration targets.

+

+my %targets = (

+#### UEFI

+ "UEFI-x86_64" => {

+ perlasm_scheme => "nasm",

+ # inherit_from => [ "UEFI", asm("x86_64_asm") ],

+ inherit_from => [ "UEFI" ],

+ cpuid_asm_src => "x86_64cpuid.s",

+ aes_asm_src => "aes_core.c aes_cbc.c vpaes-x86_64.s
aesni-
x86_64.s
aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",

+ sha1_asm_src => "sha1-x86_64.s sha256-x86_64.s sha512-
x86_64.s
sha1-mb-x86_64.s sha256-mb-x86_64.s",

+ modes_asm_src => "ghash-x86_64.s",

+ },

+);

--
2.28.0.windows.1



Yao, Jiewen
 

-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, September 22, 2020 11:22 PM
To: Jiang, Guomin <guomin.jiang@...>; devel@edk2.groups.io; Yao,
Jiewen <jiewen.yao@...>
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX <xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

I have unit tested SHA1, SHA512, and AES as well.
I do not have the build environment available to test GCC and LLVM.

--
Christopher Zurcher

-----Original Message-----
From: Jiang, Guomin <guomin.jiang@...>
Sent: Wednesday, September 16, 2020 02:17
To: devel@edk2.groups.io; Yao, Jiewen <jiewen.yao@...>; Zurcher,
Christopher J <christopher.j.zurcher@...>
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

Hi Zurcher,

[Jiewen] Since you also add other sha (sha1, sha512) and aesni, I think
those
need unit test for them too.
Can you update the status about it?

[Jiewen] I think we need support build with GCC and LLVM, and with X64.
It is better to support the GCC and LLVM.

Thanks
Guomin

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao,
Jiewen
Sent: Tuesday, August 25, 2020 7:36 AM
To: Zurcher, Christopher J <christopher.j.zurcher@...>;
devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>; Ard Biesheuvel <ard.biesheuvel@...>
Subject: Re: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

Below:

-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 25, 2020 5:26 AM
To: devel@edk2.groups.io; Zurcher, Christopher J
<christopher.j.zurcher@...>; Yao, Jiewen <jiewen.yao@...>
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

1) I have confirmed that the ApiHooks.c file is still required even
without
the AVX
instructions included. The x86_64 assembly files in OpenSSL set a flag
called
$win64 and automatically include calls to the RtlVirtualUnwind function
if
NASM
is selected as the assembler scheme.

https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-
rtlvirtualunwind

I have submitted an issue against OpenSSL since I don't think using the
NASM
assembler should force the inclusion of Windows-specific API hooks, but
that
change cannot be made in OpenSSL 1.1.1 and we will have to wait for
OpenSSL 3
or later to remove the stub function.

https://github.com/openssl/openssl/issues/12712
[Jiewen] Thanks.

2) So far I have only built with VS.
[Jiewen] I think we need support build with GCC and LLVM, and with X64.


3) The X64 SHA256 implementation was successfully exercised across a
large
number of devices in a production environment as a verification step in a
multi-
GB data transfer scenario.
[Jiewen] Since you also add other sha (sha1, sha512) and aesni, I think
those
need unit test for them too.


Thanks,
Christopher Zurcher

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
Zurcher,
Christopher J
Sent: Tuesday, August 18, 2020 15:50
To: Yao, Jiewen <jiewen.yao@...>; devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: Re: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add
native
instruction support for X64

After further review, the ApiHooks.c file may no longer be needed since
we
are no longer including the AVX instructions. I will look over the
dependencies and send a new patch set if I can eliminate the API hooks
file.

Thanks,
Christopher Zurcher

-----Original Message-----
From: Yao, Jiewen <jiewen.yao@...>
Sent: Thursday, August 13, 2020 08:04
To: Zurcher, Christopher J <christopher.j.zurcher@...>;
devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction
support for X64

Hi Christopher
Thanks.

1) Would you please help me understand more on "ApiHooks.c contains
a
stub
function for a Windows API call" ?
Why we need this?
If it is compiler specific in openssl, should we submit patch to
openssl to
exclude this with OPENSSL_SYS_UEFI? That should be a cleaner solution
for
UEFI.

2) Would you please describe what compiler you have tried? VS? GCC?
LLVM?

3) Would you please describe what unit test you have done?

Thank you
Yao Jiewen


-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 4, 2020 8:24 AM
To: devel@edk2.groups.io
Cc: Yao, Jiewen <jiewen.yao@...>; Wang, Jian J
<jian.j.wang@...>;
Lu, XiaoyuX <xiaoyux.lu@...>; Ard Biesheuvel
<ard.biesheuvel@...>
Subject: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction
support
for X64

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2507

Adding OpensslLibX64.inf and modifying process_files.pl to process
this
file and generate the necessary assembly files.
ApiHooks.c contains a stub function for a Windows API call.
uefi-asm.conf contains the limited assembly configurations for
OpenSSL.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyux.lu@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Christopher J Zurcher
<christopher.j.zurcher@...>
---
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibX64.inf | 656
++++++++++++++++++++
CryptoPkg/Library/Include/openssl/opensslconf.h | 3 -
CryptoPkg/Library/OpensslLib/ApiHooks.c | 18 +
CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c | 34 +
CryptoPkg/Library/OpensslLib/process_files.pl | 223 +++++--
CryptoPkg/Library/OpensslLib/uefi-asm.conf | 15 +
8 files changed, 903 insertions(+), 50 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index dbbe5386a1..bd62d86936 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 616ccd9f62..2b7324a990 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
new file mode 100644
index 0000000000..825eea0254
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
@@ -0,0 +1,656 @@
+## @file

+# This module provides OpenSSL Library implementation.

+#

+# Copyright (c) 2010 - 2020, Intel Corporation. All rights
reserved.<BR>

+# (C) Copyright 2020 Hewlett Packard Enterprise Development
LP<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+ INF_VERSION = 0x00010005

+ BASE_NAME = OpensslLibX64

+ MODULE_UNI_FILE = OpensslLib.uni

+ FILE_GUID = 18125E50-0117-4DD0-BE54-
4784AD995FEF

+ MODULE_TYPE = BASE

+ VERSION_STRING = 1.0

+ LIBRARY_CLASS = OpensslLib

+ DEFINE OPENSSL_PATH = openssl

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS_CONFIG = -DOPENSSL_CPUID_OBJ -
DSHA1_ASM -
DSHA256_ASM -DSHA512_ASM -DAESNI_ASM -DVPAES_ASM -
DGHASH_ASM

+ CONSTRUCTOR = OpensslLibConstructor

+

+#

+# VALID_ARCHITECTURES = X64

+#

+

+[Sources]

+ OpensslLibConstructor.c

+ $(OPENSSL_PATH)/e_os.h

+ $(OPENSSL_PATH)/ms/uplink.h

+# Autogenerated files list starts here

+ X64/crypto/aes/aesni-mb-x86_64.nasm

+ X64/crypto/aes/aesni-sha1-x86_64.nasm

+ X64/crypto/aes/aesni-sha256-x86_64.nasm

+ X64/crypto/aes/aesni-x86_64.nasm

+ X64/crypto/aes/vpaes-x86_64.nasm

+ X64/crypto/modes/ghash-x86_64.nasm

+ X64/crypto/sha/sha1-mb-x86_64.nasm

+ X64/crypto/sha/sha1-x86_64.nasm

+ X64/crypto/sha/sha256-mb-x86_64.nasm

+ X64/crypto/sha/sha256-x86_64.nasm

+ X64/crypto/sha/sha512-x86_64.nasm

+ X64/crypto/x86_64cpuid.nasm

+ $(OPENSSL_PATH)/crypto/aes/aes_cbc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_cfb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_core.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ige.c

+ $(OPENSSL_PATH)/crypto/aes/aes_misc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ofb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_wrap.c

+ $(OPENSSL_PATH)/crypto/aria/aria.c

+ $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_digest.c

+ $(OPENSSL_PATH)/crypto/asn1/a_dup.c

+ $(OPENSSL_PATH)/crypto/asn1/a_gentm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_int.c

+ $(OPENSSL_PATH)/crypto/asn1/a_mbstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_object.c

+ $(OPENSSL_PATH)/crypto/asn1/a_octet.c

+ $(OPENSSL_PATH)/crypto/asn1/a_print.c

+ $(OPENSSL_PATH)/crypto/asn1/a_sign.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strex.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strnid.c

+ $(OPENSSL_PATH)/crypto/asn1/a_time.c

+ $(OPENSSL_PATH)/crypto/asn1/a_type.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utctm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utf8.c

+ $(OPENSSL_PATH)/crypto/asn1/a_verify.c

+ $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_err.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_par.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mime.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_moid.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mstbl.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_pack.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/evp_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/f_int.c

+ $(OPENSSL_PATH)/crypto/asn1/f_string.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/n_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/nsseq.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbe.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_scrypt.c

+ $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_bitst.c

+ $(OPENSSL_PATH)/crypto/asn1/t_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_dec.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_enc.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_fre.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_new.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_scn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c

+ $(OPENSSL_PATH)/crypto/asn1/x_algor.c

+ $(OPENSSL_PATH)/crypto/asn1/x_bignum.c

+ $(OPENSSL_PATH)/crypto/asn1/x_info.c

+ $(OPENSSL_PATH)/crypto/asn1/x_int64.c

+ $(OPENSSL_PATH)/crypto/asn1/x_long.c

+ $(OPENSSL_PATH)/crypto/asn1/x_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/x_sig.c

+ $(OPENSSL_PATH)/crypto/asn1/x_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/x_val.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.c

+ $(OPENSSL_PATH)/crypto/async/async.c

+ $(OPENSSL_PATH)/crypto/async/async_err.c

+ $(OPENSSL_PATH)/crypto/async/async_wait.c

+ $(OPENSSL_PATH)/crypto/bio/b_addr.c

+ $(OPENSSL_PATH)/crypto/bio/b_dump.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock2.c

+ $(OPENSSL_PATH)/crypto/bio/bf_buff.c

+ $(OPENSSL_PATH)/crypto/bio/bf_lbuf.c

+ $(OPENSSL_PATH)/crypto/bio/bf_nbio.c

+ $(OPENSSL_PATH)/crypto/bio/bf_null.c

+ $(OPENSSL_PATH)/crypto/bio/bio_cb.c

+ $(OPENSSL_PATH)/crypto/bio/bio_err.c

+ $(OPENSSL_PATH)/crypto/bio/bio_lib.c

+ $(OPENSSL_PATH)/crypto/bio/bio_meth.c

+ $(OPENSSL_PATH)/crypto/bio/bss_acpt.c

+ $(OPENSSL_PATH)/crypto/bio/bss_bio.c

+ $(OPENSSL_PATH)/crypto/bio/bss_conn.c

+ $(OPENSSL_PATH)/crypto/bio/bss_dgram.c

+ $(OPENSSL_PATH)/crypto/bio/bss_fd.c

+ $(OPENSSL_PATH)/crypto/bio/bss_file.c

+ $(OPENSSL_PATH)/crypto/bio/bss_log.c

+ $(OPENSSL_PATH)/crypto/bio/bss_mem.c

+ $(OPENSSL_PATH)/crypto/bio/bss_null.c

+ $(OPENSSL_PATH)/crypto/bio/bss_sock.c

+ $(OPENSSL_PATH)/crypto/bn/bn_add.c

+ $(OPENSSL_PATH)/crypto/bn/bn_asm.c

+ $(OPENSSL_PATH)/crypto/bn/bn_blind.c

+ $(OPENSSL_PATH)/crypto/bn/bn_const.c

+ $(OPENSSL_PATH)/crypto/bn/bn_ctx.c

+ $(OPENSSL_PATH)/crypto/bn/bn_depr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_dh.c

+ $(OPENSSL_PATH)/crypto/bn/bn_div.c

+ $(OPENSSL_PATH)/crypto/bn/bn_err.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp2.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gcd.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gf2m.c

+ $(OPENSSL_PATH)/crypto/bn/bn_intern.c

+ $(OPENSSL_PATH)/crypto/bn/bn_kron.c

+ $(OPENSSL_PATH)/crypto/bn/bn_lib.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mod.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mont.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mpi.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mul.c

+ $(OPENSSL_PATH)/crypto/bn/bn_nist.c

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.c

+ $(OPENSSL_PATH)/crypto/bn/bn_print.c

+ $(OPENSSL_PATH)/crypto/bn/bn_rand.c

+ $(OPENSSL_PATH)/crypto/bn/bn_recp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_shift.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqrt.c

+ $(OPENSSL_PATH)/crypto/bn/bn_srp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_word.c

+ $(OPENSSL_PATH)/crypto/bn/bn_x931p.c

+ $(OPENSSL_PATH)/crypto/buffer/buf_err.c

+ $(OPENSSL_PATH)/crypto/buffer/buffer.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c

+ $(OPENSSL_PATH)/crypto/cmac/cmac.c

+ $(OPENSSL_PATH)/crypto/comp/c_zlib.c

+ $(OPENSSL_PATH)/crypto/comp/comp_err.c

+ $(OPENSSL_PATH)/crypto/comp/comp_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_api.c

+ $(OPENSSL_PATH)/crypto/conf/conf_def.c

+ $(OPENSSL_PATH)/crypto/conf/conf_err.c

+ $(OPENSSL_PATH)/crypto/conf/conf_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mall.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mod.c

+ $(OPENSSL_PATH)/crypto/conf/conf_sap.c

+ $(OPENSSL_PATH)/crypto/conf/conf_ssl.c

+ $(OPENSSL_PATH)/crypto/cpt_err.c

+ $(OPENSSL_PATH)/crypto/cryptlib.c

+ $(OPENSSL_PATH)/crypto/ctype.c

+ $(OPENSSL_PATH)/crypto/cversion.c

+ $(OPENSSL_PATH)/crypto/dh/dh_ameth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_asn1.c

+ $(OPENSSL_PATH)/crypto/dh/dh_check.c

+ $(OPENSSL_PATH)/crypto/dh/dh_depr.c

+ $(OPENSSL_PATH)/crypto/dh/dh_err.c

+ $(OPENSSL_PATH)/crypto/dh/dh_gen.c

+ $(OPENSSL_PATH)/crypto/dh/dh_kdf.c

+ $(OPENSSL_PATH)/crypto/dh/dh_key.c

+ $(OPENSSL_PATH)/crypto/dh/dh_lib.c

+ $(OPENSSL_PATH)/crypto/dh/dh_meth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_prn.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c

+ $(OPENSSL_PATH)/crypto/dso/dso_err.c

+ $(OPENSSL_PATH)/crypto/dso/dso_lib.c

+ $(OPENSSL_PATH)/crypto/dso/dso_openssl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_vms.c

+ $(OPENSSL_PATH)/crypto/dso/dso_win32.c

+ $(OPENSSL_PATH)/crypto/ebcdic.c

+ $(OPENSSL_PATH)/crypto/err/err.c

+ $(OPENSSL_PATH)/crypto/err/err_prn.c

+ $(OPENSSL_PATH)/crypto/evp/bio_b64.c

+ $(OPENSSL_PATH)/crypto/evp/bio_enc.c

+ $(OPENSSL_PATH)/crypto/evp/bio_md.c

+ $(OPENSSL_PATH)/crypto/evp/bio_ok.c

+ $(OPENSSL_PATH)/crypto/evp/c_allc.c

+ $(OPENSSL_PATH)/crypto/evp/c_alld.c

+ $(OPENSSL_PATH)/crypto/evp/cmeth_lib.c

+ $(OPENSSL_PATH)/crypto/evp/digest.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c

+ $(OPENSSL_PATH)/crypto/evp/e_aria.c

+ $(OPENSSL_PATH)/crypto/evp/e_bf.c

+ $(OPENSSL_PATH)/crypto/evp/e_camellia.c

+ $(OPENSSL_PATH)/crypto/evp/e_cast.c

+ $(OPENSSL_PATH)/crypto/evp/e_chacha20_poly1305.c

+ $(OPENSSL_PATH)/crypto/evp/e_des.c

+ $(OPENSSL_PATH)/crypto/evp/e_des3.c

+ $(OPENSSL_PATH)/crypto/evp/e_idea.c

+ $(OPENSSL_PATH)/crypto/evp/e_null.c

+ $(OPENSSL_PATH)/crypto/evp/e_old.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc2.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc5.c

+ $(OPENSSL_PATH)/crypto/evp/e_seed.c

+ $(OPENSSL_PATH)/crypto/evp/e_sm4.c

+ $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c

+ $(OPENSSL_PATH)/crypto/evp/encode.c

+ $(OPENSSL_PATH)/crypto/evp/evp_cnf.c

+ $(OPENSSL_PATH)/crypto/evp/evp_enc.c

+ $(OPENSSL_PATH)/crypto/evp/evp_err.c

+ $(OPENSSL_PATH)/crypto/evp/evp_key.c

+ $(OPENSSL_PATH)/crypto/evp/evp_lib.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pbe.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pkey.c

+ $(OPENSSL_PATH)/crypto/evp/m_md2.c

+ $(OPENSSL_PATH)/crypto/evp/m_md4.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_mdc2.c

+ $(OPENSSL_PATH)/crypto/evp/m_null.c

+ $(OPENSSL_PATH)/crypto/evp/m_ripemd.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha3.c

+ $(OPENSSL_PATH)/crypto/evp/m_sigver.c

+ $(OPENSSL_PATH)/crypto/evp/m_wp.c

+ $(OPENSSL_PATH)/crypto/evp/names.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c

+ $(OPENSSL_PATH)/crypto/evp/p_dec.c

+ $(OPENSSL_PATH)/crypto/evp/p_enc.c

+ $(OPENSSL_PATH)/crypto/evp/p_lib.c

+ $(OPENSSL_PATH)/crypto/evp/p_open.c

+ $(OPENSSL_PATH)/crypto/evp/p_seal.c

+ $(OPENSSL_PATH)/crypto/evp/p_sign.c

+ $(OPENSSL_PATH)/crypto/evp/p_verify.c

+ $(OPENSSL_PATH)/crypto/evp/pbe_scrypt.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c

+ $(OPENSSL_PATH)/crypto/ex_data.c

+ $(OPENSSL_PATH)/crypto/getenv.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c

+ $(OPENSSL_PATH)/crypto/hmac/hmac.c

+ $(OPENSSL_PATH)/crypto/init.c

+ $(OPENSSL_PATH)/crypto/kdf/hkdf.c

+ $(OPENSSL_PATH)/crypto/kdf/kdf_err.c

+ $(OPENSSL_PATH)/crypto/kdf/scrypt.c

+ $(OPENSSL_PATH)/crypto/kdf/tls1_prf.c

+ $(OPENSSL_PATH)/crypto/lhash/lh_stats.c

+ $(OPENSSL_PATH)/crypto/lhash/lhash.c

+ $(OPENSSL_PATH)/crypto/md5/md5_dgst.c

+ $(OPENSSL_PATH)/crypto/md5/md5_one.c

+ $(OPENSSL_PATH)/crypto/mem.c

+ $(OPENSSL_PATH)/crypto/mem_dbg.c

+ $(OPENSSL_PATH)/crypto/mem_sec.c

+ $(OPENSSL_PATH)/crypto/modes/cbc128.c

+ $(OPENSSL_PATH)/crypto/modes/ccm128.c

+ $(OPENSSL_PATH)/crypto/modes/cfb128.c

+ $(OPENSSL_PATH)/crypto/modes/ctr128.c

+ $(OPENSSL_PATH)/crypto/modes/cts128.c

+ $(OPENSSL_PATH)/crypto/modes/gcm128.c

+ $(OPENSSL_PATH)/crypto/modes/ocb128.c

+ $(OPENSSL_PATH)/crypto/modes/ofb128.c

+ $(OPENSSL_PATH)/crypto/modes/wrap128.c

+ $(OPENSSL_PATH)/crypto/modes/xts128.c

+ $(OPENSSL_PATH)/crypto/o_dir.c

+ $(OPENSSL_PATH)/crypto/o_fips.c

+ $(OPENSSL_PATH)/crypto/o_fopen.c

+ $(OPENSSL_PATH)/crypto/o_init.c

+ $(OPENSSL_PATH)/crypto/o_str.c

+ $(OPENSSL_PATH)/crypto/o_time.c

+ $(OPENSSL_PATH)/crypto/objects/o_names.c

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.c

+ $(OPENSSL_PATH)/crypto/objects/obj_err.c

+ $(OPENSSL_PATH)/crypto/objects/obj_lib.c

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c

+ $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c

+ $(OPENSSL_PATH)/crypto/pem/pem_all.c

+ $(OPENSSL_PATH)/crypto/pem/pem_err.c

+ $(OPENSSL_PATH)/crypto/pem/pem_info.c

+ $(OPENSSL_PATH)/crypto/pem/pem_lib.c

+ $(OPENSSL_PATH)/crypto/pem/pem_oth.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pk8.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pkey.c

+ $(OPENSSL_PATH)/crypto/pem/pem_sign.c

+ $(OPENSSL_PATH)/crypto/pem/pem_x509.c

+ $(OPENSSL_PATH)/crypto/pem/pem_xaux.c

+ $(OPENSSL_PATH)/crypto/pem/pvkfmt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_init.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_key.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_sbag.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c

+ $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_ctr.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_egd.c

+ $(OPENSSL_PATH)/crypto/rand/rand_err.c

+ $(OPENSSL_PATH)/crypto/rand/rand_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_unix.c

+ $(OPENSSL_PATH)/crypto/rand/rand_vms.c

+ $(OPENSSL_PATH)/crypto/rand/rand_win.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_chk.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_err.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_lib.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_meth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_mp.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_none.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ossl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_saos.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_sign.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c

+ $(OPENSSL_PATH)/crypto/sha/keccak1600.c

+ $(OPENSSL_PATH)/crypto/sha/sha1_one.c

+ $(OPENSSL_PATH)/crypto/sha/sha1dgst.c

+ $(OPENSSL_PATH)/crypto/sha/sha256.c

+ $(OPENSSL_PATH)/crypto/sha/sha512.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_ameth.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_pmeth.c

+ $(OPENSSL_PATH)/crypto/sm3/m_sm3.c

+ $(OPENSSL_PATH)/crypto/sm3/sm3.c

+ $(OPENSSL_PATH)/crypto/sm4/sm4.c

+ $(OPENSSL_PATH)/crypto/stack/stack.c

+ $(OPENSSL_PATH)/crypto/threads_none.c

+ $(OPENSSL_PATH)/crypto/threads_pthread.c

+ $(OPENSSL_PATH)/crypto/threads_win.c

+ $(OPENSSL_PATH)/crypto/txt_db/txt_db.c

+ $(OPENSSL_PATH)/crypto/ui/ui_err.c

+ $(OPENSSL_PATH)/crypto/ui/ui_lib.c

+ $(OPENSSL_PATH)/crypto/ui/ui_null.c

+ $(OPENSSL_PATH)/crypto/ui/ui_openssl.c

+ $(OPENSSL_PATH)/crypto/ui/ui_util.c

+ $(OPENSSL_PATH)/crypto/uid.c

+ $(OPENSSL_PATH)/crypto/x509/by_dir.c

+ $(OPENSSL_PATH)/crypto/x509/by_file.c

+ $(OPENSSL_PATH)/crypto/x509/t_crl.c

+ $(OPENSSL_PATH)/crypto/x509/t_req.c

+ $(OPENSSL_PATH)/crypto/x509/t_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x509_att.c

+ $(OPENSSL_PATH)/crypto/x509/x509_cmp.c

+ $(OPENSSL_PATH)/crypto/x509/x509_d2.c

+ $(OPENSSL_PATH)/crypto/x509/x509_def.c

+ $(OPENSSL_PATH)/crypto/x509/x509_err.c

+ $(OPENSSL_PATH)/crypto/x509/x509_ext.c

+ $(OPENSSL_PATH)/crypto/x509/x509_lu.c

+ $(OPENSSL_PATH)/crypto/x509/x509_meth.c

+ $(OPENSSL_PATH)/crypto/x509/x509_obj.c

+ $(OPENSSL_PATH)/crypto/x509/x509_r2x.c

+ $(OPENSSL_PATH)/crypto/x509/x509_req.c

+ $(OPENSSL_PATH)/crypto/x509/x509_set.c

+ $(OPENSSL_PATH)/crypto/x509/x509_trs.c

+ $(OPENSSL_PATH)/crypto/x509/x509_txt.c

+ $(OPENSSL_PATH)/crypto/x509/x509_v3.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vfy.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vpm.c

+ $(OPENSSL_PATH)/crypto/x509/x509cset.c

+ $(OPENSSL_PATH)/crypto/x509/x509name.c

+ $(OPENSSL_PATH)/crypto/x509/x509rset.c

+ $(OPENSSL_PATH)/crypto/x509/x509spki.c

+ $(OPENSSL_PATH)/crypto/x509/x509type.c

+ $(OPENSSL_PATH)/crypto/x509/x_all.c

+ $(OPENSSL_PATH)/crypto/x509/x_attrib.c

+ $(OPENSSL_PATH)/crypto/x509/x_crl.c

+ $(OPENSSL_PATH)/crypto/x509/x_exten.c

+ $(OPENSSL_PATH)/crypto/x509/x_name.c

+ $(OPENSSL_PATH)/crypto/x509/x_pubkey.c

+ $(OPENSSL_PATH)/crypto/x509/x_req.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509a.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_map.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_node.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_alt.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_conf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_crld.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_enum.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_extku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_genn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_info.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_int.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pci.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_prn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_purp.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_skey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_tlsf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3err.c

+ $(OPENSSL_PATH)/crypto/arm_arch.h

+ $(OPENSSL_PATH)/crypto/mips_arch.h

+ $(OPENSSL_PATH)/crypto/ppc_arch.h

+ $(OPENSSL_PATH)/crypto/s390x_arch.h

+ $(OPENSSL_PATH)/crypto/sparc_arch.h

+ $(OPENSSL_PATH)/crypto/vms_rms.h

+ $(OPENSSL_PATH)/crypto/aes/aes_local.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_local.h

+ $(OPENSSL_PATH)/crypto/asn1/charmap.h

+ $(OPENSSL_PATH)/crypto/asn1/standard_methods.h

+ $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h

+ $(OPENSSL_PATH)/crypto/async/async_local.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.h

+ $(OPENSSL_PATH)/crypto/bio/bio_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.h

+ $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h

+ $(OPENSSL_PATH)/crypto/comp/comp_local.h

+ $(OPENSSL_PATH)/crypto/conf/conf_def.h

+ $(OPENSSL_PATH)/crypto/conf/conf_local.h

+ $(OPENSSL_PATH)/crypto/dh/dh_local.h

+ $(OPENSSL_PATH)/crypto/dso/dso_local.h

+ $(OPENSSL_PATH)/crypto/evp/evp_local.h

+ $(OPENSSL_PATH)/crypto/hmac/hmac_local.h

+ $(OPENSSL_PATH)/crypto/lhash/lhash_local.h

+ $(OPENSSL_PATH)/crypto/md5/md5_local.h

+ $(OPENSSL_PATH)/crypto/modes/modes_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.h

+ $(OPENSSL_PATH)/crypto/objects/obj_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.h

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h

+ $(OPENSSL_PATH)/crypto/rand/rand_local.h

+ $(OPENSSL_PATH)/crypto/rsa/rsa_local.h

+ $(OPENSSL_PATH)/crypto/sha/sha_local.h

+ $(OPENSSL_PATH)/crypto/siphash/siphash_local.h

+ $(OPENSSL_PATH)/crypto/sm3/sm3_local.h

+ $(OPENSSL_PATH)/crypto/store/store_local.h

+ $(OPENSSL_PATH)/crypto/ui/ui_local.h

+ $(OPENSSL_PATH)/crypto/x509/x509_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h

+ $(OPENSSL_PATH)/ssl/bio_ssl.c

+ $(OPENSSL_PATH)/ssl/d1_lib.c

+ $(OPENSSL_PATH)/ssl/d1_msg.c

+ $(OPENSSL_PATH)/ssl/d1_srtp.c

+ $(OPENSSL_PATH)/ssl/methods.c

+ $(OPENSSL_PATH)/ssl/packet.c

+ $(OPENSSL_PATH)/ssl/pqueue.c

+ $(OPENSSL_PATH)/ssl/record/dtls1_bitmap.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_d1.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_s3.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_buffer.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record_tls13.c

+ $(OPENSSL_PATH)/ssl/s3_cbc.c

+ $(OPENSSL_PATH)/ssl/s3_enc.c

+ $(OPENSSL_PATH)/ssl/s3_lib.c

+ $(OPENSSL_PATH)/ssl/s3_msg.c

+ $(OPENSSL_PATH)/ssl/ssl_asn1.c

+ $(OPENSSL_PATH)/ssl/ssl_cert.c

+ $(OPENSSL_PATH)/ssl/ssl_ciph.c

+ $(OPENSSL_PATH)/ssl/ssl_conf.c

+ $(OPENSSL_PATH)/ssl/ssl_err.c

+ $(OPENSSL_PATH)/ssl/ssl_init.c

+ $(OPENSSL_PATH)/ssl/ssl_lib.c

+ $(OPENSSL_PATH)/ssl/ssl_mcnf.c

+ $(OPENSSL_PATH)/ssl/ssl_rsa.c

+ $(OPENSSL_PATH)/ssl/ssl_sess.c

+ $(OPENSSL_PATH)/ssl/ssl_stat.c

+ $(OPENSSL_PATH)/ssl/ssl_txt.c

+ $(OPENSSL_PATH)/ssl/ssl_utst.c

+ $(OPENSSL_PATH)/ssl/statem/extensions.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_cust.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_srvr.c

+ $(OPENSSL_PATH)/ssl/statem/statem.c

+ $(OPENSSL_PATH)/ssl/statem/statem_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/statem_dtls.c

+ $(OPENSSL_PATH)/ssl/statem/statem_lib.c

+ $(OPENSSL_PATH)/ssl/statem/statem_srvr.c

+ $(OPENSSL_PATH)/ssl/t1_enc.c

+ $(OPENSSL_PATH)/ssl/t1_lib.c

+ $(OPENSSL_PATH)/ssl/t1_trce.c

+ $(OPENSSL_PATH)/ssl/tls13_enc.c

+ $(OPENSSL_PATH)/ssl/tls_srp.c

+ $(OPENSSL_PATH)/ssl/packet_local.h

+ $(OPENSSL_PATH)/ssl/ssl_cert_table.h

+ $(OPENSSL_PATH)/ssl/ssl_local.h

+ $(OPENSSL_PATH)/ssl/record/record.h

+ $(OPENSSL_PATH)/ssl/record/record_local.h

+ $(OPENSSL_PATH)/ssl/statem/statem.h

+ $(OPENSSL_PATH)/ssl/statem/statem_local.h

+# Autogenerated files list ends here

+ buildinf.h

+ rand_pool_noise.h

+ ossl_store.c

+ rand_pool.c

+

+[Sources.X64]

+ rand_pool_noise_tsc.c

+ ApiHooks.c

+

+[Packages]

+ MdePkg/MdePkg.dec

+ CryptoPkg/CryptoPkg.dec

+

+[LibraryClasses]

+ BaseLib

+ DebugLib

+ TimerLib

+ PrintLib

+

+[BuildOptions]

+ #

+ # Disables the following Visual Studio compiler warnings brought
by
openssl
source,

+ # so we do not break the build with /WX option:

+ # C4090: 'function' : different 'const' qualifiers

+ # C4132: 'object' : const object should be initialized
(tls13_enc.c)

+ # C4210: nonstandard extension used: function given file scope

+ # C4244: conversion from type1 to type2, possible loss of data

+ # C4245: conversion from type1 to type2, signed/unsigned
mismatch

+ # C4267: conversion from size_t to type, possible loss of data

+ # C4306: 'identifier' : conversion from 'type1' to 'type2' of
greater
size

+ # C4310: cast truncates constant value

+ # C4389: 'operator' : signed/unsigned mismatch (xxxx)

+ # C4700: uninitialized local variable 'name' used.
(conf_sap.c(71))

+ # C4702: unreachable code

+ # C4706: assignment within conditional expression

+ # C4819: The file contains a character that cannot be
represented
in
the
current code page

+ #

+ MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /wd4090 /wd4132
/wd4210
/wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389
/wd4702
/wd4706 /wd4819

+

+ INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -
U__ICC
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /w

+

+ #

+ # Suppress the following build warnings in openssl so we don't
break
the
build
with -Werror

+ # -Werror=maybe-uninitialized: there exist some other paths
for
which
the
variable is not initialized.

+ # -Werror=format: Check calls to printf and scanf, etc., to
make
sure
that the
arguments supplied have

+ # types appropriate to the format string
specified.

+ # -Werror=unused-but-set-variable: Warn whenever a local
variable is
assigned to, but otherwise unused (aside from its declaration).

+ #

+ GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64
$(OPENSSL_FLAGS)
$(OPENSSL_FLAGS_CONFIG) -Wno-error=maybe-uninitialized -Wno-
error=format -Wno-format -Wno-error=unused-but-set-variable -
DNO_MSABI_VA_FUNCS

+

+ # suppress the following warnings in openssl so we don't break
the
build
with
warnings-as-errors:

+ # 1295: Deprecated declaration <entity> - give arg types

+ # 550: <entity> was set but never used

+ # 1293: assignment in condition

+ # 111: statement is unreachable (invariably "break;" after
"return
X;"
in case
statement)

+ # 68: integer conversion resulted in a change of sign ("if
(Status
==
-1)")

+ # 177: <entity> was declared but never referenced

+ # 223: function <entity> declared implicitly

+ # 144: a value of type <type> cannot be used to initialize an
entity
of
type
<type>

+ # 513: a value of type <type> cannot be assigned to an entity
of
type
<type>

+ # 188: enumerated type mixed with another type (i.e. passing an
integer
as an
enum without a cast)

+ # 1296: Extended constant initialiser used

+ # 128: loop is not reachable - may be emitted inappropriately
if
code
follows
a conditional return

+ # from the function that evaluates to true at compile time

+ # 546: transfer of control bypasses initialization - may be
emitted
inappropriately if the uninitialized

+ # variable is never referenced after the jump

+ # 1: ignore "#1-D: last line of file ends without a newline"

+ # 3017: <entity> may be used before being set (NOTE: This was
fixed in
OpenSSL 1.1 HEAD with

+ # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and
can
be
dropped then.)

+ XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -
U_WIN64
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) -w -std=c99 -Wno-
error=uninitialized

diff --git a/CryptoPkg/Library/Include/openssl/opensslconf.h
b/CryptoPkg/Library/Include/openssl/opensslconf.h
index 3a2544ea5c..e8f73c4d10 100644
--- a/CryptoPkg/Library/Include/openssl/opensslconf.h
+++ b/CryptoPkg/Library/Include/openssl/opensslconf.h
@@ -112,9 +112,6 @@ extern "C" {
#ifndef OPENSSL_NO_ASAN

# define OPENSSL_NO_ASAN

#endif

-#ifndef OPENSSL_NO_ASM

-# define OPENSSL_NO_ASM

-#endif

#ifndef OPENSSL_NO_ASYNC

# define OPENSSL_NO_ASYNC

#endif

diff --git a/CryptoPkg/Library/OpensslLib/ApiHooks.c
b/CryptoPkg/Library/OpensslLib/ApiHooks.c
new file mode 100644
index 0000000000..58cff16838
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/ApiHooks.c
@@ -0,0 +1,18 @@
+/** @file

+ OpenSSL Library API hooks.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+VOID *

+__imp_RtlVirtualUnwind (

+ VOID * Args

+ )

+{

+ return NULL;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
new file mode 100644
index 0000000000..ef20d2b84e
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
@@ -0,0 +1,34 @@
+/** @file

+ Constructor to initialize CPUID data for OpenSSL assembly
operations.

+

+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+extern void OPENSSL_cpuid_setup (void);

+

+/**

+ Constructor routine for OpensslLib.

+

+ The constructor calls an internal OpenSSL function which fetches
a
local
copy

+ of the hardware capability flags, used to enable native crypto
instructions.

+

+ @param None

+

+ @retval EFI_SUCCESS The construction succeeded.

+

+**/

+EFI_STATUS

+EFIAPI

+OpensslLibConstructor (

+ VOID

+ )

+{

+ OPENSSL_cpuid_setup ();

+

+ return EFI_SUCCESS;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl
b/CryptoPkg/Library/OpensslLib/process_files.pl
index 57ce195394..472f59bc8e 100755
--- a/CryptoPkg/Library/OpensslLib/process_files.pl
+++ b/CryptoPkg/Library/OpensslLib/process_files.pl
@@ -9,9 +9,63 @@
# do not need to do this, since the results are stored in the EDK2

# git repository for them.

#

+# Due to the script wrapping required to process the OpenSSL

+# configuration data, each native architecture must be processed

+# individually by the maintainer (in addition to the standard
version):

+# ./process_files.pl

+# ./process_files.pl X64

+# ./process_files.pl [Arch]

+

use strict;

use Cwd;

use File::Copy;

+use File::Basename;

+use File::Path qw(make_path remove_tree);

+use Text::Tabs;

+

+#

+# OpenSSL perlasm generator script does not transfer the copyright
header

+#

+sub copy_license_header

+{

+ my @args = split / /, shift; #Separate args by spaces

+ my $source = $args[1]; #Source file is second (after
"perl")

+ my $target = pop @args; #Target file is always last

+ chop ($target); #Remove newline char

+

+ my $temp_file_name = "license.tmp";

+ open (my $source_file, "<" . $source) || die $source;

+ open (my $target_file, "<" . $target) || die $target;

+ open (my $temp_file, ">" . $temp_file_name) || die
$temp_file_name;

+

+ #Add "generated file" warning

+ $source =~ s/^..//; #Remove leading "./"

+ print ($temp_file "; WARNING: do not edit!\r\n");

+ print ($temp_file "; Generated from $source\r\n");

+ print ($temp_file ";\r\n");

+

+ #Copy source file header to temp file

+ while (my $line = <$source_file>) {

+ next if ($line =~ /#!/); #Ignore shebang line

+ $line =~ s/#/;/; #Fix comment character for
assembly

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace,
fixup
line
endings

+ print ($temp_file $line);

+ last if ($line =~ /http/); #Last line of copyright header
contains a web link

+ }

+ print ($temp_file "\r\n");

+ #Retrieve generated assembly contents

+ while (my $line = <$target_file>) {

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace,
fixup
line
endings

+ print ($temp_file expand ($line)); #expand() replaces
tabs with
spaces

+ }

+

+ close ($source_file);

+ close ($target_file);

+ close ($temp_file);

+

+ move ($temp_file_name, $target) ||

+ die "Cannot replace \"" . $target . "\"!";

+}



#

# Find the openssl directory name for use lib. We have to do this

@@ -21,10 +75,41 @@ use File::Copy;
#

my $inf_file;

my $OPENSSL_PATH;

+my $uefi_config;

+my $extension;

+my $arch;

my @inf;



BEGIN {

$inf_file = "OpensslLib.inf";

+ $uefi_config = "UEFI";

+ $arch = shift;

+

+ if (defined $arch) {

+ if (uc ($arch) eq "X64") {

+ $arch = "X64";

+ $inf_file = "OpensslLibX64.inf";

+ $uefi_config = "UEFI-x86_64";

+ $extension = "nasm";

+ } else {

+ die "Unsupported architecture \"" . $arch . "\"!";

+ }

+ if ($extension eq "nasm") {

+ if (`nasm -v 2>&1`) {

+ #Presence of nasm executable will trigger
inclusion of
AVX
instructions

+ die "\nCannot run assembly generators with NASM in
path!\n\n";

+ }

+ }

+

+ # Prepare assembly folder

+ if (-d $arch) {

+ remove_tree ($arch, {safe => 1}) ||

+ die "Cannot clean assembly folder \"" . $arch .
"\"!";

+ } else {

+ mkdir $arch ||

+ die "Cannot create assembly folder \"" . $arch .
"\"!";

+ }

+ }



# Read the contents of the inf file

open( FD, "<" . $inf_file ) ||

@@ -47,9 +132,9 @@ BEGIN {
# Configure UEFI

system(

"./Configure",

- "UEFI",

+ "--config=../uefi-asm.conf",

+ "$uefi_config",

"no-afalgeng",

- "no-asm",

"no-async",

"no-autoerrinit",

"no-autoload-config",

@@ -129,23 +214,53 @@ BEGIN {
# Retrieve file lists from OpenSSL configdata

#

use configdata qw/%unified_info/;

+use configdata qw/%config/;

+use configdata qw/%target/;

+

+#

+# Collect build flags from configdata

+#

+my $flags = "";

+foreach my $f (@{$config{lib_defines}}) {

+ $flags .= " -D$f";

+}



my @cryptofilelist = ();

my @sslfilelist = ();

+my @asmfilelist = ();

+my @asmbuild = ();

foreach my $product ((@{$unified_info{libraries}},

@{$unified_info{engines}})) {

foreach my $o (@{$unified_info{sources}->{$product}}) {

foreach my $s (@{$unified_info{sources}->{$o}}) {

- next if ($unified_info{generate}->{$s});

- next if $s =~ "crypto/bio/b_print.c";

-

# No need to add unused files in UEFI.

# So it can reduce porting time, compile time, library
size.

+ next if $s =~ "crypto/bio/b_print.c";

next if $s =~ "crypto/rand/randfile.c";

next if $s =~ "crypto/store/";

next if $s =~ "crypto/err/err_all.c";

next if $s =~ "crypto/aes/aes_ecb.c";



+ if ($unified_info{generate}->{$s}) {

+ if (defined $arch) {

+ my $buildstring = "perl";

+ foreach my $arg (@{$unified_info{generate}-
{$s}}) {

+ if ($arg =~ ".pl") {

+ $buildstring .= " ./openssl/$arg";

+ } elsif ($arg =~ "PERLASM_SCHEME") {

+ $buildstring .= "
$target{perlasm_scheme}";

+ } elsif ($arg =~ "LIB_CFLAGS") {

+ $buildstring .= "$flags";

+ }

+ }

+ ($s, my $path, undef) = fileparse($s,
qr/\.[^.]*/);

+ $buildstring .= " ./$arch/$path$s.$extension";

+ make_path ("./$arch/$path");

+ push @asmbuild, "$buildstring\n";

+ push @asmfilelist, "
$arch/$path$s.$extension\r\n";

+ }

+ next;

+ }

if ($product =~ "libssl") {

push @sslfilelist, ' $(OPENSSL_PATH)/' . $s .
"\r\n";

next;

@@ -183,15 +298,31 @@ foreach (@headers){
}





+#

+# Generate assembly files

+#

+if (@asmbuild) {

+ print "\n--> Generating assembly files ... ";

+ foreach my $buildstring (@asmbuild) {

+ system ("$buildstring");

+ copy_license_header ($buildstring);

+ }

+ print "Done!";

+}

+

#

# Update OpensslLib.inf with autogenerated file list

#

my @new_inf = ();

my $subbing = 0;

-print "\n--> Updating OpensslLib.inf ... ";

+print "\n--> Updating $inf_file ... ";

foreach (@inf) {

+ if ($_ =~ "DEFINE OPENSSL_FLAGS_CONFIG") {

+ push @new_inf, " DEFINE OPENSSL_FLAGS_CONFIG =" .
$flags
.
"\r\n";

+ next;

+ }

if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist, @sslfilelist;

+ push @new_inf, $_, @asmfilelist, @cryptofilelist,
@sslfilelist;

$subbing = 1;

next;

}

@@ -216,49 +347,51 @@ rename( $new_inf_file, $inf_file ) ||
die "rename $inf_file";

print "Done!";



-#

-# Update OpensslLibCrypto.inf with auto-generated file list (no
libssl)

-#

-$inf_file = "OpensslLibCrypto.inf";

-

-# Read the contents of the inf file

-@inf = ();

-@new_inf = ();

-open( FD, "<" . $inf_file ) ||

- die "Cannot open \"" . $inf_file . "\"!";

-@inf = (<FD>);

-close(FD) ||

- die "Cannot close \"" . $inf_file . "\"!";

+if (!defined $arch) {

+ #

+ # Update OpensslLibCrypto.inf with auto-generated file list
(no
libssl)

+ #

+ $inf_file = "OpensslLibCrypto.inf";



-$subbing = 0;

-print "\n--> Updating OpensslLibCrypto.inf ... ";

-foreach (@inf) {

- if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist;

- $subbing = 1;

- next;

- }

- if ( $_ =~ "# Autogenerated files list ends here" ) {

- push @new_inf, $_;

- $subbing = 0;

- next;

+ # Read the contents of the inf file

+ @inf = ();

+ @new_inf = ();

+ open( FD, "<" . $inf_file ) ||

+ die "Cannot open \"" . $inf_file . "\"!";

+ @inf = (<FD>);

+ close(FD) ||

+ die "Cannot close \"" . $inf_file . "\"!";

+

+ $subbing = 0;

+ print "\n--> Updating OpensslLibCrypto.inf ... ";

+ foreach (@inf) {

+ if ( $_ =~ "# Autogenerated files list starts here" ) {

+ push @new_inf, $_, @cryptofilelist;

+ $subbing = 1;

+ next;

+ }

+ if ( $_ =~ "# Autogenerated files list ends here" ) {

+ push @new_inf, $_;

+ $subbing = 0;

+ next;

+ }

+

+ push @new_inf, $_

+ unless ($subbing);

}



- push @new_inf, $_

- unless ($subbing);

+ $new_inf_file = $inf_file . ".new";

+ open( FD, ">" . $new_inf_file ) ||

+ die $new_inf_file;

+ print( FD @new_inf ) ||

+ die $new_inf_file;

+ close(FD) ||

+ die $new_inf_file;

+ rename( $new_inf_file, $inf_file ) ||

+ die "rename $inf_file";

+ print "Done!";

}



-$new_inf_file = $inf_file . ".new";

-open( FD, ">" . $new_inf_file ) ||

- die $new_inf_file;

-print( FD @new_inf ) ||

- die $new_inf_file;

-close(FD) ||

- die $new_inf_file;

-rename( $new_inf_file, $inf_file ) ||

- die "rename $inf_file";

-print "Done!";

-

#

# Copy opensslconf.h and dso_conf.h generated from OpenSSL
Configuration

#

diff --git a/CryptoPkg/Library/OpensslLib/uefi-asm.conf
b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
new file mode 100644
index 0000000000..55eedbf3ba
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
@@ -0,0 +1,15 @@
+## -*- mode: perl; -*-

+## UEFI assembly openssl configuration targets.

+

+my %targets = (

+#### UEFI

+ "UEFI-x86_64" => {

+ perlasm_scheme => "nasm",

+ # inherit_from => [ "UEFI", asm("x86_64_asm") ],

+ inherit_from => [ "UEFI" ],

+ cpuid_asm_src => "x86_64cpuid.s",

+ aes_asm_src => "aes_core.c aes_cbc.c vpaes-x86_64.s
aesni-
x86_64.s
aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",

+ sha1_asm_src => "sha1-x86_64.s sha256-x86_64.s sha512-
x86_64.s
sha1-mb-x86_64.s sha256-mb-x86_64.s",

+ modes_asm_src => "ghash-x86_64.s",

+ },

+);

--
2.28.0.windows.1



Zurcher, Christopher J
 

I was able to successfully build and run the non-optimized code with LLVM, but the optimized version returns this error during build:

C:\Program Files\LLVM\lib\clang\9.0.0\include\stdatomic.h:91:17: error: unknown type name 'wchar_t'
typedef _Atomic(wchar_t) atomic_wchar_t;

Is there a known build issue with CLANGPDB and the stdatomic.h file?

Thanks,
Christopher Zurcher

-----Original Message-----
From: Yao, Jiewen <jiewen.yao@...>
Sent: Tuesday, September 22, 2020 19:35
To: Zurcher, Christopher J <christopher.j.zurcher@...>; Jiang, Guomin
<guomin.jiang@...>; devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX <xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

For GCC, please refer to
https://github.com/tianocore/tianocore.github.io/wiki/Using-EDK-II-with-
Native-GCC

For LLVM, please refer to
https://github.com/tianocore/tianocore.github.io/wiki/CLANG9-Tools-Chain

Thank you
Yao Jiewen

-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, September 22, 2020 11:22 PM
To: Jiang, Guomin <guomin.jiang@...>; devel@edk2.groups.io; Yao,
Jiewen <jiewen.yao@...>
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

I have unit tested SHA1, SHA512, and AES as well.
I do not have the build environment available to test GCC and LLVM.

--
Christopher Zurcher

-----Original Message-----
From: Jiang, Guomin <guomin.jiang@...>
Sent: Wednesday, September 16, 2020 02:17
To: devel@edk2.groups.io; Yao, Jiewen <jiewen.yao@...>; Zurcher,
Christopher J <christopher.j.zurcher@...>
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction support for X64

Hi Zurcher,

[Jiewen] Since you also add other sha (sha1, sha512) and aesni, I think
those
need unit test for them too.
Can you update the status about it?

[Jiewen] I think we need support build with GCC and LLVM, and with X64.
It is better to support the GCC and LLVM.

Thanks
Guomin

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao,
Jiewen
Sent: Tuesday, August 25, 2020 7:36 AM
To: Zurcher, Christopher J <christopher.j.zurcher@...>;
devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>; Ard Biesheuvel <ard.biesheuvel@...>
Subject: Re: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add
native
instruction support for X64

Below:

-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 25, 2020 5:26 AM
To: devel@edk2.groups.io; Zurcher, Christopher J
<christopher.j.zurcher@...>; Yao, Jiewen <jiewen.yao@...>
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add
native
instruction support for X64

1) I have confirmed that the ApiHooks.c file is still required even
without
the AVX
instructions included. The x86_64 assembly files in OpenSSL set a
flag
called
$win64 and automatically include calls to the RtlVirtualUnwind
function
if
NASM
is selected as the assembler scheme.

https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-
rtlvirtualunwind

I have submitted an issue against OpenSSL since I don't think using
the
NASM
assembler should force the inclusion of Windows-specific API hooks,
but
that
change cannot be made in OpenSSL 1.1.1 and we will have to wait for
OpenSSL 3
or later to remove the stub function.

https://github.com/openssl/openssl/issues/12712
[Jiewen] Thanks.

2) So far I have only built with VS.
[Jiewen] I think we need support build with GCC and LLVM, and with X64.


3) The X64 SHA256 implementation was successfully exercised across a
large
number of devices in a production environment as a verification step
in a
multi-
GB data transfer scenario.
[Jiewen] Since you also add other sha (sha1, sha512) and aesni, I think
those
need unit test for them too.


Thanks,
Christopher Zurcher

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
Zurcher,
Christopher J
Sent: Tuesday, August 18, 2020 15:50
To: Yao, Jiewen <jiewen.yao@...>; devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: Re: [edk2-devel] [PATCH v2 1/2] CryptoPkg/OpensslLib: Add
native
instruction support for X64

After further review, the ApiHooks.c file may no longer be needed
since
we
are no longer including the AVX instructions. I will look over the
dependencies and send a new patch set if I can eliminate the API
hooks
file.

Thanks,
Christopher Zurcher

-----Original Message-----
From: Yao, Jiewen <jiewen.yao@...>
Sent: Thursday, August 13, 2020 08:04
To: Zurcher, Christopher J <christopher.j.zurcher@...>;
devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Lu, XiaoyuX
<xiaoyux.lu@...>;
Ard Biesheuvel <ard.biesheuvel@...>
Subject: RE: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction
support for X64

Hi Christopher
Thanks.

1) Would you please help me understand more on "ApiHooks.c
contains
a
stub
function for a Windows API call" ?
Why we need this?
If it is compiler specific in openssl, should we submit patch to
openssl to
exclude this with OPENSSL_SYS_UEFI? That should be a cleaner
solution
for
UEFI.

2) Would you please describe what compiler you have tried? VS?
GCC?
LLVM?

3) Would you please describe what unit test you have done?

Thank you
Yao Jiewen


-----Original Message-----
From: Zurcher, Christopher J <christopher.j.zurcher@...>
Sent: Tuesday, August 4, 2020 8:24 AM
To: devel@edk2.groups.io
Cc: Yao, Jiewen <jiewen.yao@...>; Wang, Jian J
<jian.j.wang@...>;
Lu, XiaoyuX <xiaoyux.lu@...>; Ard Biesheuvel
<ard.biesheuvel@...>
Subject: [PATCH v2 1/2] CryptoPkg/OpensslLib: Add native
instruction
support
for X64

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2507

Adding OpensslLibX64.inf and modifying process_files.pl to
process
this
file and generate the necessary assembly files.
ApiHooks.c contains a stub function for a Windows API call.
uefi-asm.conf contains the limited assembly configurations for
OpenSSL.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyux.lu@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Christopher J Zurcher
<christopher.j.zurcher@...>
---
CryptoPkg/Library/OpensslLib/OpensslLib.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
CryptoPkg/Library/OpensslLib/OpensslLibX64.inf | 656
++++++++++++++++++++
CryptoPkg/Library/Include/openssl/opensslconf.h | 3 -
CryptoPkg/Library/OpensslLib/ApiHooks.c | 18 +
CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c | 34 +
CryptoPkg/Library/OpensslLib/process_files.pl | 223
+++++--
CryptoPkg/Library/OpensslLib/uefi-asm.conf | 15 +
8 files changed, 903 insertions(+), 50 deletions(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index dbbe5386a1..bd62d86936 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 616ccd9f62..2b7324a990 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -16,7 +16,7 @@
VERSION_STRING = 1.0

LIBRARY_CLASS = OpensslLib

DEFINE OPENSSL_PATH = openssl

- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE -
DOPENSSL_NO_ASM



#

# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
new file mode 100644
index 0000000000..825eea0254
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibX64.inf
@@ -0,0 +1,656 @@
+## @file

+# This module provides OpenSSL Library implementation.

+#

+# Copyright (c) 2010 - 2020, Intel Corporation. All rights
reserved.<BR>

+# (C) Copyright 2020 Hewlett Packard Enterprise Development
LP<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+ INF_VERSION = 0x00010005

+ BASE_NAME = OpensslLibX64

+ MODULE_UNI_FILE = OpensslLib.uni

+ FILE_GUID = 18125E50-0117-4DD0-BE54-
4784AD995FEF

+ MODULE_TYPE = BASE

+ VERSION_STRING = 1.0

+ LIBRARY_CLASS = OpensslLib

+ DEFINE OPENSSL_PATH = openssl

+ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -
DOPENSSL_SMALL_FOOTPRINT
-D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE

+ DEFINE OPENSSL_FLAGS_CONFIG = -DOPENSSL_CPUID_OBJ -
DSHA1_ASM -
DSHA256_ASM -DSHA512_ASM -DAESNI_ASM -DVPAES_ASM -
DGHASH_ASM

+ CONSTRUCTOR = OpensslLibConstructor

+

+#

+# VALID_ARCHITECTURES = X64

+#

+

+[Sources]

+ OpensslLibConstructor.c

+ $(OPENSSL_PATH)/e_os.h

+ $(OPENSSL_PATH)/ms/uplink.h

+# Autogenerated files list starts here

+ X64/crypto/aes/aesni-mb-x86_64.nasm

+ X64/crypto/aes/aesni-sha1-x86_64.nasm

+ X64/crypto/aes/aesni-sha256-x86_64.nasm

+ X64/crypto/aes/aesni-x86_64.nasm

+ X64/crypto/aes/vpaes-x86_64.nasm

+ X64/crypto/modes/ghash-x86_64.nasm

+ X64/crypto/sha/sha1-mb-x86_64.nasm

+ X64/crypto/sha/sha1-x86_64.nasm

+ X64/crypto/sha/sha256-mb-x86_64.nasm

+ X64/crypto/sha/sha256-x86_64.nasm

+ X64/crypto/sha/sha512-x86_64.nasm

+ X64/crypto/x86_64cpuid.nasm

+ $(OPENSSL_PATH)/crypto/aes/aes_cbc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_cfb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_core.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ige.c

+ $(OPENSSL_PATH)/crypto/aes/aes_misc.c

+ $(OPENSSL_PATH)/crypto/aes/aes_ofb.c

+ $(OPENSSL_PATH)/crypto/aes/aes_wrap.c

+ $(OPENSSL_PATH)/crypto/aria/aria.c

+ $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_digest.c

+ $(OPENSSL_PATH)/crypto/asn1/a_dup.c

+ $(OPENSSL_PATH)/crypto/asn1/a_gentm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c

+ $(OPENSSL_PATH)/crypto/asn1/a_int.c

+ $(OPENSSL_PATH)/crypto/asn1/a_mbstr.c

+ $(OPENSSL_PATH)/crypto/asn1/a_object.c

+ $(OPENSSL_PATH)/crypto/asn1/a_octet.c

+ $(OPENSSL_PATH)/crypto/asn1/a_print.c

+ $(OPENSSL_PATH)/crypto/asn1/a_sign.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strex.c

+ $(OPENSSL_PATH)/crypto/asn1/a_strnid.c

+ $(OPENSSL_PATH)/crypto/asn1/a_time.c

+ $(OPENSSL_PATH)/crypto/asn1/a_type.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utctm.c

+ $(OPENSSL_PATH)/crypto/asn1/a_utf8.c

+ $(OPENSSL_PATH)/crypto/asn1/a_verify.c

+ $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_err.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c

+ $(OPENSSL_PATH)/crypto/asn1/asn1_par.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mime.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_moid.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_mstbl.c

+ $(OPENSSL_PATH)/crypto/asn1/asn_pack.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/evp_asn1.c

+ $(OPENSSL_PATH)/crypto/asn1/f_int.c

+ $(OPENSSL_PATH)/crypto/asn1/f_string.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pr.c

+ $(OPENSSL_PATH)/crypto/asn1/i2d_pu.c

+ $(OPENSSL_PATH)/crypto/asn1/n_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/nsseq.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbe.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c

+ $(OPENSSL_PATH)/crypto/asn1/p5_scrypt.c

+ $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_bitst.c

+ $(OPENSSL_PATH)/crypto/asn1/t_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/t_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_dec.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_enc.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_fre.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_new.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_scn.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c

+ $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c

+ $(OPENSSL_PATH)/crypto/asn1/x_algor.c

+ $(OPENSSL_PATH)/crypto/asn1/x_bignum.c

+ $(OPENSSL_PATH)/crypto/asn1/x_info.c

+ $(OPENSSL_PATH)/crypto/asn1/x_int64.c

+ $(OPENSSL_PATH)/crypto/asn1/x_long.c

+ $(OPENSSL_PATH)/crypto/asn1/x_pkey.c

+ $(OPENSSL_PATH)/crypto/asn1/x_sig.c

+ $(OPENSSL_PATH)/crypto/asn1/x_spki.c

+ $(OPENSSL_PATH)/crypto/asn1/x_val.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.c

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.c

+ $(OPENSSL_PATH)/crypto/async/async.c

+ $(OPENSSL_PATH)/crypto/async/async_err.c

+ $(OPENSSL_PATH)/crypto/async/async_wait.c

+ $(OPENSSL_PATH)/crypto/bio/b_addr.c

+ $(OPENSSL_PATH)/crypto/bio/b_dump.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock.c

+ $(OPENSSL_PATH)/crypto/bio/b_sock2.c

+ $(OPENSSL_PATH)/crypto/bio/bf_buff.c

+ $(OPENSSL_PATH)/crypto/bio/bf_lbuf.c

+ $(OPENSSL_PATH)/crypto/bio/bf_nbio.c

+ $(OPENSSL_PATH)/crypto/bio/bf_null.c

+ $(OPENSSL_PATH)/crypto/bio/bio_cb.c

+ $(OPENSSL_PATH)/crypto/bio/bio_err.c

+ $(OPENSSL_PATH)/crypto/bio/bio_lib.c

+ $(OPENSSL_PATH)/crypto/bio/bio_meth.c

+ $(OPENSSL_PATH)/crypto/bio/bss_acpt.c

+ $(OPENSSL_PATH)/crypto/bio/bss_bio.c

+ $(OPENSSL_PATH)/crypto/bio/bss_conn.c

+ $(OPENSSL_PATH)/crypto/bio/bss_dgram.c

+ $(OPENSSL_PATH)/crypto/bio/bss_fd.c

+ $(OPENSSL_PATH)/crypto/bio/bss_file.c

+ $(OPENSSL_PATH)/crypto/bio/bss_log.c

+ $(OPENSSL_PATH)/crypto/bio/bss_mem.c

+ $(OPENSSL_PATH)/crypto/bio/bss_null.c

+ $(OPENSSL_PATH)/crypto/bio/bss_sock.c

+ $(OPENSSL_PATH)/crypto/bn/bn_add.c

+ $(OPENSSL_PATH)/crypto/bn/bn_asm.c

+ $(OPENSSL_PATH)/crypto/bn/bn_blind.c

+ $(OPENSSL_PATH)/crypto/bn/bn_const.c

+ $(OPENSSL_PATH)/crypto/bn/bn_ctx.c

+ $(OPENSSL_PATH)/crypto/bn/bn_depr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_dh.c

+ $(OPENSSL_PATH)/crypto/bn/bn_div.c

+ $(OPENSSL_PATH)/crypto/bn/bn_err.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_exp2.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gcd.c

+ $(OPENSSL_PATH)/crypto/bn/bn_gf2m.c

+ $(OPENSSL_PATH)/crypto/bn/bn_intern.c

+ $(OPENSSL_PATH)/crypto/bn/bn_kron.c

+ $(OPENSSL_PATH)/crypto/bn/bn_lib.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mod.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mont.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mpi.c

+ $(OPENSSL_PATH)/crypto/bn/bn_mul.c

+ $(OPENSSL_PATH)/crypto/bn/bn_nist.c

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.c

+ $(OPENSSL_PATH)/crypto/bn/bn_print.c

+ $(OPENSSL_PATH)/crypto/bn/bn_rand.c

+ $(OPENSSL_PATH)/crypto/bn/bn_recp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_shift.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqr.c

+ $(OPENSSL_PATH)/crypto/bn/bn_sqrt.c

+ $(OPENSSL_PATH)/crypto/bn/bn_srp.c

+ $(OPENSSL_PATH)/crypto/bn/bn_word.c

+ $(OPENSSL_PATH)/crypto/bn/bn_x931p.c

+ $(OPENSSL_PATH)/crypto/buffer/buf_err.c

+ $(OPENSSL_PATH)/crypto/buffer/buffer.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c

+ $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c

+ $(OPENSSL_PATH)/crypto/cmac/cmac.c

+ $(OPENSSL_PATH)/crypto/comp/c_zlib.c

+ $(OPENSSL_PATH)/crypto/comp/comp_err.c

+ $(OPENSSL_PATH)/crypto/comp/comp_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_api.c

+ $(OPENSSL_PATH)/crypto/conf/conf_def.c

+ $(OPENSSL_PATH)/crypto/conf/conf_err.c

+ $(OPENSSL_PATH)/crypto/conf/conf_lib.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mall.c

+ $(OPENSSL_PATH)/crypto/conf/conf_mod.c

+ $(OPENSSL_PATH)/crypto/conf/conf_sap.c

+ $(OPENSSL_PATH)/crypto/conf/conf_ssl.c

+ $(OPENSSL_PATH)/crypto/cpt_err.c

+ $(OPENSSL_PATH)/crypto/cryptlib.c

+ $(OPENSSL_PATH)/crypto/ctype.c

+ $(OPENSSL_PATH)/crypto/cversion.c

+ $(OPENSSL_PATH)/crypto/dh/dh_ameth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_asn1.c

+ $(OPENSSL_PATH)/crypto/dh/dh_check.c

+ $(OPENSSL_PATH)/crypto/dh/dh_depr.c

+ $(OPENSSL_PATH)/crypto/dh/dh_err.c

+ $(OPENSSL_PATH)/crypto/dh/dh_gen.c

+ $(OPENSSL_PATH)/crypto/dh/dh_kdf.c

+ $(OPENSSL_PATH)/crypto/dh/dh_key.c

+ $(OPENSSL_PATH)/crypto/dh/dh_lib.c

+ $(OPENSSL_PATH)/crypto/dh/dh_meth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c

+ $(OPENSSL_PATH)/crypto/dh/dh_prn.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c

+ $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c

+ $(OPENSSL_PATH)/crypto/dso/dso_err.c

+ $(OPENSSL_PATH)/crypto/dso/dso_lib.c

+ $(OPENSSL_PATH)/crypto/dso/dso_openssl.c

+ $(OPENSSL_PATH)/crypto/dso/dso_vms.c

+ $(OPENSSL_PATH)/crypto/dso/dso_win32.c

+ $(OPENSSL_PATH)/crypto/ebcdic.c

+ $(OPENSSL_PATH)/crypto/err/err.c

+ $(OPENSSL_PATH)/crypto/err/err_prn.c

+ $(OPENSSL_PATH)/crypto/evp/bio_b64.c

+ $(OPENSSL_PATH)/crypto/evp/bio_enc.c

+ $(OPENSSL_PATH)/crypto/evp/bio_md.c

+ $(OPENSSL_PATH)/crypto/evp/bio_ok.c

+ $(OPENSSL_PATH)/crypto/evp/c_allc.c

+ $(OPENSSL_PATH)/crypto/evp/c_alld.c

+ $(OPENSSL_PATH)/crypto/evp/cmeth_lib.c

+ $(OPENSSL_PATH)/crypto/evp/digest.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c

+ $(OPENSSL_PATH)/crypto/evp/e_aria.c

+ $(OPENSSL_PATH)/crypto/evp/e_bf.c

+ $(OPENSSL_PATH)/crypto/evp/e_camellia.c

+ $(OPENSSL_PATH)/crypto/evp/e_cast.c

+ $(OPENSSL_PATH)/crypto/evp/e_chacha20_poly1305.c

+ $(OPENSSL_PATH)/crypto/evp/e_des.c

+ $(OPENSSL_PATH)/crypto/evp/e_des3.c

+ $(OPENSSL_PATH)/crypto/evp/e_idea.c

+ $(OPENSSL_PATH)/crypto/evp/e_null.c

+ $(OPENSSL_PATH)/crypto/evp/e_old.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc2.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c

+ $(OPENSSL_PATH)/crypto/evp/e_rc5.c

+ $(OPENSSL_PATH)/crypto/evp/e_seed.c

+ $(OPENSSL_PATH)/crypto/evp/e_sm4.c

+ $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c

+ $(OPENSSL_PATH)/crypto/evp/encode.c

+ $(OPENSSL_PATH)/crypto/evp/evp_cnf.c

+ $(OPENSSL_PATH)/crypto/evp/evp_enc.c

+ $(OPENSSL_PATH)/crypto/evp/evp_err.c

+ $(OPENSSL_PATH)/crypto/evp/evp_key.c

+ $(OPENSSL_PATH)/crypto/evp/evp_lib.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pbe.c

+ $(OPENSSL_PATH)/crypto/evp/evp_pkey.c

+ $(OPENSSL_PATH)/crypto/evp/m_md2.c

+ $(OPENSSL_PATH)/crypto/evp/m_md4.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5.c

+ $(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_mdc2.c

+ $(OPENSSL_PATH)/crypto/evp/m_null.c

+ $(OPENSSL_PATH)/crypto/evp/m_ripemd.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha1.c

+ $(OPENSSL_PATH)/crypto/evp/m_sha3.c

+ $(OPENSSL_PATH)/crypto/evp/m_sigver.c

+ $(OPENSSL_PATH)/crypto/evp/m_wp.c

+ $(OPENSSL_PATH)/crypto/evp/names.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt.c

+ $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c

+ $(OPENSSL_PATH)/crypto/evp/p_dec.c

+ $(OPENSSL_PATH)/crypto/evp/p_enc.c

+ $(OPENSSL_PATH)/crypto/evp/p_lib.c

+ $(OPENSSL_PATH)/crypto/evp/p_open.c

+ $(OPENSSL_PATH)/crypto/evp/p_seal.c

+ $(OPENSSL_PATH)/crypto/evp/p_sign.c

+ $(OPENSSL_PATH)/crypto/evp/p_verify.c

+ $(OPENSSL_PATH)/crypto/evp/pbe_scrypt.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c

+ $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c

+ $(OPENSSL_PATH)/crypto/ex_data.c

+ $(OPENSSL_PATH)/crypto/getenv.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c

+ $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c

+ $(OPENSSL_PATH)/crypto/hmac/hmac.c

+ $(OPENSSL_PATH)/crypto/init.c

+ $(OPENSSL_PATH)/crypto/kdf/hkdf.c

+ $(OPENSSL_PATH)/crypto/kdf/kdf_err.c

+ $(OPENSSL_PATH)/crypto/kdf/scrypt.c

+ $(OPENSSL_PATH)/crypto/kdf/tls1_prf.c

+ $(OPENSSL_PATH)/crypto/lhash/lh_stats.c

+ $(OPENSSL_PATH)/crypto/lhash/lhash.c

+ $(OPENSSL_PATH)/crypto/md5/md5_dgst.c

+ $(OPENSSL_PATH)/crypto/md5/md5_one.c

+ $(OPENSSL_PATH)/crypto/mem.c

+ $(OPENSSL_PATH)/crypto/mem_dbg.c

+ $(OPENSSL_PATH)/crypto/mem_sec.c

+ $(OPENSSL_PATH)/crypto/modes/cbc128.c

+ $(OPENSSL_PATH)/crypto/modes/ccm128.c

+ $(OPENSSL_PATH)/crypto/modes/cfb128.c

+ $(OPENSSL_PATH)/crypto/modes/ctr128.c

+ $(OPENSSL_PATH)/crypto/modes/cts128.c

+ $(OPENSSL_PATH)/crypto/modes/gcm128.c

+ $(OPENSSL_PATH)/crypto/modes/ocb128.c

+ $(OPENSSL_PATH)/crypto/modes/ofb128.c

+ $(OPENSSL_PATH)/crypto/modes/wrap128.c

+ $(OPENSSL_PATH)/crypto/modes/xts128.c

+ $(OPENSSL_PATH)/crypto/o_dir.c

+ $(OPENSSL_PATH)/crypto/o_fips.c

+ $(OPENSSL_PATH)/crypto/o_fopen.c

+ $(OPENSSL_PATH)/crypto/o_init.c

+ $(OPENSSL_PATH)/crypto/o_str.c

+ $(OPENSSL_PATH)/crypto/o_time.c

+ $(OPENSSL_PATH)/crypto/objects/o_names.c

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.c

+ $(OPENSSL_PATH)/crypto/objects/obj_err.c

+ $(OPENSSL_PATH)/crypto/objects/obj_lib.c

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c

+ $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c

+ $(OPENSSL_PATH)/crypto/pem/pem_all.c

+ $(OPENSSL_PATH)/crypto/pem/pem_err.c

+ $(OPENSSL_PATH)/crypto/pem/pem_info.c

+ $(OPENSSL_PATH)/crypto/pem/pem_lib.c

+ $(OPENSSL_PATH)/crypto/pem/pem_oth.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pk8.c

+ $(OPENSSL_PATH)/crypto/pem/pem_pkey.c

+ $(OPENSSL_PATH)/crypto/pem/pem_sign.c

+ $(OPENSSL_PATH)/crypto/pem/pem_x509.c

+ $(OPENSSL_PATH)/crypto/pem/pem_xaux.c

+ $(OPENSSL_PATH)/crypto/pem/pvkfmt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_init.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_key.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_sbag.c

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c

+ $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c

+ $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c

+ $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_ctr.c

+ $(OPENSSL_PATH)/crypto/rand/drbg_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_egd.c

+ $(OPENSSL_PATH)/crypto/rand/rand_err.c

+ $(OPENSSL_PATH)/crypto/rand/rand_lib.c

+ $(OPENSSL_PATH)/crypto/rand/rand_unix.c

+ $(OPENSSL_PATH)/crypto/rand/rand_vms.c

+ $(OPENSSL_PATH)/crypto/rand/rand_win.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_chk.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_err.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_lib.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_meth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_mp.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_none.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ossl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_saos.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_sign.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c

+ $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c

+ $(OPENSSL_PATH)/crypto/sha/keccak1600.c

+ $(OPENSSL_PATH)/crypto/sha/sha1_one.c

+ $(OPENSSL_PATH)/crypto/sha/sha1dgst.c

+ $(OPENSSL_PATH)/crypto/sha/sha256.c

+ $(OPENSSL_PATH)/crypto/sha/sha512.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_ameth.c

+ $(OPENSSL_PATH)/crypto/siphash/siphash_pmeth.c

+ $(OPENSSL_PATH)/crypto/sm3/m_sm3.c

+ $(OPENSSL_PATH)/crypto/sm3/sm3.c

+ $(OPENSSL_PATH)/crypto/sm4/sm4.c

+ $(OPENSSL_PATH)/crypto/stack/stack.c

+ $(OPENSSL_PATH)/crypto/threads_none.c

+ $(OPENSSL_PATH)/crypto/threads_pthread.c

+ $(OPENSSL_PATH)/crypto/threads_win.c

+ $(OPENSSL_PATH)/crypto/txt_db/txt_db.c

+ $(OPENSSL_PATH)/crypto/ui/ui_err.c

+ $(OPENSSL_PATH)/crypto/ui/ui_lib.c

+ $(OPENSSL_PATH)/crypto/ui/ui_null.c

+ $(OPENSSL_PATH)/crypto/ui/ui_openssl.c

+ $(OPENSSL_PATH)/crypto/ui/ui_util.c

+ $(OPENSSL_PATH)/crypto/uid.c

+ $(OPENSSL_PATH)/crypto/x509/by_dir.c

+ $(OPENSSL_PATH)/crypto/x509/by_file.c

+ $(OPENSSL_PATH)/crypto/x509/t_crl.c

+ $(OPENSSL_PATH)/crypto/x509/t_req.c

+ $(OPENSSL_PATH)/crypto/x509/t_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x509_att.c

+ $(OPENSSL_PATH)/crypto/x509/x509_cmp.c

+ $(OPENSSL_PATH)/crypto/x509/x509_d2.c

+ $(OPENSSL_PATH)/crypto/x509/x509_def.c

+ $(OPENSSL_PATH)/crypto/x509/x509_err.c

+ $(OPENSSL_PATH)/crypto/x509/x509_ext.c

+ $(OPENSSL_PATH)/crypto/x509/x509_lu.c

+ $(OPENSSL_PATH)/crypto/x509/x509_meth.c

+ $(OPENSSL_PATH)/crypto/x509/x509_obj.c

+ $(OPENSSL_PATH)/crypto/x509/x509_r2x.c

+ $(OPENSSL_PATH)/crypto/x509/x509_req.c

+ $(OPENSSL_PATH)/crypto/x509/x509_set.c

+ $(OPENSSL_PATH)/crypto/x509/x509_trs.c

+ $(OPENSSL_PATH)/crypto/x509/x509_txt.c

+ $(OPENSSL_PATH)/crypto/x509/x509_v3.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vfy.c

+ $(OPENSSL_PATH)/crypto/x509/x509_vpm.c

+ $(OPENSSL_PATH)/crypto/x509/x509cset.c

+ $(OPENSSL_PATH)/crypto/x509/x509name.c

+ $(OPENSSL_PATH)/crypto/x509/x509rset.c

+ $(OPENSSL_PATH)/crypto/x509/x509spki.c

+ $(OPENSSL_PATH)/crypto/x509/x509type.c

+ $(OPENSSL_PATH)/crypto/x509/x_all.c

+ $(OPENSSL_PATH)/crypto/x509/x_attrib.c

+ $(OPENSSL_PATH)/crypto/x509/x_crl.c

+ $(OPENSSL_PATH)/crypto/x509/x_exten.c

+ $(OPENSSL_PATH)/crypto/x509/x_name.c

+ $(OPENSSL_PATH)/crypto/x509/x_pubkey.c

+ $(OPENSSL_PATH)/crypto/x509/x_req.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509.c

+ $(OPENSSL_PATH)/crypto/x509/x_x509a.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_map.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_node.c

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_alt.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_conf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_crld.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_enum.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_extku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_genn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_info.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_int.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_lib.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pci.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pku.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_prn.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_purp.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_skey.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_tlsf.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c

+ $(OPENSSL_PATH)/crypto/x509v3/v3err.c

+ $(OPENSSL_PATH)/crypto/arm_arch.h

+ $(OPENSSL_PATH)/crypto/mips_arch.h

+ $(OPENSSL_PATH)/crypto/ppc_arch.h

+ $(OPENSSL_PATH)/crypto/s390x_arch.h

+ $(OPENSSL_PATH)/crypto/sparc_arch.h

+ $(OPENSSL_PATH)/crypto/vms_rms.h

+ $(OPENSSL_PATH)/crypto/aes/aes_local.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h

+ $(OPENSSL_PATH)/crypto/asn1/asn1_local.h

+ $(OPENSSL_PATH)/crypto/asn1/charmap.h

+ $(OPENSSL_PATH)/crypto/asn1/standard_methods.h

+ $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h

+ $(OPENSSL_PATH)/crypto/async/async_local.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_null.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_posix.h

+ $(OPENSSL_PATH)/crypto/async/arch/async_win.h

+ $(OPENSSL_PATH)/crypto/bio/bio_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_local.h

+ $(OPENSSL_PATH)/crypto/bn/bn_prime.h

+ $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h

+ $(OPENSSL_PATH)/crypto/comp/comp_local.h

+ $(OPENSSL_PATH)/crypto/conf/conf_def.h

+ $(OPENSSL_PATH)/crypto/conf/conf_local.h

+ $(OPENSSL_PATH)/crypto/dh/dh_local.h

+ $(OPENSSL_PATH)/crypto/dso/dso_local.h

+ $(OPENSSL_PATH)/crypto/evp/evp_local.h

+ $(OPENSSL_PATH)/crypto/hmac/hmac_local.h

+ $(OPENSSL_PATH)/crypto/lhash/lhash_local.h

+ $(OPENSSL_PATH)/crypto/md5/md5_local.h

+ $(OPENSSL_PATH)/crypto/modes/modes_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_dat.h

+ $(OPENSSL_PATH)/crypto/objects/obj_local.h

+ $(OPENSSL_PATH)/crypto/objects/obj_xref.h

+ $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h

+ $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h

+ $(OPENSSL_PATH)/crypto/rand/rand_local.h

+ $(OPENSSL_PATH)/crypto/rsa/rsa_local.h

+ $(OPENSSL_PATH)/crypto/sha/sha_local.h

+ $(OPENSSL_PATH)/crypto/siphash/siphash_local.h

+ $(OPENSSL_PATH)/crypto/sm3/sm3_local.h

+ $(OPENSSL_PATH)/crypto/store/store_local.h

+ $(OPENSSL_PATH)/crypto/ui/ui_local.h

+ $(OPENSSL_PATH)/crypto/x509/x509_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h

+ $(OPENSSL_PATH)/crypto/x509v3/pcy_local.h

+ $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h

+ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h

+ $(OPENSSL_PATH)/ssl/bio_ssl.c

+ $(OPENSSL_PATH)/ssl/d1_lib.c

+ $(OPENSSL_PATH)/ssl/d1_msg.c

+ $(OPENSSL_PATH)/ssl/d1_srtp.c

+ $(OPENSSL_PATH)/ssl/methods.c

+ $(OPENSSL_PATH)/ssl/packet.c

+ $(OPENSSL_PATH)/ssl/pqueue.c

+ $(OPENSSL_PATH)/ssl/record/dtls1_bitmap.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_d1.c

+ $(OPENSSL_PATH)/ssl/record/rec_layer_s3.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_buffer.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record.c

+ $(OPENSSL_PATH)/ssl/record/ssl3_record_tls13.c

+ $(OPENSSL_PATH)/ssl/s3_cbc.c

+ $(OPENSSL_PATH)/ssl/s3_enc.c

+ $(OPENSSL_PATH)/ssl/s3_lib.c

+ $(OPENSSL_PATH)/ssl/s3_msg.c

+ $(OPENSSL_PATH)/ssl/ssl_asn1.c

+ $(OPENSSL_PATH)/ssl/ssl_cert.c

+ $(OPENSSL_PATH)/ssl/ssl_ciph.c

+ $(OPENSSL_PATH)/ssl/ssl_conf.c

+ $(OPENSSL_PATH)/ssl/ssl_err.c

+ $(OPENSSL_PATH)/ssl/ssl_init.c

+ $(OPENSSL_PATH)/ssl/ssl_lib.c

+ $(OPENSSL_PATH)/ssl/ssl_mcnf.c

+ $(OPENSSL_PATH)/ssl/ssl_rsa.c

+ $(OPENSSL_PATH)/ssl/ssl_sess.c

+ $(OPENSSL_PATH)/ssl/ssl_stat.c

+ $(OPENSSL_PATH)/ssl/ssl_txt.c

+ $(OPENSSL_PATH)/ssl/ssl_utst.c

+ $(OPENSSL_PATH)/ssl/statem/extensions.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_cust.c

+ $(OPENSSL_PATH)/ssl/statem/extensions_srvr.c

+ $(OPENSSL_PATH)/ssl/statem/statem.c

+ $(OPENSSL_PATH)/ssl/statem/statem_clnt.c

+ $(OPENSSL_PATH)/ssl/statem/statem_dtls.c

+ $(OPENSSL_PATH)/ssl/statem/statem_lib.c

+ $(OPENSSL_PATH)/ssl/statem/statem_srvr.c

+ $(OPENSSL_PATH)/ssl/t1_enc.c

+ $(OPENSSL_PATH)/ssl/t1_lib.c

+ $(OPENSSL_PATH)/ssl/t1_trce.c

+ $(OPENSSL_PATH)/ssl/tls13_enc.c

+ $(OPENSSL_PATH)/ssl/tls_srp.c

+ $(OPENSSL_PATH)/ssl/packet_local.h

+ $(OPENSSL_PATH)/ssl/ssl_cert_table.h

+ $(OPENSSL_PATH)/ssl/ssl_local.h

+ $(OPENSSL_PATH)/ssl/record/record.h

+ $(OPENSSL_PATH)/ssl/record/record_local.h

+ $(OPENSSL_PATH)/ssl/statem/statem.h

+ $(OPENSSL_PATH)/ssl/statem/statem_local.h

+# Autogenerated files list ends here

+ buildinf.h

+ rand_pool_noise.h

+ ossl_store.c

+ rand_pool.c

+

+[Sources.X64]

+ rand_pool_noise_tsc.c

+ ApiHooks.c

+

+[Packages]

+ MdePkg/MdePkg.dec

+ CryptoPkg/CryptoPkg.dec

+

+[LibraryClasses]

+ BaseLib

+ DebugLib

+ TimerLib

+ PrintLib

+

+[BuildOptions]

+ #

+ # Disables the following Visual Studio compiler warnings
brought
by
openssl
source,

+ # so we do not break the build with /WX option:

+ # C4090: 'function' : different 'const' qualifiers

+ # C4132: 'object' : const object should be initialized
(tls13_enc.c)

+ # C4210: nonstandard extension used: function given file
scope

+ # C4244: conversion from type1 to type2, possible loss of
data

+ # C4245: conversion from type1 to type2, signed/unsigned
mismatch

+ # C4267: conversion from size_t to type, possible loss of
data

+ # C4306: 'identifier' : conversion from 'type1' to 'type2'
of
greater
size

+ # C4310: cast truncates constant value

+ # C4389: 'operator' : signed/unsigned mismatch (xxxx)

+ # C4700: uninitialized local variable 'name' used.
(conf_sap.c(71))

+ # C4702: unreachable code

+ # C4706: assignment within conditional expression

+ # C4819: The file contains a character that cannot be
represented
in
the
current code page

+ #

+ MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /wd4090 /wd4132
/wd4210
/wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389
/wd4702
/wd4706 /wd4819

+

+ INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -
U__ICC
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) /w

+

+ #

+ # Suppress the following build warnings in openssl so we
don't
break
the
build
with -Werror

+ # -Werror=maybe-uninitialized: there exist some other
paths
for
which
the
variable is not initialized.

+ # -Werror=format: Check calls to printf and scanf, etc.,
to
make
sure
that the
arguments supplied have

+ # types appropriate to the format string
specified.

+ # -Werror=unused-but-set-variable: Warn whenever a local
variable is
assigned to, but otherwise unused (aside from its declaration).

+ #

+ GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64
$(OPENSSL_FLAGS)
$(OPENSSL_FLAGS_CONFIG) -Wno-error=maybe-uninitialized -Wno-
error=format -Wno-format -Wno-error=unused-but-set-variable -
DNO_MSABI_VA_FUNCS

+

+ # suppress the following warnings in openssl so we don't
break
the
build
with
warnings-as-errors:

+ # 1295: Deprecated declaration <entity> - give arg types

+ # 550: <entity> was set but never used

+ # 1293: assignment in condition

+ # 111: statement is unreachable (invariably "break;" after
"return
X;"
in case
statement)

+ # 68: integer conversion resulted in a change of sign ("if
(Status
==
-1)")

+ # 177: <entity> was declared but never referenced

+ # 223: function <entity> declared implicitly

+ # 144: a value of type <type> cannot be used to initialize
an
entity
of
type
<type>

+ # 513: a value of type <type> cannot be assigned to an
entity
of
type
<type>

+ # 188: enumerated type mixed with another type (i.e.
passing an
integer
as an
enum without a cast)

+ # 1296: Extended constant initialiser used

+ # 128: loop is not reachable - may be emitted
inappropriately
if
code
follows
a conditional return

+ # from the function that evaluates to true at compile
time

+ # 546: transfer of control bypasses initialization - may be
emitted
inappropriately if the uninitialized

+ # variable is never referenced after the jump

+ # 1: ignore "#1-D: last line of file ends without a
newline"

+ # 3017: <entity> may be used before being set (NOTE: This
was
fixed in
OpenSSL 1.1 HEAD with

+ # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and
can
be
dropped then.)

+ XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -
U_WIN64
$(OPENSSL_FLAGS) $(OPENSSL_FLAGS_CONFIG) -w -std=c99 -Wno-
error=uninitialized

diff --git a/CryptoPkg/Library/Include/openssl/opensslconf.h
b/CryptoPkg/Library/Include/openssl/opensslconf.h
index 3a2544ea5c..e8f73c4d10 100644
--- a/CryptoPkg/Library/Include/openssl/opensslconf.h
+++ b/CryptoPkg/Library/Include/openssl/opensslconf.h
@@ -112,9 +112,6 @@ extern "C" {
#ifndef OPENSSL_NO_ASAN

# define OPENSSL_NO_ASAN

#endif

-#ifndef OPENSSL_NO_ASM

-# define OPENSSL_NO_ASM

-#endif

#ifndef OPENSSL_NO_ASYNC

# define OPENSSL_NO_ASYNC

#endif

diff --git a/CryptoPkg/Library/OpensslLib/ApiHooks.c
b/CryptoPkg/Library/OpensslLib/ApiHooks.c
new file mode 100644
index 0000000000..58cff16838
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/ApiHooks.c
@@ -0,0 +1,18 @@
+/** @file

+ OpenSSL Library API hooks.

+

+Copyright (c) 2020, Intel Corporation. All rights
reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+VOID *

+__imp_RtlVirtualUnwind (

+ VOID * Args

+ )

+{

+ return NULL;

+}

+

diff --git
a/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
new file mode 100644
index 0000000000..ef20d2b84e
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c
@@ -0,0 +1,34 @@
+/** @file

+ Constructor to initialize CPUID data for OpenSSL assembly
operations.

+

+Copyright (c) 2020, Intel Corporation. All rights
reserved.<BR>

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+extern void OPENSSL_cpuid_setup (void);

+

+/**

+ Constructor routine for OpensslLib.

+

+ The constructor calls an internal OpenSSL function which
fetches
a
local
copy

+ of the hardware capability flags, used to enable native
crypto
instructions.

+

+ @param None

+

+ @retval EFI_SUCCESS The construction succeeded.

+

+**/

+EFI_STATUS

+EFIAPI

+OpensslLibConstructor (

+ VOID

+ )

+{

+ OPENSSL_cpuid_setup ();

+

+ return EFI_SUCCESS;

+}

+

diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl
b/CryptoPkg/Library/OpensslLib/process_files.pl
index 57ce195394..472f59bc8e 100755
--- a/CryptoPkg/Library/OpensslLib/process_files.pl
+++ b/CryptoPkg/Library/OpensslLib/process_files.pl
@@ -9,9 +9,63 @@
# do not need to do this, since the results are stored in the
EDK2

# git repository for them.

#

+# Due to the script wrapping required to process the OpenSSL

+# configuration data, each native architecture must be
processed

+# individually by the maintainer (in addition to the standard
version):

+# ./process_files.pl

+# ./process_files.pl X64

+# ./process_files.pl [Arch]

+

use strict;

use Cwd;

use File::Copy;

+use File::Basename;

+use File::Path qw(make_path remove_tree);

+use Text::Tabs;

+

+#

+# OpenSSL perlasm generator script does not transfer the
copyright
header

+#

+sub copy_license_header

+{

+ my @args = split / /, shift; #Separate args by spaces

+ my $source = $args[1]; #Source file is second
(after
"perl")

+ my $target = pop @args; #Target file is always
last

+ chop ($target); #Remove newline char

+

+ my $temp_file_name = "license.tmp";

+ open (my $source_file, "<" . $source) || die $source;

+ open (my $target_file, "<" . $target) || die $target;

+ open (my $temp_file, ">" . $temp_file_name) || die
$temp_file_name;

+

+ #Add "generated file" warning

+ $source =~ s/^..//; #Remove leading "./"

+ print ($temp_file "; WARNING: do not edit!\r\n");

+ print ($temp_file "; Generated from $source\r\n");

+ print ($temp_file ";\r\n");

+

+ #Copy source file header to temp file

+ while (my $line = <$source_file>) {

+ next if ($line =~ /#!/); #Ignore shebang line

+ $line =~ s/#/;/; #Fix comment character for
assembly

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace,
fixup
line
endings

+ print ($temp_file $line);

+ last if ($line =~ /http/); #Last line of copyright
header
contains a web link

+ }

+ print ($temp_file "\r\n");

+ #Retrieve generated assembly contents

+ while (my $line = <$target_file>) {

+ $line =~ s/\s+$/\r\n/; #Trim trailing whitepsace,
fixup
line
endings

+ print ($temp_file expand ($line)); #expand() replaces
tabs with
spaces

+ }

+

+ close ($source_file);

+ close ($target_file);

+ close ($temp_file);

+

+ move ($temp_file_name, $target) ||

+ die "Cannot replace \"" . $target . "\"!";

+}



#

# Find the openssl directory name for use lib. We have to do
this

@@ -21,10 +75,41 @@ use File::Copy;
#

my $inf_file;

my $OPENSSL_PATH;

+my $uefi_config;

+my $extension;

+my $arch;

my @inf;



BEGIN {

$inf_file = "OpensslLib.inf";

+ $uefi_config = "UEFI";

+ $arch = shift;

+

+ if (defined $arch) {

+ if (uc ($arch) eq "X64") {

+ $arch = "X64";

+ $inf_file = "OpensslLibX64.inf";

+ $uefi_config = "UEFI-x86_64";

+ $extension = "nasm";

+ } else {

+ die "Unsupported architecture \"" . $arch . "\"!";

+ }

+ if ($extension eq "nasm") {

+ if (`nasm -v 2>&1`) {

+ #Presence of nasm executable will trigger
inclusion of
AVX
instructions

+ die "\nCannot run assembly generators with
NASM in
path!\n\n";

+ }

+ }

+

+ # Prepare assembly folder

+ if (-d $arch) {

+ remove_tree ($arch, {safe => 1}) ||

+ die "Cannot clean assembly folder \"" . $arch
.
"\"!";

+ } else {

+ mkdir $arch ||

+ die "Cannot create assembly folder \"" . $arch
.
"\"!";

+ }

+ }



# Read the contents of the inf file

open( FD, "<" . $inf_file ) ||

@@ -47,9 +132,9 @@ BEGIN {
# Configure UEFI

system(

"./Configure",

- "UEFI",

+ "--config=../uefi-asm.conf",

+ "$uefi_config",

"no-afalgeng",

- "no-asm",

"no-async",

"no-autoerrinit",

"no-autoload-config",

@@ -129,23 +214,53 @@ BEGIN {
# Retrieve file lists from OpenSSL configdata

#

use configdata qw/%unified_info/;

+use configdata qw/%config/;

+use configdata qw/%target/;

+

+#

+# Collect build flags from configdata

+#

+my $flags = "";

+foreach my $f (@{$config{lib_defines}}) {

+ $flags .= " -D$f";

+}



my @cryptofilelist = ();

my @sslfilelist = ();

+my @asmfilelist = ();

+my @asmbuild = ();

foreach my $product ((@{$unified_info{libraries}},

@{$unified_info{engines}})) {

foreach my $o (@{$unified_info{sources}->{$product}}) {

foreach my $s (@{$unified_info{sources}->{$o}}) {

- next if ($unified_info{generate}->{$s});

- next if $s =~ "crypto/bio/b_print.c";

-

# No need to add unused files in UEFI.

# So it can reduce porting time, compile time,
library
size.

+ next if $s =~ "crypto/bio/b_print.c";

next if $s =~ "crypto/rand/randfile.c";

next if $s =~ "crypto/store/";

next if $s =~ "crypto/err/err_all.c";

next if $s =~ "crypto/aes/aes_ecb.c";



+ if ($unified_info{generate}->{$s}) {

+ if (defined $arch) {

+ my $buildstring = "perl";

+ foreach my $arg
(@{$unified_info{generate}-
{$s}}) {

+ if ($arg =~ ".pl") {

+ $buildstring .= " ./openssl/$arg";

+ } elsif ($arg =~ "PERLASM_SCHEME") {

+ $buildstring .= "
$target{perlasm_scheme}";

+ } elsif ($arg =~ "LIB_CFLAGS") {

+ $buildstring .= "$flags";

+ }

+ }

+ ($s, my $path, undef) = fileparse($s,
qr/\.[^.]*/);

+ $buildstring .= "
./$arch/$path$s.$extension";

+ make_path ("./$arch/$path");

+ push @asmbuild, "$buildstring\n";

+ push @asmfilelist, "
$arch/$path$s.$extension\r\n";

+ }

+ next;

+ }

if ($product =~ "libssl") {

push @sslfilelist, ' $(OPENSSL_PATH)/' . $s .
"\r\n";

next;

@@ -183,15 +298,31 @@ foreach (@headers){
}





+#

+# Generate assembly files

+#

+if (@asmbuild) {

+ print "\n--> Generating assembly files ... ";

+ foreach my $buildstring (@asmbuild) {

+ system ("$buildstring");

+ copy_license_header ($buildstring);

+ }

+ print "Done!";

+}

+

#

# Update OpensslLib.inf with autogenerated file list

#

my @new_inf = ();

my $subbing = 0;

-print "\n--> Updating OpensslLib.inf ... ";

+print "\n--> Updating $inf_file ... ";

foreach (@inf) {

+ if ($_ =~ "DEFINE OPENSSL_FLAGS_CONFIG") {

+ push @new_inf, " DEFINE OPENSSL_FLAGS_CONFIG =" .
$flags
.
"\r\n";

+ next;

+ }

if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist, @sslfilelist;

+ push @new_inf, $_, @asmfilelist, @cryptofilelist,
@sslfilelist;

$subbing = 1;

next;

}

@@ -216,49 +347,51 @@ rename( $new_inf_file, $inf_file ) ||
die "rename $inf_file";

print "Done!";



-#

-# Update OpensslLibCrypto.inf with auto-generated file list
(no
libssl)

-#

-$inf_file = "OpensslLibCrypto.inf";

-

-# Read the contents of the inf file

-@inf = ();

-@new_inf = ();

-open( FD, "<" . $inf_file ) ||

- die "Cannot open \"" . $inf_file . "\"!";

-@inf = (<FD>);

-close(FD) ||

- die "Cannot close \"" . $inf_file . "\"!";

+if (!defined $arch) {

+ #

+ # Update OpensslLibCrypto.inf with auto-generated file
list
(no
libssl)

+ #

+ $inf_file = "OpensslLibCrypto.inf";



-$subbing = 0;

-print "\n--> Updating OpensslLibCrypto.inf ... ";

-foreach (@inf) {

- if ( $_ =~ "# Autogenerated files list starts here" ) {

- push @new_inf, $_, @cryptofilelist;

- $subbing = 1;

- next;

- }

- if ( $_ =~ "# Autogenerated files list ends here" ) {

- push @new_inf, $_;

- $subbing = 0;

- next;

+ # Read the contents of the inf file

+ @inf = ();

+ @new_inf = ();

+ open( FD, "<" . $inf_file ) ||

+ die "Cannot open \"" . $inf_file . "\"!";

+ @inf = (<FD>);

+ close(FD) ||

+ die "Cannot close \"" . $inf_file . "\"!";

+

+ $subbing = 0;

+ print "\n--> Updating OpensslLibCrypto.inf ... ";

+ foreach (@inf) {

+ if ( $_ =~ "# Autogenerated files list starts here" )
{

+ push @new_inf, $_, @cryptofilelist;

+ $subbing = 1;

+ next;

+ }

+ if ( $_ =~ "# Autogenerated files list ends here" ) {

+ push @new_inf, $_;

+ $subbing = 0;

+ next;

+ }

+

+ push @new_inf, $_

+ unless ($subbing);

}



- push @new_inf, $_

- unless ($subbing);

+ $new_inf_file = $inf_file . ".new";

+ open( FD, ">" . $new_inf_file ) ||

+ die $new_inf_file;

+ print( FD @new_inf ) ||

+ die $new_inf_file;

+ close(FD) ||

+ die $new_inf_file;

+ rename( $new_inf_file, $inf_file ) ||

+ die "rename $inf_file";

+ print "Done!";

}



-$new_inf_file = $inf_file . ".new";

-open( FD, ">" . $new_inf_file ) ||

- die $new_inf_file;

-print( FD @new_inf ) ||

- die $new_inf_file;

-close(FD) ||

- die $new_inf_file;

-rename( $new_inf_file, $inf_file ) ||

- die "rename $inf_file";

-print "Done!";

-

#

# Copy opensslconf.h and dso_conf.h generated from OpenSSL
Configuration

#

diff --git a/CryptoPkg/Library/OpensslLib/uefi-asm.conf
b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
new file mode 100644
index 0000000000..55eedbf3ba
--- /dev/null
+++ b/CryptoPkg/Library/OpensslLib/uefi-asm.conf
@@ -0,0 +1,15 @@
+## -*- mode: perl; -*-

+## UEFI assembly openssl configuration targets.

+

+my %targets = (

+#### UEFI

+ "UEFI-x86_64" => {

+ perlasm_scheme => "nasm",

+ # inherit_from => [ "UEFI", asm("x86_64_asm") ],

+ inherit_from => [ "UEFI" ],

+ cpuid_asm_src => "x86_64cpuid.s",

+ aes_asm_src => "aes_core.c aes_cbc.c vpaes-
x86_64.s
aesni-
x86_64.s
aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",

+ sha1_asm_src => "sha1-x86_64.s sha256-x86_64.s
sha512-
x86_64.s
sha1-mb-x86_64.s sha256-mb-x86_64.s",

+ modes_asm_src => "ghash-x86_64.s",

+ },

+);

--
2.28.0.windows.1