From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 85D911A1E53 for ; Sun, 9 Oct 2016 04:58:52 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP; 09 Oct 2016 04:58:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,466,1473145200"; d="scan'208";a="17748825" Received: from jyao1-mobl.ccr.corp.intel.com ([10.254.214.127]) by fmsmga005.fm.intel.com with ESMTP; 09 Oct 2016 04:58:50 -0700 From: Jiewen Yao To: edk2-devel@lists.01.org Cc: David Wei , Eric Dong , Ruiyu Ni , Feng Tian , Star Zeng , Michael D Kinney , Liming Gao Date: Sun, 9 Oct 2016 19:58:33 +0800 Message-Id: <1476014313-11992-5-git-send-email-jiewen.yao@intel.com> X-Mailer: git-send-email 2.7.4.windows.1 In-Reply-To: <1476014313-11992-1-git-send-email-jiewen.yao@intel.com> References: <1476014313-11992-1-git-send-email-jiewen.yao@intel.com> Subject: [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: Sun, 09 Oct 2016 11:58:52 -0000 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/Vlv2TbltDevicePkg/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; if (TimeoutDefault == 0) { return EFI_TIMEOUT; @@ -2454,6 +2455,7 @@ ShowProgressHotKey ( &Size ); if (!EFI_ERROR(Status)) { + TestKeyUsed = PcdGet64(PcdTestKeyUsed); if ((Size == PcdGetSize(PcdRsa2048Sha256PublicKeyBuffer)) && (CompareMem(Buffer, PcdGetPtr(PcdRsa2048Sha256PublicKeyBuffer), Size) == 0)) { TmpStr2 = 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 |= TEST_KEY_USED_RECOVERY; + } else { + TestKeyUsed |= NO_TEST_KEY_USED_RECOVERY; } + PcdSet64S(PcdTestKeyUsed, TestKeyUsed); FreePool(Buffer); } Status = GetSectionFromAnyFv( @@ -2473,6 +2479,7 @@ ShowProgressHotKey ( &Size ); if (!EFI_ERROR(Status)) { + TestKeyUsed = PcdGet64(PcdTestKeyUsed); if ((Size == PcdGetSize(PcdPkcs7CertBuffer)) && (CompareMem(Buffer, PcdGetPtr(PcdPkcs7CertBuffer), Size) == 0)) { TmpStr3 = 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 |= TEST_KEY_USED_FIRMWARE_UPDATE; + } else { + TestKeyUsed |= NO_TEST_KEY_USED_FIRMWARE_UPDATE; } + PcdSet64S(PcdTestKeyUsed, TestKeyUsed); FreePool(Buffer); } diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.h b/Vlv2TbltDevicePkg/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: #include +#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 + -- 2.7.4.windows.1