mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-26 15:14:02 +02:00
EmulatorPkg/RedfishPlatformCredentialLib: Check EFI_SECURE_BOOT_MODE_NAME
https://bugzilla.tianocore.org/show_bug.cgi?id=3858 Check EFI_SECURE_BOOT_MODE_NAME before setting the flags to prohibit acquiring Redfish service credential and using Redfish service. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Nickle Wang <nickle.wang@hpe.com> Cc: Andrew Fish <afish@apple.com> Cc: Ray Ni <ray.ni@intel.com> Reviewed-by: Nickle Wang <nickle.wang@hpe.com>
This commit is contained in:
parent
414cd2a4d5
commit
33438f7354
@ -165,6 +165,9 @@ LibStopRedfishService (
|
|||||||
IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType
|
IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
UINT8 *SecureBootVar;
|
||||||
|
|
||||||
if (ServiceStopType >= ServiceStopTypeMax) {
|
if (ServiceStopType >= ServiceStopTypeMax) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
@ -177,9 +180,19 @@ LibStopRedfishService (
|
|||||||
if (!PcdGetBool (PcdRedfishServieStopIfSecureBootDisabled)) {
|
if (!PcdGetBool (PcdRedfishServieStopIfSecureBootDisabled)) {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
} else {
|
} else {
|
||||||
|
//
|
||||||
|
// Check Secure Boot status and lock Redfish service if Secure Boot is disabled.
|
||||||
|
//
|
||||||
|
Status = GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid, (VOID **)&SecureBootVar, NULL);
|
||||||
|
if (EFI_ERROR (Status) || (*SecureBootVar != SECURE_BOOT_MODE_ENABLE)) {
|
||||||
|
//
|
||||||
|
// Secure Boot is disabled
|
||||||
|
//
|
||||||
|
mSecureBootDisabled = TRUE;
|
||||||
mStopRedfishService = TRUE;
|
mStopRedfishService = TRUE;
|
||||||
DEBUG ((DEBUG_INFO, "EFI Redfish service is stopped due to SecureBoot is disabled!!\n"));
|
DEBUG ((DEBUG_INFO, "EFI Redfish service is stopped due to SecureBoot is disabled!!\n"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (ServiceStopType == ServiceStopTypeExitBootService) {
|
} else if (ServiceStopType == ServiceStopTypeExitBootService) {
|
||||||
//
|
//
|
||||||
// Check platform PCD to determine the action for stopping
|
// Check platform PCD to determine the action for stopping
|
||||||
@ -224,18 +237,5 @@ LibCredentialEndOfDxeNotify (
|
|||||||
IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This
|
IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
|
||||||
UINT8 *SecureBootVar;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Check Secure Boot status and lock Redfish service if Secure Boot is disabled.
|
|
||||||
//
|
|
||||||
Status = GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid, (VOID **)&SecureBootVar, NULL);
|
|
||||||
if (EFI_ERROR (Status) || (*SecureBootVar != SECURE_BOOT_MODE_ENABLE)) {
|
|
||||||
//
|
|
||||||
// Secure Boot is disabled
|
|
||||||
//
|
|
||||||
mSecureBootDisabled = TRUE;
|
|
||||||
LibStopRedfishService (This, ServiceStopTypeSecureBootDisabled);
|
LibStopRedfishService (This, ServiceStopTypeSecureBootDisabled);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user