#include <Guid/GlobalVariable.h>\r
#include <Guid/ImageAuthentication.h>\r
\r
-BOOLEAN mSecureBootDisabled = FALSE;\r
-BOOLEAN mStopRedfishService = FALSE;\r
+BOOLEAN mSecureBootDisabled = FALSE;\r
+BOOLEAN mStopRedfishService = FALSE;\r
\r
EFI_STATUS\r
EFIAPI\r
LibStopRedfishService (\r
- IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,\r
- IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType\r
-);\r
+ IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,\r
+ IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType\r
+ );\r
\r
/**\r
Return the credential for accessing to Redfish servcice.\r
**/\r
EFI_STATUS\r
GetRedfishCredential (\r
- OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,\r
- OUT CHAR8 **UserId,\r
- OUT CHAR8 **Password\r
-)\r
+ OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,\r
+ OUT CHAR8 **UserId,\r
+ OUT CHAR8 **Password\r
+ )\r
{\r
UINTN UserIdSize;\r
UINTN PasswordSize;\r
//\r
UserIdSize = AsciiStrSize ((CHAR8 *)PcdGetPtr (PcdRedfishServieUserId));\r
PasswordSize = AsciiStrSize ((CHAR8 *)PcdGetPtr (PcdRedfishServiePassword));\r
- if (UserIdSize == 0 || PasswordSize == 0) {\r
+ if ((UserIdSize == 0) || (PasswordSize == 0)) {\r
DEBUG ((DEBUG_ERROR, "Incorrect string of UserID or Password for REdfish service.\n"));\r
return EFI_INVALID_PARAMETER;\r
}\r
+\r
*UserId = AllocateZeroPool (UserIdSize);\r
if (*UserId == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
+\r
CopyMem (*UserId, (CHAR8 *)PcdGetPtr (PcdRedfishServieUserId), UserIdSize);\r
\r
*Password = AllocateZeroPool (PasswordSize);\r
OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,\r
OUT CHAR8 **UserId,\r
OUT CHAR8 **Password\r
-)\r
+ )\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
\r
- if (This == NULL || AuthMethod == NULL || UserId == NULL || Password == NULL) {\r
+ if ((This == NULL) || (AuthMethod == NULL) || (UserId == NULL) || (Password == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
\r
if (mSecureBootDisabled) {\r
Status = LibStopRedfishService (This, ServiceStopTypeSecureBootDisabled);\r
- if (EFI_ERROR (Status) && Status != EFI_UNSUPPORTED) {\r
+ if (EFI_ERROR (Status) && (Status != EFI_UNSUPPORTED)) {\r
DEBUG ((DEBUG_ERROR, "SecureBoot has been disabled, but failed to stop RedfishService - %r\n", Status));\r
return Status;\r
}\r
EFI_STATUS\r
EFIAPI\r
LibStopRedfishService (\r
- IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,\r
- IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType\r
-)\r
+ IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,\r
+ IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType\r
+ )\r
{\r
if (ServiceStopType >= ServiceStopTypeMax) {\r
return EFI_INVALID_PARAMETER;\r
mStopRedfishService = TRUE;\r
DEBUG ((DEBUG_INFO, "EFI Redfish service is stopped without Redfish service stop type!!\n"));\r
}\r
+\r
return EFI_SUCCESS;\r
}\r
+\r
/**\r
Notification of Exit Boot Service.\r
\r
EFIAPI\r
LibCredentialExitBootServicesNotify (\r
IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This\r
-)\r
+ )\r
{\r
LibStopRedfishService (This, ServiceStopTypeExitBootService);\r
}\r
EFIAPI\r
LibCredentialEndOfDxeNotify (\r
IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This\r
-)\r
+ )\r
{\r
EFI_STATUS Status;\r
- UINT8 *SecureBootVar;\r
+ UINT8 *SecureBootVar;\r
\r
//\r
// Check Secure Boot status and lock Redfish service if Secure Boot is disabled.\r
//\r
- Status = GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid, (VOID**)&SecureBootVar, NULL);\r
+ Status = GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid, (VOID **)&SecureBootVar, NULL);\r
if (EFI_ERROR (Status) || (*SecureBootVar != SECURE_BOOT_MODE_ENABLE)) {\r
//\r
// Secure Boot is disabled\r