From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=qin.long@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 51D53225E9658 for ; Tue, 27 Mar 2018 07:39:49 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2018 07:46:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,367,1517904000"; d="scan'208";a="38528518" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 27 Mar 2018 07:46:26 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 27 Mar 2018 07:46:25 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 27 Mar 2018 07:46:25 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.235]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.226]) with mapi id 14.03.0319.002; Tue, 27 Mar 2018 22:46:23 +0800 From: "Long, Qin" To: "Gao, Liming" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Update Rsa2048Sha256Sign to use openssl dgst option Thread-Index: AQHTxctwqx8VxNXmyk+k/3voRfws2KPkKQPw Date: Tue, 27 Mar 2018 14:46:23 +0000 Message-ID: References: <1522155535-15068-1-git-send-email-liming.gao@intel.com> In-Reply-To: <1522155535-15068-1-git-send-email-liming.gao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjczMDI1YmEtY2YzYS00OTlmLWEwNDEtOGE5ZTJhMWFlYTE2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJWd2luRStcL0h4XC9tVFlxUXljbnhNMEQxYlllRTl1azRJemg2NTlmeVk2R1pzbUtmRGtSUWErSWk5MzN2SVZONW8ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Update Rsa2048Sha256Sign to use openssl dgst option X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Mar 2018 14:39:50 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Long Qin Best Regards & Thanks, LONG, Qin -----Original Message----- From: Gao, Liming=20 Sent: Tuesday, March 27, 2018 8:59 PM To: edk2-devel@lists.01.org Cc: Zhu, Yonghong ; Long, Qin Subject: [Patch] BaseTools: Update Rsa2048Sha256Sign to use openssl dgst op= tion Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao Cc: Yonghong Zhu Cc: Qin Long --- BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py= b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py index 4188f8e..d36a14f 100644 --- a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py +++ b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py @@ -4,7 +4,7 @@ # {0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35= , 0xbf}} # This tool has been tested with OpenSSL 1.0.1e 11 Feb 2013 # -# Copyrigh= t (c) 2013 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2013 - 2018, Intel Corporation. All rights=20 +reserved.
# This program and the accompanying materials # are licensed and made ava= ilable under the terms and conditions of the BSD License # which accompani= es this distribution. The full text of the license may be found at @@ -176= ,7 +176,7 @@ if __name__ =3D=3D '__main__': #=20 # Sign the input file using the specified private key and capture sign= ature from STDOUT # - Process =3D subprocess.Popen('%s sha1 -sha256 -sign "%s"' % (OpenSslCo= mmand, args.PrivateKeyFileName), stdin=3Dsubprocess.PIPE, stdout=3Dsubproce= ss.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue) + Process =3D subprocess.Popen('%s dgst -sha256 -sign "%s"' %=20 + (OpenSslCommand, args.PrivateKeyFileName), stdin=3Dsubprocess.PIPE,=20 + stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue) Signature =3D Process.communicate(input=3DFullInputFileBuffer)[0] if Process.returncode <> 0: sys.exit(Process.returncode) @@ -225,7 +225,7 @@ if __name__ =3D=3D '__main__': # # Verify signature # =20 - Process =3D subprocess.Popen('%s sha1 -sha256 -prverify "%s" -signatur= e %s' % (OpenSslCommand, args.PrivateKeyFileName, args.OutputFileName), std= in=3Dsubprocess.PIPE, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, s= hell=3DTrue) + Process =3D subprocess.Popen('%s dgst -sha256 -prverify "%s"=20 + -signature %s' % (OpenSslCommand, args.PrivateKeyFileName,=20 + args.OutputFileName), stdin=3Dsubprocess.PIPE, stdout=3Dsubprocess.PIPE,= =20 + stderr=3Dsubprocess.PIPE, shell=3DTrue) Process.communicate(input=3DFullInputFileBuffer) if Process.returncode <> 0: print 'ERROR: Verification failed' -- 2.8.0.windows.1