From nobody Mon Sep 16 20:00:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+101076+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101076+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678696239; cv=none; d=zohomail.com; s=zohoarc; b=jPWo+Ph96kLiUlmSgW09LGfmxeoqMb0uQAvW4jYMP79LbeYmnxaau5A7UlbAs6YpBx1dpveda0YLYVJlXztBKBOwZwz0C4NR55AHnsh5xhx40I2sQL9JwUFS9pAEenGUUoQV6Otr0CckBU7obR/7ssOOls8Nbl5C0WnUtWbjiWU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678696239; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=pWKbnhJfvIYlc8yQ1cNlZg4BoOwEtf9TYvvYkp4OCfk=; b=ZzuE9Ugw/1rWh6ZQZ57V69ZVnAYOLnTOPXlDUZiSLrGeZnX24efFP00XskK4GkO1Dim9tIbdlCXjrpitE+HV6DgxfHlELQxfAFai3rb3ZABJ1udkqqDy2D7lwF6feqnfUseYIysYyojOhxO6ZpxOkgx0+gS0cU/xh6riSDR08Vk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101076+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1678696239603710.4296247235368; Mon, 13 Mar 2023 01:30:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Wj87YY1788612xavQ9ZqUn5l; Mon, 13 Mar 2023 01:30:39 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.15105.1678696238207750449 for ; Mon, 13 Mar 2023 01:30:38 -0700 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-463-bFR0QG0pMIC8sPJxgkGa9Q-1; Mon, 13 Mar 2023 04:30:34 -0400 X-MC-Unique: bFR0QG0pMIC8sPJxgkGa9Q-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4C7A800050; Mon, 13 Mar 2023 08:30:33 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 58AB01731B; Mon, 13 Mar 2023 08:30:33 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 75ED41801E91; Mon, 13 Mar 2023 09:30:16 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Jian J Wang , Pawel Polawski , Xiaoyu Lu , Ard Biesheuvel , Guomin Jiang , Gerd Hoffmann , Jiewen Yao , Oliver Steffen , Jordan Justen Subject: [edk2-devel] [PATCH 16/22] [hash] CryptoPkg/openssl: add OpensslLibHash.inf Date: Mon, 13 Mar 2023 09:30:10 +0100 Message-Id: <20230313083016.136448-17-kraxel@redhat.com> In-Reply-To: <20230313083016.136448-1-kraxel@redhat.com> References: <20230313083016.136448-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kraxel@redhat.com X-Gm-Message-State: tjIrJf1XxlfNINjFXpxlaW74x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1678696239; bh=REiyCJweNxtETvzCE2/wQfQ3jJN3gr2sH6Vm0q4vKcU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=UR438BRjEJI9U64+Ttw6TqIozwtra4cqZyGsYIBPg4wpbTkp4df1T5xVFkUCgdQid57 iC+d9WLk3cwBSpD5QLhsOgzJxm2eMpEBb05GvAQvMS4DLEGYKW8ayyzf//6fsbWYxnEz2 w5Ckk4EeoqCHH6n2CkZG1IBu1rkbbJgNdXc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1678696240957100065 Content-Type: text/plain; charset="utf-8"; x-default="true" Add *.inf variant with hash functions only, to support SEC and PEI doing measurements. I don't think we really need this, using OpensslLibCrypto.inf and depending on the linker dropping unused object files should work equally well. For trouble-shooting it's handy though because you'll get linker errors instead of bloated binaries. So not sure yet what to do with this ... Signed-off-by: Gerd Hoffmann --- .../Library/OpensslLib/OpensslLibHash.inf | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibHash.inf diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibHash.inf b/CryptoPkg/Li= brary/OpensslLib/OpensslLibHash.inf new file mode 100644 index 000000000000..2d5838e682e9 --- /dev/null +++ b/CryptoPkg/Library/OpensslLib/OpensslLibHash.inf @@ -0,0 +1,126 @@ +## @file +# This module provides OpenSSL Library implementation with ECC and TLS +# features removed and features have performance optimizations enabled. +# +# Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.
+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights= reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D OpensslLibCrypto + MODULE_UNI_FILE =3D OpensslLibCrypto.uni + FILE_GUID =3D E29FC209-8B64-4500-BD20-AF4EAE47EA0E + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D OpensslLib + + DEFINE OPENSSL_PATH =3D openssl + DEFINE OPENSSL_GEN_PATH =3D openssl-gen + DEFINE OPENSSL_FLAGS =3D -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DEDK2_OPENSSL_NOEC= =3D1 -DOPENSSL_NO_ASM + DEFINE OPENSSL_FLAGS_NOASM =3D=20 + +# +# VALID_ARCHITECTURES =3D IA32 X64 ARM AARCH64 +# + +[Sources] +# Autogenerated files list starts here +# Autogenerated files list ends here + +[Packages] + MdePkg/MdePkg.dec + CryptoPkg/CryptoPkg.dec + +[LibraryClasses] + BaseLib + DebugLib + RngLib + +[LibraryClasses.ARM] + ArmSoftFloatLib + +[BuildOptions] + # + # Disables the following Visual Studio compiler warnings brought by open= ssl 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 t= he current code page + # + MSFT:*_*_IA32_CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAG= S) $(OPENSSL_FLAGS_NOASM) /wd4090 /wd4132 /wd4210 /wd4244 /wd4245 /wd4267 /= wd4310 /wd4389 /wd4700 /wd4702 /wd4706 /wd4819 + MSFT:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAG= S) $(OPENSSL_FLAGS_NOASM) /wd4090 /wd4132 /wd4210 /wd4244 /wd4245 /wd4267 /= wd4306 /wd4310 /wd4700 /wd4389 /wd4702 /wd4706 /wd4819 + + # + # Disable following Visual Studio 2015 compiler warnings brought by open= ssl source, + # so we do not break the build with /WX option: + # C4718: recursive call has no side effects, deleting + # + MSFT:*_VS2015x86_IA32_CC_FLAGS =3D /wd4718 + MSFT:*_VS2015x86_X64_CC_FLAGS =3D /wd4718 + + INTEL:*_*_IA32_CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPEN= SSL_FLAGS) $(OPENSSL_FLAGS_NOASM) /w + INTEL:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPEN= SSL_FLAGS) $(OPENSSL_FLAGS_NOASM) /w + + # + # Suppress the following build warnings in openssl so we don't break the= build with -Werror + # -Werror=3Dmaybe-uninitialized: there exist some other paths for whic= h the variable is not initialized. + # -Werror=3Dformat: Check calls to printf and scanf, etc., to make sur= e that the arguments supplied have + # types appropriate to the format string specified. + # -Werror=3Dunused-but-set-variable: Warn whenever a local variable is= assigned to, but otherwise unused (aside from its declaration). + # + GCC:*_*_IA32_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSS= L_FLAGS_NOASM) -Wno-error=3Dmaybe-uninitialized -Wno-error=3Dunused-but-set= -variable + GCC:*_*_X64_CC_FLAGS =3D -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSS= L_FLAGS_NOASM) -Wno-error=3Dmaybe-uninitialized -Wno-error=3Dformat -Wno-fo= rmat -Wno-error=3Dunused-but-set-variable -DNO_MSABI_VA_FUNCS + GCC:*_*_ARM_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe-uniniti= alized -Wno-error=3Dunused-but-set-variable + GCC:*_*_AARCH64_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe-uniniti= alized -Wno-format -Wno-error=3Dunused-but-set-variable -Wno-error=3Dformat + GCC:*_*_RISCV64_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe-uniniti= alized -Wno-format -Wno-error=3Dunused-but-set-variable + GCC:*_*_LOONGARCH64_CC_FLAGS =3D $(OPENSSL_FLAGS) -Wno-error=3Dmaybe-uni= nitialized -Wno-format -Wno-error=3Dunused-but-set-variable + GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Duninitialized + GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Duninitialized + GCC:*_CLANGPDB_*_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Duninitialized -Wno= -error=3Dincompatible-pointer-types -Wno-error=3Dpointer-sign -Wno-error=3D= implicit-function-declaration -Wno-error=3Dignored-pragma-optimize + + # suppress the following warnings in openssl so we don't break the build= with warnings-as-errors: + # 1295: Deprecated declaration - give arg types + # 550: 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 =3D= =3D -1)") + # 177: was declared but never referenced + # 223: function declared implicitly + # 144: a value of type cannot be used to initialize an entity of= type + # 513: a value of 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 f= ollows a conditional return + # from the function that evaluates to true at compile time + # 546: transfer of control bypasses initialization - may be emitted ina= ppropriately if the uninitialized + # variable is never referenced after the jump + # 1: ignore "#1-D: last line of file ends without a newline" + # 3017: may be used before being set (NOTE: This was fixed in O= penSSL 1.1 HEAD with + # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be drop= ped then.) + XCODE:*_*_IA32_CC_FLAGS =3D -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FL= AGS) $(OPENSSL_FLAGS_NOASM) -w -std=3Dc99 -Wno-error=3Duninitialized + XCODE:*_*_X64_CC_FLAGS =3D -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FL= AGS) $(OPENSSL_FLAGS_NOASM) -w -std=3Dc99 -Wno-error=3Duninitialized + + # + # AARCH64 uses strict alignment and avoids SIMD registers for code that = may execute + # with the MMU off. This involves SEC, PEI_CORE and PEIM modules as well= as BASE + # libraries, given that they may be included into such modules. + # This library, even though of the BASE type, is never used in such case= s, and + # avoiding the SIMD register file (which is shared with the FPU) prevent= s the + # compiler from successfully building some of the OpenSSL source files t= hat + # use floating point types, so clear the flags here. + # + GCC:*_*_AARCH64_CC_XIPFLAGS =3D=3D --=20 2.39.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#101076): https://edk2.groups.io/g/devel/message/101076 Mute This Topic: https://groups.io/mt/97576423/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-