]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/AuthenticationInfo.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / AuthenticationInfo.h
CommitLineData
d1f95000 1/** @file\r
2 EFI_AUTHENTICATION_INFO_PROTOCOL as defined in UEFI 2.0.\r
9095d37b 3 This protocol is used on any device handle to obtain authentication information\r
d1f95000 4 associated with the physical or logical device.\r
5\r
9095d37b 6Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 7SPDX-License-Identifier: BSD-2-Clause-Patent\r
d1f95000 8\r
d1f95000 9**/\r
10\r
11#ifndef __AUTHENTICATION_INFO_H__\r
12#define __AUTHENTICATION_INFO_H__\r
13\r
14#define EFI_AUTHENTICATION_INFO_PROTOCOL_GUID \\r
15 { \\r
16 0x7671d9d0, 0x53db, 0x4173, {0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0x0b, 0xc7 } \\r
17 }\r
9095d37b 18\r
d1f95000 19#define EFI_AUTHENTICATION_CHAP_RADIUS_GUID \\r
20 { \\r
21 0xd6062b50, 0x15ca, 0x11da, {0x92, 0x19, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \\r
22 }\r
23\r
24#define EFI_AUTHENTICATION_CHAP_LOCAL_GUID \\r
25 { \\r
26 0xc280c73e, 0x15ca, 0x11da, {0xb0, 0xca, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \\r
27 }\r
28\r
29typedef struct _EFI_AUTHENTICATION_INFO_PROTOCOL EFI_AUTHENTICATION_INFO_PROTOCOL;\r
30\r
bd86cb02 31#pragma pack(1)\r
d1f95000 32typedef struct {\r
f1004231
LG
33 ///\r
34 /// Authentication Type GUID.\r
35 ///\r
d1f95000 36 EFI_GUID Guid;\r
f1004231
LG
37\r
38 ///\r
39 /// Length of this structure in bytes.\r
40 ///\r
d1f95000 41 UINT16 Length;\r
42} AUTH_NODE_HEADER;\r
43\r
44typedef struct {\r
45 AUTH_NODE_HEADER Header;\r
f1004231
LG
46\r
47 ///\r
af2dc6a7 48 /// RADIUS Server IPv4 or IPv6 Address.\r
f1004231 49 ///\r
af2dc6a7 50 UINT8 RadiusIpAddr[16]; ///< IPv4 or IPv6 address.\r
f1004231
LG
51\r
52 ///\r
af2dc6a7 53 /// Reserved for future use.\r
f1004231 54 ///\r
d1f95000 55 UINT16 Reserved;\r
f1004231
LG
56\r
57 ///\r
af2dc6a7 58 /// Network Access Server IPv4 or IPv6 Address (OPTIONAL).\r
f1004231 59 ///\r
af2dc6a7 60 UINT8 NasIpAddr[16]; ///< IPv4 or IPv6 address.\r
f1004231
LG
61\r
62 ///\r
9abd3166 63 /// Network Access Server Secret Length in bytes (OPTIONAL).\r
f1004231 64 ///\r
9abd3166 65 UINT16 NasSecretLength;\r
f1004231
LG
66\r
67 ///\r
af2dc6a7 68 /// Network Access Server Secret (OPTIONAL).\r
f1004231 69 ///\r
bd86cb02 70 UINT8 NasSecret[1];\r
f1004231 71\r
9095d37b 72 ///\r
9abd3166 73 /// CHAP Initiator Secret Length in bytes on offset NasSecret + NasSecretLength.\r
f1004231 74 ///\r
bd86cb02 75 /// UINT16 ChapSecretLength;\r
f1004231 76 ///\r
9abd3166 77 /// CHAP Initiator Secret.\r
f1004231 78 ///\r
bd86cb02 79 /// UINT8 ChapSecret[];\r
f1004231 80 ///\r
af2dc6a7 81 /// CHAP Initiator Name Length in bytes on offset ChapSecret + ChapSecretLength.\r
f1004231 82 ///\r
bd86cb02 83 /// UINT16 ChapNameLength;\r
f1004231 84 ///\r
9abd3166 85 /// CHAP Initiator Name.\r
f1004231 86 ///\r
bd86cb02
LG
87 /// UINT8 ChapName[];\r
88 ///\r
9abd3166
RN
89 /// Reverse CHAP Name Length in bytes on offset ChapName + ChapNameLength.\r
90 ///\r
91 /// UINT16 ReverseChapNameLength;\r
92 ///\r
93 /// Reverse CHAP Name.\r
94 ///\r
95 /// UINT8 ReverseChapName[];\r
96 ///\r
97 /// Reverse CHAP Secret Length in bytes on offseet ReverseChapName + ReverseChapNameLength.\r
98 ///\r
99 /// UINT16 ReverseChapSecretLength;\r
100 ///\r
101 /// Reverse CHAP Secret.\r
102 ///\r
103 /// UINT8 ReverseChapSecret[];\r
104 ///\r
d1f95000 105} CHAP_RADIUS_AUTH_NODE;\r
106\r
107typedef struct {\r
108 AUTH_NODE_HEADER Header;\r
f1004231
LG
109\r
110 ///\r
af2dc6a7 111 /// Reserved for future use.\r
f1004231 112 ///\r
d1f95000 113 UINT16 Reserved;\r
f1004231
LG
114\r
115 ///\r
af2dc6a7 116 /// User Secret Length in bytes.\r
f1004231 117 ///\r
d1f95000 118 UINT16 UserSecretLength;\r
f1004231
LG
119\r
120 ///\r
af2dc6a7 121 /// User Secret.\r
f1004231 122 ///\r
bd86cb02 123 UINT8 UserSecret[1];\r
f1004231
LG
124\r
125 ///\r
af2dc6a7 126 /// User Name Length in bytes on offset UserSecret + UserSecretLength.\r
f1004231 127 ///\r
bd86cb02 128 /// UINT16 UserNameLength;\r
f1004231 129 ///\r
9abd3166 130 /// User Name.\r
f1004231 131 ///\r
9abd3166 132 /// UINT8 UserName[];\r
f1004231 133 ///\r
9abd3166 134 /// CHAP Initiator Secret Length in bytes on offset UserName + UserNameLength.\r
f1004231 135 ///\r
bd86cb02 136 /// UINT16 ChapSecretLength;\r
f1004231 137 ///\r
9abd3166 138 /// CHAP Initiator Secret.\r
f1004231 139 ///\r
9abd3166 140 /// UINT8 ChapSecret[];\r
f1004231 141 ///\r
9abd3166 142 /// CHAP Initiator Name Length in bytes on offset ChapSecret + ChapSecretLength.\r
f1004231 143 ///\r
bd86cb02 144 /// UINT16 ChapNameLength;\r
f1004231 145 ///\r
9abd3166
RN
146 /// CHAP Initiator Name.\r
147 ///\r
148 /// UINT8 ChapName[];\r
149 ///\r
150 /// Reverse CHAP Name Length in bytes on offset ChapName + ChapNameLength.\r
151 ///\r
152 /// UINT16 ReverseChapNameLength;\r
153 ///\r
154 /// Reverse CHAP Name.\r
155 ///\r
156 /// UINT8 ReverseChapName[];\r
157 ///\r
158 /// Reverse CHAP Secret Length in bytes on offset ReverseChapName + ReverseChapNameLength.\r
159 ///\r
160 /// UINT16 ReverseChapSecretLength;\r
161 ///\r
162 /// Reverse CHAP Secret.\r
f1004231 163 ///\r
9abd3166 164 /// UINT8 ReverseChapSecret[];\r
bd86cb02 165 ///\r
d1f95000 166} CHAP_LOCAL_AUTH_NODE;\r
bd86cb02 167#pragma pack()\r
d1f95000 168\r
169/**\r
630b4187 170 Retrieves the authentication information associated with a particular controller handle.\r
d1f95000 171\r
af2dc6a7 172 @param[in] This The pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.\r
173 @param[in] ControllerHandle The handle to the Controller.\r
8a18c8c2
SZ
174 @param[out] Buffer The pointer to the authentication information. This function is\r
175 responsible for allocating the buffer and it is the caller's\r
176 responsibility to free buffer when the caller is finished with buffer.\r
d1f95000 177\r
9095d37b 178 @retval EFI_SUCCESS Successfully retrieved authentication information\r
af2dc6a7 179 for the given ControllerHandle.\r
9095d37b 180 @retval EFI_INVALID_PARAMETER No matching authentication information found for\r
af2dc6a7 181 the given ControllerHandle.\r
9095d37b 182 @retval EFI_DEVICE_ERROR The authentication information could not be retrieved\r
af2dc6a7 183 due to a hardware error.\r
d1f95000 184\r
185**/\r
186typedef\r
187EFI_STATUS\r
8a18c8c2 188(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_GET)(\r
d1f95000 189 IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,\r
8a18c8c2
SZ
190 IN EFI_HANDLE ControllerHandle,\r
191 OUT VOID **Buffer\r
bd86cb02 192 );\r
d1f95000 193\r
194/**\r
630b4187 195 Set the authentication information for a given controller handle.\r
d1f95000 196\r
af2dc6a7 197 @param[in] This The pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.\r
198 @param[in] ControllerHandle The handle to the Controller.\r
199 @param[in] Buffer The pointer to the authentication information.\r
9095d37b
LG
200\r
201 @retval EFI_SUCCESS Successfully set authentication information for the\r
af2dc6a7 202 given ControllerHandle.\r
9095d37b 203 @retval EFI_UNSUPPORTED If the platform policies do not allow setting of\r
af2dc6a7 204 the authentication information.\r
9095d37b 205 @retval EFI_DEVICE_ERROR The authentication information could not be configured\r
af2dc6a7 206 due to a hardware error.\r
d1f95000 207 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data.\r
208\r
209**/\r
210typedef\r
211EFI_STATUS\r
8a18c8c2 212(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_SET)(\r
d1f95000 213 IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,\r
8a18c8c2 214 IN EFI_HANDLE ControllerHandle,\r
d1f95000 215 IN VOID *Buffer\r
9095d37b 216 );\r
d1f95000 217\r
44717a39 218///\r
9095d37b 219/// This protocol is used on any device handle to obtain authentication\r
44717a39 220/// information associated with the physical or logical device.\r
221///\r
d1f95000 222struct _EFI_AUTHENTICATION_INFO_PROTOCOL {\r
8a18c8c2
SZ
223 EFI_AUTHENTICATION_INFO_PROTOCOL_GET Get;\r
224 EFI_AUTHENTICATION_INFO_PROTOCOL_SET Set;\r
d1f95000 225};\r
226\r
227extern EFI_GUID gEfiAuthenticationInfoProtocolGuid;\r
228extern EFI_GUID gEfiAuthenticationChapRadiusGuid;\r
229extern EFI_GUID gEfiAuthenticationChapLocalGuid;\r
230\r
231#endif\r