From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 4A8491A1E34 for ; Sun, 9 Oct 2016 18:19:07 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 09 Oct 2016 18:19:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,469,1473145200"; d="scan'208";a="17850567" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga006.fm.intel.com with ESMTP; 09 Oct 2016 18:19:06 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 9 Oct 2016 18:19:06 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 9 Oct 2016 18:19:06 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.118]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.95]) with mapi id 14.03.0248.002; Mon, 10 Oct 2016 09:19:04 +0800 From: "Wei, David" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" CC: "Dong, Eric" , "Ni, Ruiyu" , "Tian, Feng" , "Zeng, Star" , "Kinney, Michael D" , "Gao, Liming" Thread-Topic: [PATCH 4/4] Vlv2TbleDevicePkg/Bds: Produce PcdTestKeyUsed. Thread-Index: AQHSIiSCv1Qku9jG+kCnkNwiQPQj4aCg5Czg Date: Mon, 10 Oct 2016 01:19:03 +0000 Message-ID: <89954A0B46707A448411A627AD4EEE3466380466@SHSMSX101.ccr.corp.intel.com> References: <1476014313-11992-1-git-send-email-jiewen.yao@intel.com> <1476014313-11992-5-git-send-email-jiewen.yao@intel.com> In-Reply-To: <1476014313-11992-5-git-send-email-jiewen.yao@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWQxYjdjYjktMjliYy00ZDU2LTlkNTYtZGM5NWIwMjVjM2FkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ilg5clFKNGhUdjhkWE1XbWVYMWduQWZCb1VzY001SUtydDJcL3hMclwvTUVWTT0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 4/4] Vlv2TbleDevicePkg/Bds: Produce PcdTestKeyUsed. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 01:19:07 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: David Wei Thanks, David Wei =20 -----Original Message----- From: Yao, Jiewen=20 Sent: Sunday, October 09, 2016 7:59 PM To: edk2-devel@lists.01.org Cc: Wei, David ; Dong, Eric ; Ni,= Ruiyu ; Tian, Feng ; Zeng, Star <= star.zeng@intel.com>; Kinney, Michael D ; Gao, = Liming Subject: [PATCH 4/4] Vlv2TbleDevicePkg/Bds: Produce PcdTestKeyUsed. Update BDS to produce PcdTestKeyUsed to indicate if there is any test key used in current BIOS, such as recovery key, or capsule update key. Then the generic UI may consume this PCD to show warning information. Cc: David Wei Cc: Eric Dong Cc: Ruiyu Ni Cc: Feng Tian Cc: Star Zeng Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao --- Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c | 11 +++++++++= ++ Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.h | 5 +++++ Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf | 2 ++ 3 files changed, 18 insertions(+) diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c b/Vlv2T= bltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c index 0dacac0..a699da1 100644 --- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c +++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c @@ -2417,6 +2417,7 @@ ShowProgressHotKey ( UINTN TmpStrSize; VOID *Buffer; UINTN Size; + UINT64 TestKeyUsed; =20 if (TimeoutDefault =3D=3D 0) { return EFI_TIMEOUT; @@ -2454,6 +2455,7 @@ ShowProgressHotKey ( &Size ); if (!EFI_ERROR(Status)) { + TestKeyUsed =3D PcdGet64(PcdTestKeyUsed); if ((Size =3D=3D PcdGetSize(PcdRsa2048Sha256PublicKeyBuffer)) && (CompareMem(Buffer, PcdGetPtr(PcdRsa2048Sha256PublicKeyBuffer), Si= ze) =3D=3D 0)) { TmpStr2 =3D L"WARNING: Recovery Test Key is used.\r\n"; @@ -2462,7 +2464,11 @@ ShowProgressHotKey ( } else { SerialPortWrite((UINT8 *)"\n\nWARNING: Recovery Test Key is used.", = sizeof("\n\nWARNING: Recovery Test Key is used.")); } + TestKeyUsed |=3D TEST_KEY_USED_RECOVERY; + } else { + TestKeyUsed |=3D NO_TEST_KEY_USED_RECOVERY; } + PcdSet64S(PcdTestKeyUsed, TestKeyUsed); FreePool(Buffer); } Status =3D GetSectionFromAnyFv( @@ -2473,6 +2479,7 @@ ShowProgressHotKey ( &Size ); if (!EFI_ERROR(Status)) { + TestKeyUsed =3D PcdGet64(PcdTestKeyUsed); if ((Size =3D=3D PcdGetSize(PcdPkcs7CertBuffer)) && (CompareMem(Buffer, PcdGetPtr(PcdPkcs7CertBuffer), Size) =3D=3D 0)= ) { TmpStr3 =3D L"WARNING: Capsule Test Key is used.\r\n"; @@ -2481,7 +2488,11 @@ ShowProgressHotKey ( } else { SerialPortWrite((UINT8 *)"\n\nWARNING: Capsule Test Key is used.",= sizeof("\n\nWARNING: Capsule Test Key is used.")); } + TestKeyUsed |=3D TEST_KEY_USED_FIRMWARE_UPDATE; + } else { + TestKeyUsed |=3D NO_TEST_KEY_USED_FIRMWARE_UPDATE; } + PcdSet64S(PcdTestKeyUsed, TestKeyUsed); FreePool(Buffer); } =20 diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.h b/Vlv2T= bltDevicePkg/Library/PlatformBdsLib/BdsPlatform.h index d757243..8031035 100644 --- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.h +++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.h @@ -67,6 +67,11 @@ Abstract: =20 #include =20 +#define TEST_KEY_USED_RECOVERY (BIT0 + BIT32) +#define TEST_KEY_USED_FIRMWARE_UPDATE (BIT1 + BIT33) +#define NO_TEST_KEY_USED_RECOVERY (BIT32) +#define NO_TEST_KEY_USED_FIRMWARE_UPDATE (BIT33) + extern EFI_DEVICE_PATH_PROTOCOL *gPlatformRootBridges []; extern BDS_CONSOLE_CONNECT_ENTRY gPlatformConsole []; extern EFI_DEVICE_PATH_PROTOCOL *gPlatformAllPossiblePciVgaConsole []; diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf b/= Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf index 6bcfb7f..7748e2d 100644 --- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf +++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf @@ -125,3 +125,5 @@ gPlatformModuleTokenSpaceGuid.PcdEdkiiPkcs7TestPublicKeyFileGuid gEfiSecurityPkgTokenSpaceGuid.PcdRsa2048Sha256PublicKeyBuffer gEfiSecurityPkgTokenSpaceGuid.PcdPkcs7CertBuffer + gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed + --=20 2.7.4.windows.1