PlatformCredentialLibNull.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /** @file
  2. NULL instace of RedfishPlatformCredentialLib
  3. (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #include <Uefi.h>
  7. #include <Protocol/EdkIIRedfishCredential.h>
  8. /**
  9. Notification of Exit Boot Service.
  10. @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL.
  11. **/
  12. VOID
  13. EFIAPI
  14. LibCredentialExitBootServicesNotify (
  15. IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This
  16. )
  17. {
  18. return;
  19. }
  20. /**
  21. Notification of End of DXe.
  22. @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL.
  23. **/
  24. VOID
  25. EFIAPI
  26. LibCredentialEndOfDxeNotify (
  27. IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This
  28. )
  29. {
  30. return;
  31. }
  32. /**
  33. Retrieve platform's Redfish authentication information.
  34. This functions returns the Redfish authentication method together with the user Id and
  35. password.
  36. - For AuthMethodNone, the UserId and Password could be used for HTTP header authentication
  37. as defined by RFC7235.
  38. - For AuthMethodRedfishSession, the UserId and Password could be used for Redfish
  39. session login as defined by Redfish API specification (DSP0266).
  40. Callers are responsible for and freeing the returned string storage.
  41. @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL instance.
  42. @param[out] AuthMethod Type of Redfish authentication method.
  43. @param[out] UserId The pointer to store the returned UserId string.
  44. @param[out] Password The pointer to store the returned Password string.
  45. @retval EFI_SUCCESS Get the authentication information successfully.
  46. @retval EFI_ACCESS_DENIED SecureBoot is disabled after EndOfDxe.
  47. @retval EFI_INVALID_PARAMETER This or AuthMethod or UserId or Password is NULL.
  48. @retval EFI_OUT_OF_RESOURCES There are not enough memory resources.
  49. @retval EFI_UNSUPPORTED Unsupported authentication method is found.
  50. **/
  51. EFI_STATUS
  52. EFIAPI
  53. LibCredentialGetAuthInfo (
  54. IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,
  55. OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,
  56. OUT CHAR8 **UserId,
  57. OUT CHAR8 **Password
  58. )
  59. {
  60. return EFI_UNSUPPORTED;
  61. }
  62. /**
  63. Notify the Redfish service provide to stop provide configuration service to this platform.
  64. This function should be called when the platfrom is about to leave the safe environment.
  65. It will notify the Redfish service provider to abort all logined session, and prohibit
  66. further login with original auth info. GetAuthInfo() will return EFI_UNSUPPORTED once this
  67. function is returned.
  68. @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL instance.
  69. @param[in] ServiceStopType Reason of stopping Redfish service.
  70. @retval EFI_SUCCESS Service has been stoped successfully.
  71. @retval EFI_INVALID_PARAMETER This is NULL or given the worng ServiceStopType.
  72. @retval EFI_UNSUPPORTED Not support to stop Redfish service.
  73. @retval Others Some error happened.
  74. **/
  75. EFI_STATUS
  76. EFIAPI
  77. LibStopRedfishService (
  78. IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,
  79. IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType
  80. )
  81. {
  82. return EFI_UNSUPPORTED;
  83. }