SecurityPkg: limit verification of enrolled PK in setup mode
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2506 Per UEFI spec, enrolling a new PK in setup mode should not require a self-signature. Introduce a feature PCD called PcdRequireSelfSignedPk to control this requirement. Default to TRUE in order to preserve the legacy behavior. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Min Xu <min.m.xu@intel.com> Co-authored-by: Matthew Carlson <macarl@microsoft.com> Signed-off-by: Jan Bobek <jbobek@nvidia.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com> Acked-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
@@ -603,7 +603,10 @@ ProcessVarWithPk (
|
||||
// Init state of Del. State may change due to secure check
|
||||
//
|
||||
Del = FALSE;
|
||||
if ((InCustomMode () && UserPhysicalPresent ()) || ((mPlatformMode == SETUP_MODE) && !IsPk)) {
|
||||
if ( (InCustomMode () && UserPhysicalPresent ())
|
||||
|| ( (mPlatformMode == SETUP_MODE)
|
||||
&& !(FeaturePcdGet (PcdRequireSelfSignedPk) && IsPk)))
|
||||
{
|
||||
Payload = (UINT8 *)Data + AUTHINFO2_SIZE (Data);
|
||||
PayloadSize = DataSize - AUTHINFO2_SIZE (Data);
|
||||
if (PayloadSize == 0) {
|
||||
@@ -627,7 +630,9 @@ ProcessVarWithPk (
|
||||
return Status;
|
||||
}
|
||||
|
||||
if ((mPlatformMode != SETUP_MODE) || IsPk) {
|
||||
if ( (mPlatformMode != SETUP_MODE)
|
||||
|| (FeaturePcdGet (PcdRequireSelfSignedPk) && IsPk))
|
||||
{
|
||||
Status = VendorKeyIsModified ();
|
||||
}
|
||||
} else if (mPlatformMode == USER_MODE) {
|
||||
|
Reference in New Issue
Block a user