TianoCore EDK2 master
|
#include <RedfishCredentialDxe.h>
Go to the source code of this file.
Macros | |
#define | REDFISH_VERSION_DEFAULT_STRING L"v1" |
Variables | |
REDFISH_CREDENTIAL_PRIVATE * | mCredentialPrivate = NULL |
RedfishCrentialDxe produces the EdkIIRedfishCredentialProtocol for the consumer to get the Redfish credential Info and to restrict Redfish access from UEFI side.
(C) Copyright 2020 Hewlett Packard Enterprise Development LP
(C) Copyright 2024 American Megatrends International LLC
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file RedfishCredentialDxe.c.
#define REDFISH_VERSION_DEFAULT_STRING L"v1" |
Definition at line 14 of file RedfishCredentialDxe.c.
EFI_STATUS AddRedfishServiceToList | ( | IN REDFISH_SERVICE | RedfishService | ) |
The function adds a new Redfish service to internal list
[in] | RedfishService | Pointer to REDFISH_SERVICE to be added to the list. |
EFI_SUCCESS | Redfish service is added to list successfully. |
EFI_OUT_OF_RESOURCES | Out of resources error. |
Definition at line 613 of file RedfishCredentialDxe.c.
EFI_STATUS ClearRedfishServiceList | ( | VOID | ) |
This function clears Redfish service internal list.
EFI_SUCCESS | Redfish service is deleted from list successfully. |
Others | Fail to remove the entry |
Definition at line 569 of file RedfishCredentialDxe.c.
EFI_STATUS EFIAPI DeleteRedfishBootstrapAccount | ( | IN REDFISH_SERVICE | RedfishService, |
IN CHAR16 * | TargetUri | ||
) |
Function sends DELETE request to BMC for the account defined by the target URI.
[in] | RedfishService | Pointer to Redfish Service to be used for sending DELETE request to BMC. |
[in] | TargetUri | URI of bootstrap account to send DELETE request to. |
Definition at line 262 of file RedfishCredentialDxe.c.
EFI_STATUS DeleteRedfishServiceFromList | ( | IN REDFISH_SERVICE | RedfishService | ) |
This function deletes Redfish service from internal list.
[in] | RedfishService | Pointer to REDFISH_SERVICE to be delete from the list. |
EFI_SUCCESS | Redfish service is deleted from list successfully. |
Others | Fail to remove the entry |
Definition at line 670 of file RedfishCredentialDxe.c.
EFI_STATUS IterateThroughBootstrapAccounts | ( | IN REDFISH_SERVICE | RedfishService | ) |
Iterates through all account in the account collection Get the information about specific Account. Checks the User Name and if name matches delete that account
[in] | RedfishService | Pointer to Redfish Service to be used for sending DELETE request to BMC. |
Definition at line 400 of file RedfishCredentialDxe.c.
BOOLEAN ProcessRedfishBootstarpAccount | ( | IN REDFISH_SERVICE | RedfishService, |
IN EFI_STRING | AccountUri | ||
) |
Get the information about specific Account. Checks the User Name and if name matches delete that account
[in] | RedfishService | Pointer to Redfish Service to be used for sending DELETE request to BMC. |
[in] | AccountUri | URI of bootstrap account to verify. |
Definition at line 318 of file RedfishCredentialDxe.c.
EFI_STATUS EFIAPI RedfishCredential2GetAuthInfo | ( | IN EDKII_REDFISH_CREDENTIAL2_PROTOCOL * | This, |
OUT EDKII_REDFISH_AUTH_METHOD * | AuthMethod, | ||
OUT CHAR8 ** | UserId, | ||
OUT CHAR8 ** | Password | ||
) |
Retrieve platform's Redfish authentication information.
This functions returns the Redfish authentication method together with the user Id and password.
Callers are responsible for and freeing the returned string storage.
[in] | This | Pointer to EDKII_REDFISH_CREDENTIAL2_PROTOCOL instance. |
[out] | AuthMethod | Type of Redfish authentication method. |
[out] | UserId | The pointer to store the returned UserId string. |
[out] | Password | The pointer to store the returned Password string. |
EFI_SUCCESS | Get the authentication information successfully. |
EFI_ACCESS_DENIED | SecureBoot is disabled after EndOfDxe. |
EFI_INVALID_PARAMETER | This or AuthMethod or UserId or Password is NULL. |
EFI_OUT_OF_RESOURCES | There are not enough memory resources. |
EFI_UNSUPPORTED | Unsupported authentication method is found. |
Definition at line 161 of file RedfishCredentialDxe.c.
EFI_STATUS EFIAPI RedfishCredential2RegisterService | ( | IN EDKII_REDFISH_CREDENTIAL2_PROTOCOL * | This, |
IN REDFISH_SERVICE | RedfishService | ||
) |
Register Redfish service instance so protocol knows that some module uses bootstrap account.
[in] | This | Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL instance. |
[in] | RedfishService | Redfish service instance to register. |
EFI_SUCCESS | This Redfish service instance has been registered successfully. |
Others | Fail to register Redfish Service |
Definition at line 713 of file RedfishCredentialDxe.c.
EFI_STATUS EFIAPI RedfishCredential2StopService | ( | IN EDKII_REDFISH_CREDENTIAL2_PROTOCOL * | This, |
IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE | ServiceStopType | ||
) |
Notifies the Redfish service provider to stop providing configuration service to this platform. Deletes the bootstrap account on BMC side, so it will not be used by any other driver.
This function should be called when the platfrom is about to leave the safe environment. It will delete the bootstrap account sending DELETE request to BMC. It will notify the Redfish service provider to abort all logined session, and prohibit further login with original auth info. GetAuthInfo() will return EFI_UNSUPPORTED once this function is returned.
[in] | This | Pointer to EDKII_REDFISH_CREDENTIAL2_PROTOCOL instance. |
[in] | ServiceStopType | Reason of stopping Redfish service. |
EFI_SUCCESS | Service has been stoped successfully. |
EFI_INVALID_PARAMETER | This is NULL or given the worng ServiceStopType. |
EFI_UNSUPPORTED | Not support to stop Redfish service. |
Others | Some error happened. |
Definition at line 213 of file RedfishCredentialDxe.c.
EFI_STATUS EFIAPI RedfishCredential2UnregisterService | ( | IN EDKII_REDFISH_CREDENTIAL2_PROTOCOL * | This, |
IN REDFISH_SERVICE | RedfishService | ||
) |
Unregister Redfish service instance and delete the bootstrap account when all registered services unregistered.
[in] | This | Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL instance. |
[in] | RedfishService | Redfish service instance to unregister. |
EFI_SUCCESS | This Redfish service instance has been unregistered successfully. |
Others | Fail to unregister Redfish Service |
Definition at line 759 of file RedfishCredentialDxe.c.
EFI_STATUS EFIAPI RedfishCredentialDxeDriverEntryPoint | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Main entry for this driver.
ImageHandle | Image handle this driver. |
SystemTable | Pointer to SystemTable. |
EFI_SUCCESS | This function always complete successfully. |
Definition at line 809 of file RedfishCredentialDxe.c.
EFI_STATUS EFIAPI RedfishCredentialDxeDriverUnload | ( | IN EFI_HANDLE | ImageHandle | ) |
This is the unload handle for Redfish Credentials module.
Uninstall all the protocols installed in the driver entry point. Clear all allocated resources.
[in] | ImageHandle | The drivers' driver image. |
EFI_SUCCESS | The image is unloaded. |
Others | Failed to unload the image. |
Definition at line 941 of file RedfishCredentialDxe.c.
Callback function executed when the EndOfDxe event group is signaled.
[in] | Event | Event whose notification function is being invoked. |
[out] | Context | Pointer to the buffer pass in. |
Definition at line 42 of file RedfishCredentialDxe.c.
Callback function executed when the ExitBootServices event group is signaled.
[in] | Event | Event whose notification function is being invoked. |
[out] | Context | Pointer to the buffer pass in. |
Definition at line 26 of file RedfishCredentialDxe.c.
EFI_STATUS EFIAPI RedfishCredentialGetAuthInfo | ( | IN EDKII_REDFISH_CREDENTIAL_PROTOCOL * | This, |
OUT EDKII_REDFISH_AUTH_METHOD * | AuthMethod, | ||
OUT CHAR8 ** | UserId, | ||
OUT CHAR8 ** | Password | ||
) |
Retrieve platform's Redfish authentication information.
This functions returns the Redfish authentication method together with the user Id and password.
Callers are responsible for and freeing the returned string storage.
[in] | This | Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL instance. |
[out] | AuthMethod | Type of Redfish authentication method. |
[out] | UserId | The pointer to store the returned UserId string. |
[out] | Password | The pointer to store the returned Password string. |
EFI_SUCCESS | Get the authentication information successfully. |
EFI_ACCESS_DENIED | SecureBoot is disabled after EndOfDxe. |
EFI_INVALID_PARAMETER | This or AuthMethod or UserId or Password is NULL. |
EFI_OUT_OF_RESOURCES | There are not enough memory resources. |
EFI_UNSUPPORTED | Unsupported authentication method is found. |
Definition at line 90 of file RedfishCredentialDxe.c.
EFI_STATUS EFIAPI RedfishCredentialStopService | ( | IN EDKII_REDFISH_CREDENTIAL_PROTOCOL * | This, |
IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE | ServiceStopType | ||
) |
Notify the Redfish service provider to stop provide configuration service to this platform.
This function should be called when the platfrom is about to leave the safe environment. It will notify the Redfish service provider to abort all logined session, and prohibit further login with original auth info. GetAuthInfo() will return EFI_UNSUPPORTED once this function is returned.
[in] | This | Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL instance. |
[in] | ServiceStopType | Reason of stopping Redfish service. |
EFI_SUCCESS | Service has been stoped successfully. |
EFI_INVALID_PARAMETER | This is NULL or given the worng ServiceStopType. |
EFI_UNSUPPORTED | Not support to stop Redfish service. |
Others | Some error happened. |
Definition at line 123 of file RedfishCredentialDxe.c.
EFI_STATUS RedfishGetAuthConfig | ( | OUT EDKII_REDFISH_AUTH_METHOD * | AuthMethod, |
OUT CHAR8 ** | UserId | ||
) |
Retrieve platform's Redfish authentication information.
This functions returns the Redfish authentication method together with the user Id. For AuthMethodNone, UserId will point to NULL which means authentication is not required to access the Redfish service. Callers are responsible for freeing the returned string storage pointed by UserId.
[out] | AuthMethod | Type of Redfish authentication method. |
[out] | UserId | The pointer to store the returned UserId string. |
EFI_SUCCESS | Get the authentication information successfully. |
EFI_INVALID_PARAMETER | AuthMethod or UserId or Password is NULL. |
EFI_UNSUPPORTED | Unsupported authentication method is found. |
Definition at line 523 of file RedfishCredentialDxe.c.
EFI_STATUS RedfishGetServiceVersion | ( | OUT CHAR16 ** | ServiceVersionStr | ) |
This function returns the string of Redfish service version.
[out] | ServiceVersionStr | Redfish service string. |
Definition at line 377 of file RedfishCredentialDxe.c.
EFI_STATUS ReleaseCredentialPrivate | ( | ) |
Releases all resources allocated by the module. Uninstall all the protocols installed in the driver entry point.
EFI_SUCCESS | The resources are released. |
Others | Failed to release the resources. |
Definition at line 911 of file RedfishCredentialDxe.c.
REDFISH_CREDENTIAL_PRIVATE* mCredentialPrivate = NULL |
Definition at line 16 of file RedfishCredentialDxe.c.