From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web09.1588.1667846237493298927 for ; Mon, 07 Nov 2022 10:37:18 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Cj5vPjxj; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: judah.vang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667846238; x=1699382238; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BxpOw1d5qsRpJgcj/Zqj60a31WxFitFKp6nOY4cInDE=; b=Cj5vPjxjsI+mIkEuI2Y28PVWlmTjYyz4KLy4sAtZLh7USS6klGSkr1/o AxNSjSleL3vleweHSJ5G9S6YqaOcIGQAc15W+WLAd0IXRb7yPH5w4gNCR 2/Nfdk/i7hrIIceKKrghtDkkJFIB4A1ekMFTZ8TuudrtIrvTagNOmLv8T aZuht10vQrXMjEjnUgnudRlwFgEuwvAYQvrDemeyT6uVni1uYdNFnDy7M w5iCIZbQSmBEq7XcEr51zCFiRf2C+u/6DLrFqYBpt5bmgTglUpz5Kke0J srNuPUAsuAeqIkxaQVNRDxyN9KmtVv43sDrbRqaIEzeuWODCN9uvvuE7G A==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="310491665" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="310491665" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 10:37:18 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="704992722" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="704992722" Received: from jvang-mobl.amr.corp.intel.com ([10.209.73.202]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 10:37:17 -0800 From: "Judah Vang" To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Xiaoyu Lu , Guomin Jiang , Nishant C Mistry Subject: [PATCH v2 1/2] CryptoPkg: Sha1 functions causing build errors Date: Mon, 7 Nov 2022 10:36:39 -0800 Message-Id: <20221107183640.3470-2-judah.vang@intel.com> X-Mailer: git-send-email 2.35.1.windows.2 In-Reply-To: <20221107183640.3470-1-judah.vang@intel.com> References: <20221107183640.3470-1-judah.vang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3991 Fix build issue when DiSABLE_SHA1_DEPRECATED_INTERFACES is defined. Percolate the #ifndef DiSABLE_SHA1_DEPRECATED_INTERFACES to all the Sha1 functions. Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Cc: Nishant C Mistry Signed-off-by: Jian J Wang Signed-off-by: Nishant C Mistry Signed-off-by: Judah Vang --- CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c index f9796b215865..ede9fa8c09ec 100644 --- a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c +++ b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c @@ -6,7 +6,7 @@ This API, when called, will calculate the Hash using the hashing algorithm specified by PcdHashApiLibPolicy. - Copyright (c) 2020, Intel Corporation. All rights reserved.
+ Copyright (c) 2020-2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -33,9 +33,11 @@ HashApiGetContextSize ( ) { switch (PcdGet32 (PcdHashApiLibPolicy)) { + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES case HASH_ALG_SHA1: return Sha1GetContextSize (); break; + #endif case HASH_ALG_SHA256: return Sha256GetContextSize (); @@ -75,9 +77,11 @@ HashApiInit ( ) { switch (PcdGet32 (PcdHashApiLibPolicy)) { + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES case HASH_ALG_SHA1: return Sha1Init (HashContext); break; + #endif case HASH_ALG_SHA256: return Sha256Init (HashContext); @@ -119,9 +123,11 @@ HashApiDuplicate ( ) { switch (PcdGet32 (PcdHashApiLibPolicy)) { + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES case HASH_ALG_SHA1: return Sha1Duplicate (HashContext, NewHashContext); break; + #endif case HASH_ALG_SHA256: return Sha256Duplicate (HashContext, NewHashContext); @@ -165,9 +171,11 @@ HashApiUpdate ( ) { switch (PcdGet32 (PcdHashApiLibPolicy)) { + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES case HASH_ALG_SHA1: return Sha1Update (HashContext, DataToHash, DataToHashLen); break; + #endif case HASH_ALG_SHA256: return Sha256Update (HashContext, DataToHash, DataToHashLen); @@ -209,9 +217,11 @@ HashApiFinal ( ) { switch (PcdGet32 (PcdHashApiLibPolicy)) { + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES case HASH_ALG_SHA1: return Sha1Final (HashContext, Digest); break; + #endif case HASH_ALG_SHA256: return Sha256Final (HashContext, Digest); @@ -255,9 +265,11 @@ HashApiHashAll ( ) { switch (PcdGet32 (PcdHashApiLibPolicy)) { + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES case HASH_ALG_SHA1: return Sha1HashAll (DataToHash, DataToHashLen, Digest); break; + #endif case HASH_ALG_SHA256: return Sha256HashAll (DataToHash, DataToHashLen, Digest); -- 2.35.1.windows.2