]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/AuthenticationInfo.h
MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC
[mirror_edk2.git] / MdePkg / Include / Protocol / AuthenticationInfo.h
index c491cba1eaed7ed6b5dae1c1c5c42e3fc8b3d439..a69423fe5b266a80557a95ce0183fbed09153541 100644 (file)
@@ -3,14 +3,14 @@
   This protocol is used on any device handle to obtain authentication information \r
   associated with the physical or logical device.\r
 \r
-  Copyright (c) 2006, Intel Corporation                                                         \r
-  All rights reserved. This program and the accompanying materials                          \r
-  are licensed and made available under the terms and conditions of the BSD License         \r
-  which accompanies this distribution.  The full text of the license may be found at        \r
-  http://opensource.org/licenses/bsd-license.php                                            \r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution.  \r
+The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php.                                          \r
+    \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
 \r
 **/\r
 \r
 \r
 typedef struct _EFI_AUTHENTICATION_INFO_PROTOCOL EFI_AUTHENTICATION_INFO_PROTOCOL;\r
 \r
+#pragma pack(1)\r
 typedef struct {\r
+  ///\r
+  /// Authentication Type GUID.\r
+  ///\r
   EFI_GUID         Guid;\r
+\r
+  ///\r
+  /// Length of this structure in bytes.\r
+  ///\r
   UINT16           Length;\r
 } AUTH_NODE_HEADER;\r
 \r
 typedef struct {\r
   AUTH_NODE_HEADER Header;\r
-  EFI_IPv6_ADDRESS RadiusIpAddr;             // IPv4 or IPv6 address\r
+\r
+  ///\r
+  /// RADIUS Server IPv4 or IPv6 Address.\r
+  ///\r
+  UINT8            RadiusIpAddr[16];         ///< IPv4 or IPv6 address.\r
+\r
+  ///\r
+  /// Reserved for future use.\r
+  ///\r
   UINT16           Reserved;\r
-  EFI_IPv6_ADDRESS NasIpAddr;                // IPv4 or IPv6 address\r
-  UINT16           NasSecretLength; \r
-  UINT8            *NasSecret;      \r
-  UINT16           ChapSecretLength;\r
-  UINT8            *ChapSecret;\r
-  UINT16           ChapNameLength;\r
-  UINT8            *ChapName;\r
+\r
+  ///\r
+  /// Network Access Server IPv4 or IPv6 Address (OPTIONAL).\r
+  ///\r
+  UINT8            NasIpAddr[16];            ///< IPv4 or IPv6 address.\r
+\r
+  ///\r
+  /// Network Access Server Secret Length in bytes (OPTIONAL).\r
+  ///\r
+  UINT16           NasSecretLength;\r
+\r
+  ///\r
+  /// Network Access Server Secret (OPTIONAL).\r
+  ///\r
+  UINT8            NasSecret[1];\r
+\r
+  /// \r
+  /// CHAP Initiator Secret Length in bytes on offset NasSecret + NasSecretLength.\r
+  ///\r
+  /// UINT16           ChapSecretLength;\r
+  ///\r
+  /// CHAP Initiator Secret.\r
+  ///\r
+  /// UINT8            ChapSecret[];\r
+  ///\r
+  /// CHAP Initiator Name Length in bytes on offset ChapSecret + ChapSecretLength.\r
+  ///\r
+  /// UINT16           ChapNameLength;\r
+  ///\r
+  /// CHAP Initiator Name.\r
+  ///\r
+  /// UINT8            ChapName[];\r
+  ///\r
+  /// Reverse CHAP Name Length in bytes on offset ChapName + ChapNameLength.\r
+  ///\r
+  /// UINT16           ReverseChapNameLength;\r
+  ///\r
+  /// Reverse CHAP Name.\r
+  ///\r
+  /// UINT8            ReverseChapName[];\r
+  ///\r
+  /// Reverse CHAP Secret Length in bytes on offseet ReverseChapName + ReverseChapNameLength.\r
+  ///\r
+  /// UINT16           ReverseChapSecretLength;\r
+  ///\r
+  /// Reverse CHAP Secret.\r
+  ///\r
+  /// UINT8            ReverseChapSecret[];\r
+  ///\r
 } CHAP_RADIUS_AUTH_NODE;\r
 \r
 typedef struct {\r
   AUTH_NODE_HEADER Header;\r
+\r
+  ///\r
+  /// Reserved for future use.\r
+  ///\r
   UINT16           Reserved;\r
+\r
+  ///\r
+  /// User Secret Length in bytes.\r
+  ///\r
   UINT16           UserSecretLength;\r
-  UINT8            *UserSecret;     \r
-  UINT16           UserNameLength;\r
-  UINT8            *UserName;\r
-  UINT16           ChapSecretLength;\r
-  UINT8            *ChapSecret;\r
-  UINT16           ChapNameLength;\r
-  UINT8            *ChapName;\r
+\r
+  ///\r
+  /// User Secret.\r
+  ///\r
+  UINT8            UserSecret[1];\r
+\r
+  ///\r
+  /// User Name Length in bytes on offset UserSecret + UserSecretLength.\r
+  ///\r
+  /// UINT16           UserNameLength;\r
+  ///\r
+  /// User Name.\r
+  ///\r
+  /// UINT8            UserName[];\r
+  ///\r
+  /// CHAP Initiator Secret Length in bytes on offset UserName + UserNameLength.\r
+  ///\r
+  /// UINT16           ChapSecretLength;\r
+  ///\r
+  /// CHAP Initiator Secret.\r
+  ///\r
+  /// UINT8            ChapSecret[];\r
+  ///\r
+  /// CHAP Initiator Name Length in bytes on offset ChapSecret + ChapSecretLength.\r
+  ///\r
+  /// UINT16           ChapNameLength;\r
+  ///\r
+  /// CHAP Initiator Name.\r
+  ///\r
+  /// UINT8            ChapName[];\r
+  ///\r
+  /// Reverse CHAP Name Length in bytes on offset ChapName + ChapNameLength.\r
+  ///\r
+  /// UINT16           ReverseChapNameLength;\r
+  ///\r
+  /// Reverse CHAP Name.\r
+  ///\r
+  /// UINT8            ReverseChapName[];\r
+  ///\r
+  /// Reverse CHAP Secret Length in bytes on offset ReverseChapName + ReverseChapNameLength.\r
+  ///\r
+  /// UINT16           ReverseChapSecretLength;\r
+  ///\r
+  /// Reverse CHAP Secret.\r
+  ///\r
+  /// UINT8            ReverseChapSecret[];\r
+  ///\r
 } CHAP_LOCAL_AUTH_NODE;\r
+#pragma pack()\r
 \r
 /**\r
-  Retrieves the Authentication information associated with a particular controller handle.\r
+  Retrieves the authentication information associated with a particular controller handle.\r
 \r
-  @param  This                   Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL\r
-  @param  ControllerHandle       Handle to the Controller\r
-  @param  Buffer                 Pointer to the authentication information.\r
+  @param[in]  This                  The pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.\r
+  @param[in]  ControllerHandle      The handle to the Controller.\r
+  @param[out] Buffer                The pointer to the authentication information. This function is\r
+                                    responsible for allocating the buffer and it is the caller's\r
+                                    responsibility to free buffer when the caller is finished with buffer.\r
 \r
-  @retval EFI_SUCCESS           Successfully retrieved Authentication information for the given ControllerHandle\r
-  @retval EFI_INVALID_PARAMETER No matching Authentication information found for the given ControllerHandle\r
-  @retval EFI_DEVICE_ERROR      The authentication information could not be retrieved due to a\r
-                                hardware error.\r
+  @retval EFI_SUCCESS           Successfully retrieved authentication information \r
+                                for the given ControllerHandle.\r
+  @retval EFI_INVALID_PARAMETER No matching authentication information found for \r
+                                the given ControllerHandle.\r
+  @retval EFI_DEVICE_ERROR      The authentication information could not be retrieved \r
+                                due to a hardware error.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_AUTHENTICATION_PROTOCOL_INFO_GET) (\r
+(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_GET)(\r
   IN  EFI_AUTHENTICATION_INFO_PROTOCOL *This,\r
-  IN  EFI_HANDLE                       *ControllerHandle,\r
-  OUT VOID                             *Buffer\r
-  )\r
-;  \r
+  IN  EFI_HANDLE                       ControllerHandle,\r
+  OUT VOID                             **Buffer\r
+  );\r
 \r
 /**\r
-  Set the Authentication information for a given controller handle.\r
+  Set the authentication information for a given controller handle.\r
 \r
-  @param  This                  Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL\r
-  @param  ControllerHandle      Handle to the Controller\r
-  @param  Buffer                Pointer to the authentication information.\r
+  @param[in]  This                 The pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.\r
+  @param[in]  ControllerHandle     The handle to the Controller.\r
+  @param[in]  Buffer               The pointer to the authentication information.\r
                                 \r
-  @retval EFI_SUCCESS          Successfully set Authentication information for the given ControllerHandle\r
-  @retval EFI_UNSUPPORTED      If the platform policies do not allow setting of the Authentication\r
-                               information.\r
-  @retval EFI_DEVICE_ERROR     The authentication information could not be configured due to a\r
-                               hardware error.\r
+  @retval EFI_SUCCESS          Successfully set authentication information for the \r
+                               given ControllerHandle.\r
+  @retval EFI_UNSUPPORTED      If the platform policies do not allow setting of \r
+                               the authentication information.\r
+  @retval EFI_DEVICE_ERROR     The authentication information could not be configured \r
+                               due to a hardware error.\r
   @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_AUTHENTICATION_PROTOCOL_INFO_SET) (\r
+(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_SET)(\r
   IN EFI_AUTHENTICATION_INFO_PROTOCOL  *This,\r
-  IN EFI_HANDLE                        *ControllerHandle,\r
+  IN EFI_HANDLE                        ControllerHandle,\r
   IN VOID                              *Buffer\r
-  )\r
-;  \r
+  );  \r
 \r
+///\r
+/// This protocol is used on any device handle to obtain authentication \r
+/// information associated with the physical or logical device.\r
+///\r
 struct _EFI_AUTHENTICATION_INFO_PROTOCOL {\r
-  EFI_AUTHENTICATION_PROTOCOL_INFO_GET Get;\r
-  EFI_AUTHENTICATION_PROTOCOL_INFO_SET Set;\r
+  EFI_AUTHENTICATION_INFO_PROTOCOL_GET Get;\r
+  EFI_AUTHENTICATION_INFO_PROTOCOL_SET Set;\r
 };\r
 \r
 extern EFI_GUID gEfiAuthenticationInfoProtocolGuid;\r