From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.1060.1666290939355166472 for ; Thu, 20 Oct 2022 11:35:39 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=nl6Mwgee; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: michael.d.kinney@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666290939; x=1697826939; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eSUvDdABw/yApC3Wz/7Qr/O4wmBd+d6SdI5q3vdLd4Q=; b=nl6MwgeesDovvB4ycTqaJjXun1pLhjf0v6s30eBR7GemqZpo1viIZQAp xg9Lu1hRVS3DpAU3I5bLlN+rCAqJEdfp5n4Zd/1Bwanzd9fvzwKeBQrHE c1l5VHOhrWCjvibJalfJaq20Nb2CA2IY9Zml2sJzoA03hHDyV+RHpsDJs 5DS+N0eWrgOrL3pKd/tAH33ER9YxzhJ9B5Nra3AuufRI7kNl+bPcJXa/r ARV6xcyg0fcJacSB5obPX0mPcWtqoflkEJSQ8FF7faxBW2jo0Ri11wGGl laXiW1XRoFoiLfu9CHeCSZfozAK75rcUst3H5Zc0hv5LieXN2GxQmxNg5 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="308485577" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="308485577" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 11:35:37 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="632427853" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="632427853" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.212.188.143]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 11:35:36 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Yi Li , Jiewen Yao , Jian J Wang , Xiaoyu Lu , Guomin Jiang , Christopher Zurcher Subject: [Patch v2 13/16] Revert "CryptoPkg: Update process_files.pl to auto add PCD config option" Date: Thu, 20 Oct 2022 11:35:07 -0700 Message-Id: <20221020183510.1799-14-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.37.1.windows.1 In-Reply-To: <20221020183510.1799-1-michael.d.kinney@intel.com> References: <20221020183510.1799-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Yi Li This reverts commit 499b0d5fa57dafe47b260aaf0cea6c6b0286e656. Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Cc: Christopher Zurcher Cc: Michael D Kinney Signed-off-by: Yi Li --- CryptoPkg/Library/OpensslLib/process_files.pl | 77 +------------------ 1 file changed, 3 insertions(+), 74 deletions(-) diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl b/CryptoPkg/Library/OpensslLib/process_files.pl index 82e5176b3995..7e18c9f52d35 100755 --- a/CryptoPkg/Library/OpensslLib/process_files.pl +++ b/CryptoPkg/Library/OpensslLib/process_files.pl @@ -81,19 +81,6 @@ my $uefi_config; my $extension; my $arch; my @inf; -# -# Use PCD to conditionally enable certain openssl features. -# $conditional_feature contains pcd_name:fetures_names pairs -# of conditional features. -# @conditional_feature_dir contains relative_path:pcd_name pairs -# of conditional features in openssl, MUST correspond to the content -# in $conditional_feature. -# -# Configure list [openssl_configuration : new_define_list : new_file_list : pcd] -# 1. no-ec : {NO_EC, NO_ECDH, NO_ECDSA, NO_TLS1_3, NO_SM2} : {/ec/, /sm2/} : PcdOpensslEcEnabled -# -my %conditional_feature = ("PcdOpensslEcEnabled"=>["EC", "ECDH", "ECDSA", "TLS1_3", "SM2"]); -my %conditional_feature_dir = ("/ec/"=>"PcdOpensslEcEnabled", "/sm2/"=>"PcdOpensslEcEnabled"); BEGIN { $inf_file = "OpensslLib.inf"; @@ -307,13 +294,7 @@ foreach my $product ((@{$unified_info{libraries}}, push @sslfilelist, ' $(OPENSSL_PATH)/' . $s . "\r\n"; next; } - push @cryptofilelist, ' $(OPENSSL_PATH)/' . $s; - foreach (keys(%conditional_feature_dir)) { - if ($s =~ $_) { - push @cryptofilelist, ' |*|*|*|gEfiCryptoPkgTokenSpaceGuid.' . $conditional_feature_dir{$_}; - } - } - push @cryptofilelist, "\r\n"; + push @cryptofilelist, ' $(OPENSSL_PATH)/' . $s . "\r\n"; } } } @@ -342,13 +323,7 @@ foreach (@headers){ push @sslfilelist, ' $(OPENSSL_PATH)/' . $_ . "\r\n"; next; } - push @cryptofilelist, ' $(OPENSSL_PATH)/' . $_; - foreach my $conditional_key (keys(%conditional_feature_dir)) { - if ($_ =~ $conditional_key) { - push @cryptofilelist, ' |*|*|*|gEfiCryptoPkgTokenSpaceGuid.' . $conditional_feature_dir{$conditional_key}; - } - } - push @cryptofilelist, "\r\n"; + push @cryptofilelist, ' $(OPENSSL_PATH)/' . $_ . "\r\n"; } @@ -453,7 +428,7 @@ print "\n--> Duplicating opensslconf.h into Include/openssl ... "; system( "perl -pe 's/\\n/\\r\\n/' " . "< " . $OPENSSL_PATH . "/include/openssl/opensslconf.h " . - "> " . $OPENSSL_PATH . "/../../Include/openssl/opensslconf_generated.h" + "> " . $OPENSSL_PATH . "/../../Include/openssl/opensslconf.h" ) == 0 || die "Cannot copy opensslconf.h!"; print "Done!"; @@ -465,52 +440,6 @@ system( "> " . $OPENSSL_PATH . "/../../Include/crypto/dso_conf.h" ) == 0 || die "Cannot copy dso_conf.h!"; -print "Done!"; - -# -# Add conditional feature to opensslconf.h -# -my $conf_file = "../Include/openssl/opensslconf.h"; -my @conf_raw = (); -my @conditional_define = (); -print "\n--> Updating conditional feature in $conf_file ... "; - -foreach my $pcd_name (keys(%conditional_feature)) { - push @conditional_define, "#if !FixedPcdGetBool ($pcd_name)\r\n"; - foreach (@{$conditional_feature{$pcd_name}}) { - push @conditional_define, "# ifndef OPENSSL_NO_$_\r\n"; - push @conditional_define, "# define OPENSSL_NO_$_\r\n"; - push @conditional_define, "# endif\r\n"; - } - push @conditional_define, "#endif\r\n"; -} - -open( FD, "<" . $conf_file ) || - die $conf_file; -foreach () { - # Insert conditional define to the begin of opensslconf.h - if ($_ =~ "Autogenerated conditional openssl feature list starts here") { - push @conf_raw, $_, @conditional_define; - $subbing = 1; - next; - } - if ($_ =~ "Autogenerated conditional openssl feature list ends here") { - push @conf_raw, $_; - $subbing = 0; - next; - } - push @conf_raw, $_ - unless ($subbing); -} -close(FD) || - die $conf_file; - -open( FD, ">" . $conf_file ) || - die $conf_file; -print( FD @conf_raw ) || - die $conf_file; -close(FD) || - die $conf_file; print "Done!\n"; print "\nProcessing Files Done!\n"; -- 2.37.1.windows.1