21BOOLEAN mSecureBootDisabled =
FALSE;
22BOOLEAN mStopRedfishService =
FALSE;
62 if ((UserIdSize == 0) || (PasswordSize == 0)) {
63 DEBUG ((DEBUG_ERROR,
"Incorrect string of UserID or Password for REdfish service.\n"));
64 return EFI_INVALID_PARAMETER;
68 if (*UserId ==
NULL) {
69 return EFI_OUT_OF_RESOURCES;
75 if (*Password ==
NULL) {
77 return EFI_OUT_OF_RESOURCES;
80 CopyMem (*Password, (CHAR8 *)
PcdGetPtr (PcdRedfishServicePassword), PasswordSize);
119 if ((This ==
NULL) || (AuthMethod ==
NULL) || (UserId ==
NULL) || (Password ==
NULL)) {
120 return EFI_INVALID_PARAMETER;
123 if (mStopRedfishService) {
124 return EFI_ACCESS_DENIED;
127 if (mSecureBootDisabled) {
129 if (EFI_ERROR (Status) && (Status != EFI_UNSUPPORTED)) {
130 DEBUG ((DEBUG_ERROR,
"SecureBoot has been disabled, but failed to stop RedfishService - %r\n", Status));
169 UINT8 *SecureBootVar;
171 if (ServiceStopType >= ServiceStopTypeMax) {
172 return EFI_INVALID_PARAMETER;
180 if (!
PcdGetBool (PcdRedfishServiceStopIfSecureBootDisabled)) {
181 return EFI_UNSUPPORTED;
187 if (EFI_ERROR (Status) || (*SecureBootVar != SECURE_BOOT_MODE_ENABLE)) {
191 mSecureBootDisabled =
TRUE;
192 mStopRedfishService =
TRUE;
193 DEBUG ((DEBUG_INFO,
"EFI Redfish service is stopped due to SecureBoot is disabled!!\n"));
201 if (
PcdGetBool (PcdRedfishServiceStopIfExitbootService)) {
202 return EFI_UNSUPPORTED;
204 mStopRedfishService =
TRUE;
205 DEBUG ((DEBUG_INFO,
"EFI Redfish service is stopped due to Exit Boot Service!!\n"));
208 mStopRedfishService =
TRUE;
209 DEBUG ((DEBUG_INFO,
"EFI Redfish service is stopped without Redfish service stop type!!\n"));
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE
@ ServiceStopTypeSecureBootDisabled
@ ServiceStopTypeExitBootService
EDKII_REDFISH_AUTH_METHOD
@ AuthMethodHttpBasic
Basic authentication is required.
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define EFI_SECURE_BOOT_MODE_NAME
#define DEBUG(Expression)
#define PcdGetBool(TokenName)
#define PcdGetPtr(TokenName)
EFI_STATUS EFIAPI GetVariable2(IN CONST CHAR16 *Name, IN CONST EFI_GUID *Guid, OUT VOID **Value, OUT UINTN *Size OPTIONAL)