CryptoPkg/OpensslLib: introduce OpensslLibCrypto instance
authorLaszlo Ersek <lersek@redhat.com>
Thu, 23 Feb 2017 18:35:10 +0000 (19:35 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Sat, 25 Feb 2017 13:55:55 +0000 (14:55 +0100)
Commit 32387e0081db ("CryptoPkg: Enable ssl build in OpensslLib directly",
2016-12-14) pulls OpenSSL's libssl files into the "OpensslLib.inf" library
instance unconditionally.

If a platform doesn't include the TLS modules, such as

- CryptoPkg/Library/TlsLib/TlsLib.inf
- NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
- NetworkPkg/TlsDxe/TlsDxe.inf

then the platform never actually uses the libssl functionality that gets
built into "OpensslLib.inf".

Tomas Hoger from Red Hat Product Security tells me that security
evaluation is less demanding if we can actually *exclude* the libssl files
from such OVMF builds that don't specify -D TLS_ENABLE (rather than just
trust modules not to call libssl functions if we don't specify -D
TLS_ENABLE).

This patch introduces a parallel OpensslLib instance called
"OpensslLibCrypto" that is appropriate for platform builds without TLS
enablement. It does not build C source files in vain, and it eases
security review -- all libssl vulnerabilities can be excluded at once.

"OpensslLibCrypto.inf" is created as a copy of "OpensslLib.inf", modifying
the BASE_NAME, MODULE_UNI_FILE and FILE_GUID defines.

"process_files.sh" is extended to auto-generate the list of OpenSSL files
for both library instances accordingly. This list is updated in
"OpensslLibCrypto.inf" at once.

"OpensslLibCrypto.uni" is introduced as a copy of "OpensslLib.uni",
highlighting the difference.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gary Lin <glin@suse.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Qin Long <qin.long@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Cc: Tomas Hoger <thoger@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf [new file with mode: 0644]
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.uni [new file with mode: 0644]
CryptoPkg/Library/OpensslLib/process_files.sh

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
new file mode 100644 (file)
index 0000000..9a03c2c
--- /dev/null
@@ -0,0 +1,539 @@
+## @file\r
+#  This module provides openSSL Library implementation.\r
+#\r
+#  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
+#  This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution.  The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+##\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = OpensslLibCrypto\r
+  MODULE_UNI_FILE                = OpensslLibCrypto.uni\r
+  FILE_GUID                      = E29FC209-8B64-4500-BD20-AF4EAE47EA0E\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = OpensslLib\r
+  DEFINE OPENSSL_PATH            = openssl-1.0.2j\r
+  DEFINE OPENSSL_FLAGS           = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE\r
+\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF ARM AARCH64\r
+#\r
+\r
+[Sources]\r
+  $(OPENSSL_PATH)/e_os.h\r
+# Autogenerated files list starts here\r
+  $(OPENSSL_PATH)/crypto/cryptlib.c\r
+  $(OPENSSL_PATH)/crypto/mem.c\r
+  $(OPENSSL_PATH)/crypto/mem_clr.c\r
+  $(OPENSSL_PATH)/crypto/mem_dbg.c\r
+  $(OPENSSL_PATH)/crypto/cversion.c\r
+  $(OPENSSL_PATH)/crypto/ex_data.c\r
+  $(OPENSSL_PATH)/crypto/cpt_err.c\r
+  $(OPENSSL_PATH)/crypto/ebcdic.c\r
+  $(OPENSSL_PATH)/crypto/uid.c\r
+  $(OPENSSL_PATH)/crypto/o_time.c\r
+  $(OPENSSL_PATH)/crypto/o_str.c\r
+  $(OPENSSL_PATH)/crypto/o_dir.c\r
+  $(OPENSSL_PATH)/crypto/o_fips.c\r
+  $(OPENSSL_PATH)/crypto/o_init.c\r
+  $(OPENSSL_PATH)/crypto/fips_ers.c\r
+  $(OPENSSL_PATH)/crypto/objects/o_names.c\r
+  $(OPENSSL_PATH)/crypto/objects/obj_dat.c\r
+  $(OPENSSL_PATH)/crypto/objects/obj_lib.c\r
+  $(OPENSSL_PATH)/crypto/objects/obj_err.c\r
+  $(OPENSSL_PATH)/crypto/objects/obj_xref.c\r
+  $(OPENSSL_PATH)/crypto/md4/md4_dgst.c\r
+  $(OPENSSL_PATH)/crypto/md4/md4_one.c\r
+  $(OPENSSL_PATH)/crypto/md5/md5_dgst.c\r
+  $(OPENSSL_PATH)/crypto/md5/md5_one.c\r
+  $(OPENSSL_PATH)/crypto/sha/sha_dgst.c\r
+  $(OPENSSL_PATH)/crypto/sha/sha1dgst.c\r
+  $(OPENSSL_PATH)/crypto/sha/sha_one.c\r
+  $(OPENSSL_PATH)/crypto/sha/sha1_one.c\r
+  $(OPENSSL_PATH)/crypto/sha/sha256.c\r
+  $(OPENSSL_PATH)/crypto/sha/sha512.c\r
+  $(OPENSSL_PATH)/crypto/hmac/hmac.c\r
+  $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c\r
+  $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c\r
+  $(OPENSSL_PATH)/crypto/des/cbc_cksm.c\r
+  $(OPENSSL_PATH)/crypto/des/cbc_enc.c\r
+  $(OPENSSL_PATH)/crypto/des/cfb64enc.c\r
+  $(OPENSSL_PATH)/crypto/des/cfb_enc.c\r
+  $(OPENSSL_PATH)/crypto/des/ecb3_enc.c\r
+  $(OPENSSL_PATH)/crypto/des/ecb_enc.c\r
+  $(OPENSSL_PATH)/crypto/des/enc_read.c\r
+  $(OPENSSL_PATH)/crypto/des/enc_writ.c\r
+  $(OPENSSL_PATH)/crypto/des/fcrypt.c\r
+  $(OPENSSL_PATH)/crypto/des/ofb64enc.c\r
+  $(OPENSSL_PATH)/crypto/des/ofb_enc.c\r
+  $(OPENSSL_PATH)/crypto/des/pcbc_enc.c\r
+  $(OPENSSL_PATH)/crypto/des/qud_cksm.c\r
+  $(OPENSSL_PATH)/crypto/des/rand_key.c\r
+  $(OPENSSL_PATH)/crypto/des/rpc_enc.c\r
+  $(OPENSSL_PATH)/crypto/des/set_key.c\r
+  $(OPENSSL_PATH)/crypto/des/des_enc.c\r
+  $(OPENSSL_PATH)/crypto/des/fcrypt_b.c\r
+  $(OPENSSL_PATH)/crypto/des/xcbc_enc.c\r
+  $(OPENSSL_PATH)/crypto/des/str2key.c\r
+  $(OPENSSL_PATH)/crypto/des/cfb64ede.c\r
+  $(OPENSSL_PATH)/crypto/des/ofb64ede.c\r
+  $(OPENSSL_PATH)/crypto/des/ede_cbcm_enc.c\r
+  $(OPENSSL_PATH)/crypto/des/des_old.c\r
+  $(OPENSSL_PATH)/crypto/des/des_old2.c\r
+  $(OPENSSL_PATH)/crypto/des/read2pwd.c\r
+  $(OPENSSL_PATH)/crypto/aes/aes_core.c\r
+  $(OPENSSL_PATH)/crypto/aes/aes_misc.c\r
+  $(OPENSSL_PATH)/crypto/aes/aes_ecb.c\r
+  $(OPENSSL_PATH)/crypto/aes/aes_cbc.c\r
+  $(OPENSSL_PATH)/crypto/aes/aes_cfb.c\r
+  $(OPENSSL_PATH)/crypto/aes/aes_ofb.c\r
+  $(OPENSSL_PATH)/crypto/aes/aes_ctr.c\r
+  $(OPENSSL_PATH)/crypto/aes/aes_ige.c\r
+  $(OPENSSL_PATH)/crypto/aes/aes_wrap.c\r
+  $(OPENSSL_PATH)/crypto/rc4/rc4_skey.c\r
+  $(OPENSSL_PATH)/crypto/rc4/rc4_enc.c\r
+  $(OPENSSL_PATH)/crypto/rc4/rc4_utl.c\r
+  $(OPENSSL_PATH)/crypto/modes/cbc128.c\r
+  $(OPENSSL_PATH)/crypto/modes/ctr128.c\r
+  $(OPENSSL_PATH)/crypto/modes/cts128.c\r
+  $(OPENSSL_PATH)/crypto/modes/cfb128.c\r
+  $(OPENSSL_PATH)/crypto/modes/ofb128.c\r
+  $(OPENSSL_PATH)/crypto/modes/gcm128.c\r
+  $(OPENSSL_PATH)/crypto/modes/ccm128.c\r
+  $(OPENSSL_PATH)/crypto/modes/xts128.c\r
+  $(OPENSSL_PATH)/crypto/modes/wrap128.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_add.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_div.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_exp.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_lib.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_ctx.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_mul.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_mod.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_print.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_rand.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_shift.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_word.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_blind.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_kron.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_sqrt.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_gcd.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_prime.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_err.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_sqr.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_asm.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_recp.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_mont.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_mpi.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_exp2.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_gf2m.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_nist.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_depr.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_const.c\r
+  $(OPENSSL_PATH)/crypto/bn/bn_x931p.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_eay.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_lib.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_sign.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_saos.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_err.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_none.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_chk.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_null.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c\r
+  $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c\r
+  $(OPENSSL_PATH)/crypto/dh/dh_asn1.c\r
+  $(OPENSSL_PATH)/crypto/dh/dh_gen.c\r
+  $(OPENSSL_PATH)/crypto/dh/dh_key.c\r
+  $(OPENSSL_PATH)/crypto/dh/dh_lib.c\r
+  $(OPENSSL_PATH)/crypto/dh/dh_check.c\r
+  $(OPENSSL_PATH)/crypto/dh/dh_err.c\r
+  $(OPENSSL_PATH)/crypto/dh/dh_depr.c\r
+  $(OPENSSL_PATH)/crypto/dh/dh_ameth.c\r
+  $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c\r
+  $(OPENSSL_PATH)/crypto/dh/dh_prn.c\r
+  $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c\r
+  $(OPENSSL_PATH)/crypto/dh/dh_kdf.c\r
+  $(OPENSSL_PATH)/crypto/dso/dso_dl.c\r
+  $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c\r
+  $(OPENSSL_PATH)/crypto/dso/dso_err.c\r
+  $(OPENSSL_PATH)/crypto/dso/dso_lib.c\r
+  $(OPENSSL_PATH)/crypto/dso/dso_null.c\r
+  $(OPENSSL_PATH)/crypto/dso/dso_openssl.c\r
+  $(OPENSSL_PATH)/crypto/dso/dso_win32.c\r
+  $(OPENSSL_PATH)/crypto/dso/dso_vms.c\r
+  $(OPENSSL_PATH)/crypto/dso/dso_beos.c\r
+  $(OPENSSL_PATH)/crypto/buffer/buffer.c\r
+  $(OPENSSL_PATH)/crypto/buffer/buf_str.c\r
+  $(OPENSSL_PATH)/crypto/buffer/buf_err.c\r
+  $(OPENSSL_PATH)/crypto/bio/bio_lib.c\r
+  $(OPENSSL_PATH)/crypto/bio/bio_cb.c\r
+  $(OPENSSL_PATH)/crypto/bio/bio_err.c\r
+  $(OPENSSL_PATH)/crypto/bio/bss_mem.c\r
+  $(OPENSSL_PATH)/crypto/bio/bss_null.c\r
+  $(OPENSSL_PATH)/crypto/bio/bss_fd.c\r
+  $(OPENSSL_PATH)/crypto/bio/bss_file.c\r
+  $(OPENSSL_PATH)/crypto/bio/bss_sock.c\r
+  $(OPENSSL_PATH)/crypto/bio/bss_conn.c\r
+  $(OPENSSL_PATH)/crypto/bio/bf_null.c\r
+  $(OPENSSL_PATH)/crypto/bio/bf_buff.c\r
+  $(OPENSSL_PATH)/crypto/bio/b_dump.c\r
+  $(OPENSSL_PATH)/crypto/bio/b_sock.c\r
+  $(OPENSSL_PATH)/crypto/bio/bss_acpt.c\r
+  $(OPENSSL_PATH)/crypto/bio/bf_nbio.c\r
+  $(OPENSSL_PATH)/crypto/bio/bss_log.c\r
+  $(OPENSSL_PATH)/crypto/bio/bss_bio.c\r
+  $(OPENSSL_PATH)/crypto/bio/bss_dgram.c\r
+  $(OPENSSL_PATH)/crypto/stack/stack.c\r
+  $(OPENSSL_PATH)/crypto/lhash/lhash.c\r
+  $(OPENSSL_PATH)/crypto/lhash/lh_stats.c\r
+  $(OPENSSL_PATH)/crypto/rand/md_rand.c\r
+  $(OPENSSL_PATH)/crypto/rand/randfile.c\r
+  $(OPENSSL_PATH)/crypto/rand/rand_lib.c\r
+  $(OPENSSL_PATH)/crypto/rand/rand_err.c\r
+  $(OPENSSL_PATH)/crypto/rand/rand_egd.c\r
+  $(OPENSSL_PATH)/crypto/rand/rand_win.c\r
+  $(OPENSSL_PATH)/crypto/rand/rand_unix.c\r
+  $(OPENSSL_PATH)/crypto/rand/rand_os2.c\r
+  $(OPENSSL_PATH)/crypto/rand/rand_nw.c\r
+  $(OPENSSL_PATH)/crypto/err/err.c\r
+  $(OPENSSL_PATH)/crypto/err/err_all.c\r
+  $(OPENSSL_PATH)/crypto/err/err_prn.c\r
+  $(OPENSSL_PATH)/crypto/evp/encode.c\r
+  $(OPENSSL_PATH)/crypto/evp/digest.c\r
+  $(OPENSSL_PATH)/crypto/evp/evp_enc.c\r
+  $(OPENSSL_PATH)/crypto/evp/evp_key.c\r
+  $(OPENSSL_PATH)/crypto/evp/evp_acnf.c\r
+  $(OPENSSL_PATH)/crypto/evp/evp_cnf.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_des.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_bf.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_idea.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_des3.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_camellia.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_rc4.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_aes.c\r
+  $(OPENSSL_PATH)/crypto/evp/names.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_seed.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_rc2.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_cast.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_rc5.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_null.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_md2.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_md4.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_md5.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_sha.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_sha1.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_wp.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_dss.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_dss1.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_mdc2.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_ripemd.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_ecdsa.c\r
+  $(OPENSSL_PATH)/crypto/evp/p_open.c\r
+  $(OPENSSL_PATH)/crypto/evp/p_seal.c\r
+  $(OPENSSL_PATH)/crypto/evp/p_sign.c\r
+  $(OPENSSL_PATH)/crypto/evp/p_verify.c\r
+  $(OPENSSL_PATH)/crypto/evp/p_lib.c\r
+  $(OPENSSL_PATH)/crypto/evp/p_enc.c\r
+  $(OPENSSL_PATH)/crypto/evp/p_dec.c\r
+  $(OPENSSL_PATH)/crypto/evp/bio_md.c\r
+  $(OPENSSL_PATH)/crypto/evp/bio_b64.c\r
+  $(OPENSSL_PATH)/crypto/evp/bio_enc.c\r
+  $(OPENSSL_PATH)/crypto/evp/evp_err.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_null.c\r
+  $(OPENSSL_PATH)/crypto/evp/c_all.c\r
+  $(OPENSSL_PATH)/crypto/evp/c_allc.c\r
+  $(OPENSSL_PATH)/crypto/evp/c_alld.c\r
+  $(OPENSSL_PATH)/crypto/evp/evp_lib.c\r
+  $(OPENSSL_PATH)/crypto/evp/bio_ok.c\r
+  $(OPENSSL_PATH)/crypto/evp/evp_pkey.c\r
+  $(OPENSSL_PATH)/crypto/evp/evp_pbe.c\r
+  $(OPENSSL_PATH)/crypto/evp/p5_crpt.c\r
+  $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_old.c\r
+  $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c\r
+  $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c\r
+  $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c\r
+  $(OPENSSL_PATH)/crypto/evp/m_sigver.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c\r
+  $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_object.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_utctm.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_gentm.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_time.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_int.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_octet.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_print.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_type.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_set.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_dup.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_enum.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_utf8.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_sign.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_digest.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_verify.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_mbstr.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_strex.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_algor.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_val.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_pubkey.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_sig.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_req.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_attrib.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_bignum.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_long.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_name.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_x509.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_x509a.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_crl.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_info.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_spki.c\r
+  $(OPENSSL_PATH)/crypto/asn1/nsseq.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_nx509.c\r
+  $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c\r
+  $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c\r
+  $(OPENSSL_PATH)/crypto/asn1/i2d_pu.c\r
+  $(OPENSSL_PATH)/crypto/asn1/i2d_pr.c\r
+  $(OPENSSL_PATH)/crypto/asn1/t_req.c\r
+  $(OPENSSL_PATH)/crypto/asn1/t_x509.c\r
+  $(OPENSSL_PATH)/crypto/asn1/t_x509a.c\r
+  $(OPENSSL_PATH)/crypto/asn1/t_crl.c\r
+  $(OPENSSL_PATH)/crypto/asn1/t_pkey.c\r
+  $(OPENSSL_PATH)/crypto/asn1/t_spki.c\r
+  $(OPENSSL_PATH)/crypto/asn1/t_bitst.c\r
+  $(OPENSSL_PATH)/crypto/asn1/tasn_new.c\r
+  $(OPENSSL_PATH)/crypto/asn1/tasn_fre.c\r
+  $(OPENSSL_PATH)/crypto/asn1/tasn_enc.c\r
+  $(OPENSSL_PATH)/crypto/asn1/tasn_dec.c\r
+  $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c\r
+  $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c\r
+  $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c\r
+  $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c\r
+  $(OPENSSL_PATH)/crypto/asn1/f_int.c\r
+  $(OPENSSL_PATH)/crypto/asn1/f_string.c\r
+  $(OPENSSL_PATH)/crypto/asn1/n_pkey.c\r
+  $(OPENSSL_PATH)/crypto/asn1/f_enum.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_pkey.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_bool.c\r
+  $(OPENSSL_PATH)/crypto/asn1/x_exten.c\r
+  $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c\r
+  $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c\r
+  $(OPENSSL_PATH)/crypto/asn1/asn_mime.c\r
+  $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c\r
+  $(OPENSSL_PATH)/crypto/asn1/asn1_par.c\r
+  $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c\r
+  $(OPENSSL_PATH)/crypto/asn1/asn1_err.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_bytes.c\r
+  $(OPENSSL_PATH)/crypto/asn1/a_strnid.c\r
+  $(OPENSSL_PATH)/crypto/asn1/evp_asn1.c\r
+  $(OPENSSL_PATH)/crypto/asn1/asn_pack.c\r
+  $(OPENSSL_PATH)/crypto/asn1/p5_pbe.c\r
+  $(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c\r
+  $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c\r
+  $(OPENSSL_PATH)/crypto/asn1/asn_moid.c\r
+  $(OPENSSL_PATH)/crypto/pem/pem_sign.c\r
+  $(OPENSSL_PATH)/crypto/pem/pem_seal.c\r
+  $(OPENSSL_PATH)/crypto/pem/pem_info.c\r
+  $(OPENSSL_PATH)/crypto/pem/pem_lib.c\r
+  $(OPENSSL_PATH)/crypto/pem/pem_all.c\r
+  $(OPENSSL_PATH)/crypto/pem/pem_err.c\r
+  $(OPENSSL_PATH)/crypto/pem/pem_x509.c\r
+  $(OPENSSL_PATH)/crypto/pem/pem_xaux.c\r
+  $(OPENSSL_PATH)/crypto/pem/pem_oth.c\r
+  $(OPENSSL_PATH)/crypto/pem/pem_pk8.c\r
+  $(OPENSSL_PATH)/crypto/pem/pem_pkey.c\r
+  $(OPENSSL_PATH)/crypto/pem/pvkfmt.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_def.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_d2.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_r2x.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_cmp.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_obj.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_req.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509spki.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_vfy.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_set.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509cset.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509rset.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_err.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509name.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_v3.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_ext.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_att.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509type.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_lu.c\r
+  $(OPENSSL_PATH)/crypto/x509/x_all.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_txt.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_trs.c\r
+  $(OPENSSL_PATH)/crypto/x509/by_file.c\r
+  $(OPENSSL_PATH)/crypto/x509/by_dir.c\r
+  $(OPENSSL_PATH)/crypto/x509/x509_vpm.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_conf.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_extku.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_lib.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_prn.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3err.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_genn.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_alt.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_skey.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_akey.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_pku.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_int.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_enum.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_crld.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_purp.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_info.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_ocsp.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_pci.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/pcy_node.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/pcy_map.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c\r
+  $(OPENSSL_PATH)/crypto/x509v3/v3_scts.c\r
+  $(OPENSSL_PATH)/crypto/conf/conf_err.c\r
+  $(OPENSSL_PATH)/crypto/conf/conf_lib.c\r
+  $(OPENSSL_PATH)/crypto/conf/conf_api.c\r
+  $(OPENSSL_PATH)/crypto/conf/conf_def.c\r
+  $(OPENSSL_PATH)/crypto/conf/conf_mod.c\r
+  $(OPENSSL_PATH)/crypto/conf/conf_mall.c\r
+  $(OPENSSL_PATH)/crypto/conf/conf_sap.c\r
+  $(OPENSSL_PATH)/crypto/txt_db/txt_db.c\r
+  $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c\r
+  $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c\r
+  $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c\r
+  $(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c\r
+  $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c\r
+  $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c\r
+  $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c\r
+  $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_init.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_key.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c\r
+  $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c\r
+  $(OPENSSL_PATH)/crypto/comp/comp_lib.c\r
+  $(OPENSSL_PATH)/crypto/comp/comp_err.c\r
+  $(OPENSSL_PATH)/crypto/comp/c_rle.c\r
+  $(OPENSSL_PATH)/crypto/comp/c_zlib.c\r
+  $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c\r
+  $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c\r
+  $(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c\r
+  $(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c\r
+  $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c\r
+  $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c\r
+  $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c\r
+  $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c\r
+  $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c\r
+  $(OPENSSL_PATH)/crypto/krb5/krb5_asn.c\r
+  $(OPENSSL_PATH)/crypto/pqueue/pqueue.c\r
+  $(OPENSSL_PATH)/crypto/cmac/cmac.c\r
+  $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c\r
+  $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c\r
+\r
+# Autogenerated files list ends here\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  CryptoPkg/CryptoPkg.dec\r
+\r
+[LibraryClasses]\r
+  DebugLib\r
+\r
+[LibraryClasses.ARM]\r
+  ArmSoftFloatLib\r
+\r
+[BuildOptions]\r
+  #\r
+  # Disables the following Visual Studio compiler warnings brought by openssl source, so we do not break the build with /WX option:\r
+  # C4244: conversion from type1 to type2, possible loss of data\r
+  # C4702: unreachable code\r
+  # C4706: assignment within conditional expression\r
+  # C4133: incompatible types - from type1 to type2\r
+  # C4245: conversion from type1 to type2, signed/unsigned mismatch\r
+  # C4267: conversion from size_t to type, possible loss of data\r
+  # C4305: truncation from type1 to type2 of smaller size\r
+  # C4306: conversion from type1 to type2 of greater size\r
+  # C4702: Potentially uninitialized local variable name used\r
+  # C4311: pointer truncation from 'type' to 'type'\r
+  #\r
+  MSFT:*_*_IA32_CC_FLAGS    = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4244 /wd4245 /wd4701 /wd4702 /wd4706\r
+  MSFT:*_*_X64_CC_FLAGS     = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4133 /wd4244 /wd4245 /wd4267 /wd4701 /wd4305 /wd4306 /wd4702 /wd4706 /wd4311\r
+  MSFT:*_*_IPF_CC_FLAGS     = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4133 /wd4244 /wd4245 /wd4267 /wd4701 /wd4305 /wd4306 /wd4702 /wd4706\r
+\r
+  INTEL:*_*_IA32_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w\r
+  INTEL:*_*_X64_CC_FLAGS    = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w\r
+  INTEL:*_*_IPF_CC_FLAGS    = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w\r
+\r
+  GCC:*_*_IA32_CC_FLAGS     = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w\r
+  GCC:*_*_X64_CC_FLAGS      = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w -DNO_MSABI_VA_FUNCS\r
+  GCC:*_*_IPF_CC_FLAGS      = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w\r
+  GCC:*_*_ARM_CC_FLAGS      = $(OPENSSL_FLAGS) -w\r
+  GCC:*_*_AARCH64_CC_FLAGS  = $(OPENSSL_FLAGS) -w\r
+\r
+  # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:\r
+  # 1295: Deprecated declaration <entity> - give arg types\r
+  #  550: <entity> was set but never used\r
+  # 1293: assignment in condition\r
+  #  111: statement is unreachable (invariably "break;" after "return X;" in case statement)\r
+  #   68: integer conversion resulted in a change of sign ("if (Status == -1)")\r
+  #  177: <entity> was declared but never referenced\r
+  #  223: function <entity> declared implicitly\r
+  #  144: a value of type <type> cannot be used to initialize an entity of type <type>\r
+  #  513: a value of type <type> cannot be assigned to an entity of type <type>\r
+  #  188: enumerated type mixed with another type (i.e. passing an integer as an enum without a cast)\r
+  # 1296: Extended constant initialiser used\r
+  #  128: loop is not reachable - may be emitted inappropriately if code follows a conditional return\r
+  #       from the function that evaluates to true at compile time\r
+  #  546: transfer of control bypasses initialization - may be emitted inappropriately if the uninitialized\r
+  #       variable is never referenced after the jump\r
+  #    1: ignore "#1-D: last line of file ends without a newline"\r
+  # 3017: <entity> may be used before being set (NOTE: This was fixed in OpenSSL 1.1 HEAD with\r
+  #       commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.)\r
+  RVCT:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) --library_interface=aeabi_clib99 --diag_suppress=1296,1295,550,1293,111,68,177,223,144,513,188,128,546,1,3017 -JCryptoPkg/Include\r
+  XCODE:*_*_IA32_CC_FLAGS   = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w\r
+  XCODE:*_*_X64_CC_FLAGS    = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w\r
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.uni b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.uni
new file mode 100644 (file)
index 0000000..7891b13
--- /dev/null
@@ -0,0 +1,22 @@
+// /** @file\r
+// This module provides openSSL Library implementation (libcrypto only, no libssl).\r
+//\r
+// This module provides OpenSSL Library implementation (libcrypto only, no libssl).\r
+//\r
+// Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+//\r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution.  The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+// \r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+//\r
+// **/\r
+\r
+\r
+#string STR_MODULE_ABSTRACT             #language en-US "OpenSSL Library implementation (libcrypto only, no libssl)"\r
+\r
+#string STR_MODULE_DESCRIPTION          #language en-US "This module provides OpenSSL Library implementation (libcrypto only, no libssl)."\r
+\r
index 6f069ce..9f10409 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 #
-# This script runs the OpenSSL Configure script, then processes the
-# resulting file list into our local OpensslLib.inf and also takes
-# a copy of opensslconf.h.
+# This script runs the OpenSSL Configure script, then processes the resulting
+# file list into our local OpensslLib.inf and OpensslLibCrypto.inf, and also
+# takes a copy of opensslconf.h.
 #
 # This only needs to be done once by a developer when updating to a
 # new version of OpenSSL (or changing options, etc.). Normal users
 # git repository for them.
 
 OPENSSL_PATH=$(sed -n '/DEFINE OPENSSL_PATH/{s/.* \(openssl-[0-9.]*[a-z]*\)[[:space:]]*/\1/ p}' OpensslLib.inf)
+OPENSSL_CRYPTO_PATH=$(sed -n '/DEFINE OPENSSL_PATH/{s/.* \(openssl-[0-9.]*[a-z]*\)[[:space:]]*/\1/ p}' OpensslLibCrypto.inf)
+
+if [ "$OPENSSL_PATH" != "$OPENSSL_CRYPTO_PATH" ]; then
+    echo "OPENSSL_PATH diverges between OpensslLib.inf and OpensslLibCrypto.inf"
+    exit 1
+fi
 
 if ! cd "${OPENSSL_PATH}" ; then
     echo "Cannot change to OpenSSL directory \"${OPENSSL_PATH}\""
@@ -65,6 +71,8 @@ cd -
 
 function filelist ()
 {
+    SSL_SELECT="$1"
+
     echo '1,/# Autogenerated files list starts here/p'
     echo '/# Autogenerated files list ends here/,$p'
     echo '/# Autogenerated files list starts here/a\'
@@ -76,18 +84,25 @@ function filelist ()
                ;;
            LIBSRC=*)
                LIBSRC=$(echo "$LINE" | sed s/^LIBSRC=//)
-               for FILE in $LIBSRC; do
+               if [ "$RELATIVE_DIRECTORY" != "ssl" ] ||
+                  [ "$SSL_SELECT" = "crypto-and-ssl" ]; then
+                   for FILE in $LIBSRC; do
                        if [ "$FILE" != "b_print.c" ]; then
                            echo -e '  $(OPENSSL_PATH)/'$RELATIVE_DIRECTORY/$FILE\\r\\
                        fi
-               done
+                   done
+               fi
                ;;
        esac
     done
     echo -e \\r
 }
 
-filelist < "${OPENSSL_PATH}/MINFO" |  sed -n -f - -i OpensslLib.inf
+filelist crypto-and-ssl < "${OPENSSL_PATH}/MINFO" \
+| sed -n -f - -i OpensslLib.inf
+
+filelist crypto-only < "${OPENSSL_PATH}/MINFO" \
+| sed -n -f - -i OpensslLibCrypto.inf
 
 # We can tell Windows users to put this back manually if they can't run
 # Configure. For now, until the git repository is fixed to store things