From: Jiewen Yao <jiewen.yao@intel.com>
To: edk2-devel@lists.01.org
Cc: David Wei <david.wei@intel.com>, Eric Dong <eric.dong@intel.com>,
Ruiyu Ni <ruiyu.ni@intel.com>, Feng Tian <feng.tian@intel.com>,
Star Zeng <star.zeng@intel.com>,
Michael D Kinney <michael.d.kinney@intel.com>,
Liming Gao <liming.gao@intel.com>
Subject: [PATCH 4/4] Vlv2TbleDevicePkg/Bds: Produce PcdTestKeyUsed.
Date: Sun, 9 Oct 2016 19:58:33 +0800 [thread overview]
Message-ID: <1476014313-11992-5-git-send-email-jiewen.yao@intel.com> (raw)
In-Reply-To: <1476014313-11992-1-git-send-email-jiewen.yao@intel.com>
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 <david.wei@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
---
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 <IndustryStandard/Pci.h>
+#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
next prev parent reply other threads:[~2016-10-09 11:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-09 11:58 [PATCH 0/4] Show test key info on front page Jiewen Yao
2016-10-09 11:58 ` [PATCH 1/4] MdeModulePkg/dec: Add PcdTestKeyUsed PCD Jiewen Yao
2016-10-09 11:58 ` [PATCH 2/4] MdeModulePkg/UiApp: Show test key warning info in FrontPage Jiewen Yao
2016-10-10 1:28 ` Dong, Eric
2016-10-10 3:49 ` Yao, Jiewen
2016-10-09 11:58 ` [PATCH 3/4] QuarkPlatformPkg/Bds: Produce PcdTestKeyUsed Jiewen Yao
2016-10-09 11:58 ` Jiewen Yao [this message]
2016-10-10 1:19 ` [PATCH 4/4] Vlv2TbleDevicePkg/Bds: " Wei, David
2016-10-09 17:25 ` [PATCH 0/4] Show test key info on front page Kinney, Michael D
2016-10-10 3:43 ` Yao, Jiewen
2016-10-10 2:14 ` Gao, Liming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1476014313-11992-5-git-send-email-jiewen.yao@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox