]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/AuthenticationInfo.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / AuthenticationInfo.h
... / ...
CommitLineData
1/** @file\r
2 EFI_AUTHENTICATION_INFO_PROTOCOL as defined in UEFI 2.0.\r
3 This protocol is used on any device handle to obtain authentication information\r
4 associated with the physical or logical device.\r
5\r
6Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
7SPDX-License-Identifier: BSD-2-Clause-Patent\r
8\r
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
18\r
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
31#pragma pack(1)\r
32typedef struct {\r
33 ///\r
34 /// Authentication Type GUID.\r
35 ///\r
36 EFI_GUID Guid;\r
37\r
38 ///\r
39 /// Length of this structure in bytes.\r
40 ///\r
41 UINT16 Length;\r
42} AUTH_NODE_HEADER;\r
43\r
44typedef struct {\r
45 AUTH_NODE_HEADER Header;\r
46\r
47 ///\r
48 /// RADIUS Server IPv4 or IPv6 Address.\r
49 ///\r
50 UINT8 RadiusIpAddr[16]; ///< IPv4 or IPv6 address.\r
51\r
52 ///\r
53 /// Reserved for future use.\r
54 ///\r
55 UINT16 Reserved;\r
56\r
57 ///\r
58 /// Network Access Server IPv4 or IPv6 Address (OPTIONAL).\r
59 ///\r
60 UINT8 NasIpAddr[16]; ///< IPv4 or IPv6 address.\r
61\r
62 ///\r
63 /// Network Access Server Secret Length in bytes (OPTIONAL).\r
64 ///\r
65 UINT16 NasSecretLength;\r
66\r
67 ///\r
68 /// Network Access Server Secret (OPTIONAL).\r
69 ///\r
70 UINT8 NasSecret[1];\r
71\r
72 ///\r
73 /// CHAP Initiator Secret Length in bytes on offset NasSecret + NasSecretLength.\r
74 ///\r
75 /// UINT16 ChapSecretLength;\r
76 ///\r
77 /// CHAP Initiator Secret.\r
78 ///\r
79 /// UINT8 ChapSecret[];\r
80 ///\r
81 /// CHAP Initiator Name Length in bytes on offset ChapSecret + ChapSecretLength.\r
82 ///\r
83 /// UINT16 ChapNameLength;\r
84 ///\r
85 /// CHAP Initiator Name.\r
86 ///\r
87 /// UINT8 ChapName[];\r
88 ///\r
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
105} CHAP_RADIUS_AUTH_NODE;\r
106\r
107typedef struct {\r
108 AUTH_NODE_HEADER Header;\r
109\r
110 ///\r
111 /// Reserved for future use.\r
112 ///\r
113 UINT16 Reserved;\r
114\r
115 ///\r
116 /// User Secret Length in bytes.\r
117 ///\r
118 UINT16 UserSecretLength;\r
119\r
120 ///\r
121 /// User Secret.\r
122 ///\r
123 UINT8 UserSecret[1];\r
124\r
125 ///\r
126 /// User Name Length in bytes on offset UserSecret + UserSecretLength.\r
127 ///\r
128 /// UINT16 UserNameLength;\r
129 ///\r
130 /// User Name.\r
131 ///\r
132 /// UINT8 UserName[];\r
133 ///\r
134 /// CHAP Initiator Secret Length in bytes on offset UserName + UserNameLength.\r
135 ///\r
136 /// UINT16 ChapSecretLength;\r
137 ///\r
138 /// CHAP Initiator Secret.\r
139 ///\r
140 /// UINT8 ChapSecret[];\r
141 ///\r
142 /// CHAP Initiator Name Length in bytes on offset ChapSecret + ChapSecretLength.\r
143 ///\r
144 /// UINT16 ChapNameLength;\r
145 ///\r
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
163 ///\r
164 /// UINT8 ReverseChapSecret[];\r
165 ///\r
166} CHAP_LOCAL_AUTH_NODE;\r
167#pragma pack()\r
168\r
169/**\r
170 Retrieves the authentication information associated with a particular controller handle.\r
171\r
172 @param[in] This The pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.\r
173 @param[in] ControllerHandle The handle to the Controller.\r
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
177\r
178 @retval EFI_SUCCESS Successfully retrieved authentication information\r
179 for the given ControllerHandle.\r
180 @retval EFI_INVALID_PARAMETER No matching authentication information found for\r
181 the given ControllerHandle.\r
182 @retval EFI_DEVICE_ERROR The authentication information could not be retrieved\r
183 due to a hardware error.\r
184\r
185**/\r
186typedef\r
187EFI_STATUS\r
188(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_GET)(\r
189 IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,\r
190 IN EFI_HANDLE ControllerHandle,\r
191 OUT VOID **Buffer\r
192 );\r
193\r
194/**\r
195 Set the authentication information for a given controller handle.\r
196\r
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
200\r
201 @retval EFI_SUCCESS Successfully set authentication information for the\r
202 given ControllerHandle.\r
203 @retval EFI_UNSUPPORTED If the platform policies do not allow setting of\r
204 the authentication information.\r
205 @retval EFI_DEVICE_ERROR The authentication information could not be configured\r
206 due to a hardware error.\r
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
212(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_SET)(\r
213 IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,\r
214 IN EFI_HANDLE ControllerHandle,\r
215 IN VOID *Buffer\r
216 );\r
217\r
218///\r
219/// This protocol is used on any device handle to obtain authentication\r
220/// information associated with the physical or logical device.\r
221///\r
222struct _EFI_AUTHENTICATION_INFO_PROTOCOL {\r
223 EFI_AUTHENTICATION_INFO_PROTOCOL_GET Get;\r
224 EFI_AUTHENTICATION_INFO_PROTOCOL_SET Set;\r
225};\r
226\r
227extern EFI_GUID gEfiAuthenticationInfoProtocolGuid;\r
228extern EFI_GUID gEfiAuthenticationChapRadiusGuid;\r
229extern EFI_GUID gEfiAuthenticationChapLocalGuid;\r
230\r
231#endif\r