From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.14911.1679043720870874677 for ; Fri, 17 Mar 2023 02:02:03 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=BAxddxOg; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: wenxing.hou@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679043723; x=1710579723; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PBaRtvfNWmp20cJ5M1L86tUTaXl6g82GNiXgiEGGQsk=; b=BAxddxOgh0zxPXPlvKn9dKYYu4QmN4EnijFOJ0tnZJpteVIU1NZFs3vZ ATEIdCjAjJyuTSzlCfd+Y14yv+6qLVPItBX3k6TN5BTvKTNiigS7u+hio dXodlmLgPewCb0d6DCx49WnNvhUJONz9T8WtBJq+y8xWKWFvP3TbEpeO6 IAocbIXIV6n45xz+JYwrpvZgjD4omm6RYfKyA5kqQRdDkQLudoDCFUYwN Ragysx3xgA4IjRJShb98IoqqXyVWThho9n0zxz3q+B1NfBDJR7EaBmKHY nwacJJ/SzyIlkueNHL66sLJCf8q0o2geLPJR4pyPuHZychTFVsRdiFVk+ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="317871126" X-IronPort-AV: E=Sophos;i="5.98,268,1673942400"; d="scan'208";a="317871126" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2023 02:02:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="926066820" X-IronPort-AV: E=Sophos;i="5.98,268,1673942400"; d="scan'208";a="926066820" Received: from shwdejointd777.ccr.corp.intel.com ([10.239.157.39]) by fmsmga006.fm.intel.com with ESMTP; 17 Mar 2023 02:02:01 -0700 From: "Wenxing Hou" To: devel@edk2.groups.io Cc: Wenxing Hou Subject: [edk2-staging/OpenSSL11_EOL PATCH 2/7] Clear unnecessary API in DH Date: Fri, 17 Mar 2023 17:00:48 +0800 Message-Id: <20230317090053.1895-3-wenxing.hou@intel.com> X-Mailer: git-send-email 2.26.2.windows.1 In-Reply-To: <20230317090053.1895-1-wenxing.hou@intel.com> References: <20230317090053.1895-1-wenxing.hou@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Signed-off-by: Wenxing Hou --- .../Library/BaseCryptLibMbedTls/Pk/CryptDh.c | 73 ------------------- 1 file changed, 73 deletions(-) diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptDh.c b/CryptoPkg= /Library/BaseCryptLibMbedTls/Pk/CryptDh.c index cd0f3bd023..a2683721c3 100644 --- a/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptDh.c +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptDh.c @@ -12,13 +12,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D =0D -static const unsigned char mffehde2048_P[] =3D MBEDTLS_DHM_RFC7919_FFDHE20= 48_P_BIN;=0D -static const unsigned char mffehde3072_P[] =3D MBEDTLS_DHM_RFC7919_FFDHE30= 72_P_BIN;=0D -static const unsigned char mffehde4096_P[] =3D MBEDTLS_DHM_RFC7919_FFDHE40= 96_P_BIN;=0D -static const unsigned char mffehde2048_G[] =3D MBEDTLS_DHM_RFC7919_FFDHE20= 48_G_BIN;=0D -static const unsigned char mffehde3072_G[] =3D MBEDTLS_DHM_RFC7919_FFDHE30= 72_G_BIN;=0D -static const unsigned char mffehde4096_G[] =3D MBEDTLS_DHM_RFC7919_FFDHE40= 96_G_BIN;=0D -=0D /**=0D Allocates and Initializes one Diffie-Hellman Context for subsequent use.= =0D =0D @@ -44,72 +37,6 @@ DhNew ( return ctx;=0D }=0D =0D -/**=0D - Allocates and Initializes one Diffie-Hellman Context for subsequent use= =0D - with the NID.=0D -=0D - @param Nid cipher NID=0D -=0D - @return Pointer to the Diffie-Hellman Context that has been initialized= .=0D - If the allocations fails, DhNew() returns NULL.=0D -=0D -**/=0D -VOID *=0D -EFIAPI=0D -DhNewByNid (=0D - IN UINTN Nid=0D - )=0D -{=0D - mbedtls_dhm_context *ctx;=0D - INT32 Ret;=0D -=0D - ctx =3D AllocateZeroPool (sizeof(mbedtls_dhm_context));=0D - if (ctx =3D=3D NULL) {=0D - return NULL;=0D - }=0D -=0D - mbedtls_dhm_init (ctx);=0D -=0D - switch (Nid) {=0D - case CRYPTO_NID_FFDHE2048:=0D - Ret =3D mbedtls_mpi_read_binary (&ctx->P, mffehde2048_P, sizeof(mffehd= e2048_P));=0D - if (Ret !=3D 0) {=0D - goto Error;=0D - }=0D - Ret =3D mbedtls_mpi_read_binary (&ctx->G, mffehde2048_G, sizeof(mffehd= e2048_G));=0D - if (Ret !=3D 0) {=0D - goto Error;=0D - }=0D - break;=0D - case CRYPTO_NID_FFDHE3072:=0D - Ret =3D mbedtls_mpi_read_binary (&ctx->P, mffehde3072_P, sizeof(mffehd= e3072_P));=0D - if (Ret !=3D 0) {=0D - goto Error;=0D - }=0D - Ret =3D mbedtls_mpi_read_binary (&ctx->G, mffehde3072_G, sizeof(mffehd= e3072_G));=0D - if (Ret !=3D 0) {=0D - goto Error;=0D - }=0D - break;=0D - case CRYPTO_NID_FFDHE4096:=0D - Ret =3D mbedtls_mpi_read_binary (&ctx->P, mffehde4096_P, sizeof(mffehd= e4096_P));=0D - if (Ret !=3D 0) {=0D - goto Error;=0D - }=0D - Ret =3D mbedtls_mpi_read_binary (&ctx->G, mffehde4096_G, sizeof(mffehd= e4096_G));=0D - if (Ret !=3D 0) {=0D - goto Error;=0D - }=0D - break;=0D - default:=0D - goto Error;=0D - }=0D - return ctx;=0D -Error:=0D - FreePool (ctx);=0D - return NULL;=0D -}=0D -=0D /**=0D Release the specified DH context.=0D =0D --=20 2.26.2.windows.1