Bootstrapping.\r
\r
@retval TRUE Yes, it is supported.\r
- TRUE No, it is not supported.\r
+ FALSE No, it is not supported.\r
\r
**/\r
BOOLEAN\r
VOID\r
)\r
{\r
- EFI_STATUS Status;\r
- IPMI_BOOTSTRAP_CREDENTIALS_COMMAND_DATA CommandData;\r
- IPMI_BOOTSTRAP_CREDENTIALS_RESULT_RESPONSE ResponseData;\r
- UINT32 ResponseSize;\r
- BOOLEAN ReturnBool;\r
+ EDKII_REDFISH_AUTH_METHOD AuthMethod;\r
+ EDKII_REDFISH_CREDENTIAL2_PROTOCOL *CredentialProtocol;\r
+ CHAR8 *UserName;\r
+ CHAR8 *Password;\r
+ BOOLEAN ReturnBool;\r
+ EFI_STATUS Status;\r
\r
DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry\n", __func__));\r
\r
+ ReturnBool = FALSE;\r
//\r
- // IPMI callout to NetFn 2C, command 02\r
- // Request data:\r
- // Byte 1: REDFISH_IPMI_GROUP_EXTENSION\r
- // Byte 2: DisableBootstrapControl\r
+ // Locate HII credential protocol.\r
//\r
- CommandData.GroupExtensionId = REDFISH_IPMI_GROUP_EXTENSION;\r
- CommandData.DisableBootstrapControl = REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_ENABLE;\r
- ResponseData.CompletionCode = IPMI_COMP_CODE_UNSPECIFIED;\r
- ResponseSize = sizeof (ResponseData);\r
- //\r
- // Response data: Ignored.\r
- //\r
- Status = IpmiSubmitCommand (\r
- IPMI_NETFN_GROUP_EXT,\r
- REDFISH_IPMI_GET_BOOTSTRAP_CREDENTIALS_CMD,\r
- (UINT8 *)&CommandData,\r
- sizeof (CommandData),\r
- (UINT8 *)&ResponseData,\r
- &ResponseSize\r
- );\r
- if (!EFI_ERROR (Status) &&\r
- ((ResponseData.CompletionCode == IPMI_COMP_CODE_NORMAL) ||\r
- (ResponseData.CompletionCode == REDFISH_IPMI_COMP_CODE_BOOTSTRAP_CREDENTIAL_DISABLED)\r
- ))\r
- {\r
- DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " Redfish Credential Bootstrapping is supported\n"));\r
+ Status = gBS->LocateProtocol (\r
+ &gEdkIIRedfishCredential2ProtocolGuid,\r
+ NULL,\r
+ (VOID **)&CredentialProtocol\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ ASSERT_EFI_ERROR (Status);\r
+ return FALSE;\r
+ }\r
+\r
+ Status = CredentialProtocol->GetAuthInfo (\r
+ CredentialProtocol,\r
+ &AuthMethod,\r
+ &UserName,\r
+ &Password\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ ZeroMem (Password, AsciiStrSize (Password));\r
+ FreePool (Password);\r
+ ZeroMem (UserName, AsciiStrSize (UserName));\r
+ FreePool (UserName);\r
ReturnBool = TRUE;\r
} else {\r
- DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " Redfish Credential Bootstrapping is not supported\n"));\r
- ReturnBool = FALSE;\r
+ if (Status == EFI_ACCESS_DENIED) {\r
+ // bootstrap credential support was disabled\r
+ ReturnBool = TRUE;\r
+ }\r
}\r
\r
+ DEBUG ((\r
+ DEBUG_REDFISH_HOST_INTERFACE,\r
+ " Redfish Credential Bootstrapping is %a\n",\r
+ ReturnBool ? "supported" : "not supported"\r
+ ));\r
return ReturnBool;\r
}\r
\r
\r
DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry, the registration key - 0x%08x.\n", __func__, Registration));\r
\r
- Handle = NULL;\r
+ Handle = NULL;\r
HandleBuffer = NULL;\r
- Status = EFI_SUCCESS;\r
+ Status = EFI_SUCCESS;\r
\r
do {\r
BufferSize = 0;\r