]> git.proxmox.com Git - mirror_edk2.git/commit
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)
commit823005621ef4757130f009c48dc96b099cccadf7
treec4e20826c6234766c5ede6e0218a10f85401869c
parent4e719ab5d1de26fbd3285c346053ec905ec1a053
CryptoPkg/OpensslLib: introduce OpensslLibCrypto instance

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