]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/AuthenticationInfo.h
Update prototype name of Get()/Set() to EFI_AUTHENTICATION_INFO_PROTOCOL_GET/ EFI_AUT...
[mirror_edk2.git] / MdePkg / Include / Protocol / AuthenticationInfo.h
1 /** @file
2 EFI_AUTHENTICATION_INFO_PROTOCOL as defined in UEFI 2.0.
3 This protocol is used on any device handle to obtain authentication information
4 associated with the physical or logical device.
5
6 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials are licensed and made available under
8 the terms and conditions of the BSD License that accompanies this distribution.
9 The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php.
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef __AUTHENTICATION_INFO_H__
18 #define __AUTHENTICATION_INFO_H__
19
20 #define EFI_AUTHENTICATION_INFO_PROTOCOL_GUID \
21 { \
22 0x7671d9d0, 0x53db, 0x4173, {0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0x0b, 0xc7 } \
23 }
24
25 #define EFI_AUTHENTICATION_CHAP_RADIUS_GUID \
26 { \
27 0xd6062b50, 0x15ca, 0x11da, {0x92, 0x19, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \
28 }
29
30 #define EFI_AUTHENTICATION_CHAP_LOCAL_GUID \
31 { \
32 0xc280c73e, 0x15ca, 0x11da, {0xb0, 0xca, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \
33 }
34
35 typedef struct _EFI_AUTHENTICATION_INFO_PROTOCOL EFI_AUTHENTICATION_INFO_PROTOCOL;
36
37 #pragma pack(1)
38 typedef struct {
39 ///
40 /// Authentication Type GUID.
41 ///
42 EFI_GUID Guid;
43
44 ///
45 /// Length of this structure in bytes.
46 ///
47 UINT16 Length;
48 } AUTH_NODE_HEADER;
49
50 typedef struct {
51 AUTH_NODE_HEADER Header;
52
53 ///
54 /// RADIUS Server IPv4 or IPv6 Address.
55 ///
56 UINT8 RadiusIpAddr[16]; ///< IPv4 or IPv6 address.
57
58 ///
59 /// Reserved for future use.
60 ///
61 UINT16 Reserved;
62
63 ///
64 /// Network Access Server IPv4 or IPv6 Address (OPTIONAL).
65 ///
66 UINT8 NasIpAddr[16]; ///< IPv4 or IPv6 address.
67
68 ///
69 /// Network Access Server Secret Length in bytes (OPTIONAL)
70 ///
71 UINT16 NasSecretLength;
72
73 ///
74 /// Network Access Server Secret (OPTIONAL).
75 ///
76 UINT8 NasSecret[1];
77
78 ///
79 /// CHAP Initiator Secret length in bytes on offset NasSecret + NasSecretLength.
80 ///
81 /// UINT16 ChapSecretLength;
82 ///
83 /// CHAP Initiator Secret
84 ///
85 /// UINT8 ChapSecret[];
86 ///
87 /// CHAP Initiator Name Length in bytes on offset ChapSecret + ChapSecretLength.
88 ///
89 /// UINT16 ChapNameLength;
90 ///
91 /// CHAP Initiator Name
92 ///
93 /// UINT8 ChapName[];
94 ///
95 } CHAP_RADIUS_AUTH_NODE;
96
97 typedef struct {
98 AUTH_NODE_HEADER Header;
99
100 ///
101 /// Reserved for future use.
102 ///
103 UINT16 Reserved;
104
105 ///
106 /// User Secret Length in bytes.
107 ///
108 UINT16 UserSecretLength;
109
110 ///
111 /// User Secret.
112 ///
113 UINT8 UserSecret[1];
114
115 ///
116 /// User Name Length in bytes on offset UserSecret + UserSecretLength.
117 ///
118 /// UINT16 UserNameLength;
119 ///
120 /// User Name
121 ///
122 /// UINT8 *UserName;
123 ///
124 /// CHAP Initiator Secret length in bytes on offset UserName + UserNameLength
125 ///
126 /// UINT16 ChapSecretLength;
127 ///
128 /// CHAP Initiator Secret
129 ///
130 /// UINT8 *ChapSecret;
131 ///
132 /// CHAP Initiator Name Length in bytes on offset ChapSecret + ChapSecretLength
133 ///
134 /// UINT16 ChapNameLength;
135 ///
136 /// CHAP Initiator Name
137 ///
138 /// UINT8 *ChapName;
139 ///
140 } CHAP_LOCAL_AUTH_NODE;
141 #pragma pack()
142
143 /**
144 Retrieves the authentication information associated with a particular controller handle.
145
146 @param[in] This The pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.
147 @param[in] ControllerHandle The handle to the Controller.
148 @param[out] Buffer The pointer to the authentication information. This function is
149 responsible for allocating the buffer and it is the caller's
150 responsibility to free buffer when the caller is finished with buffer.
151
152 @retval EFI_SUCCESS Successfully retrieved authentication information
153 for the given ControllerHandle.
154 @retval EFI_INVALID_PARAMETER No matching authentication information found for
155 the given ControllerHandle.
156 @retval EFI_DEVICE_ERROR The authentication information could not be retrieved
157 due to a hardware error.
158
159 **/
160 typedef
161 EFI_STATUS
162 (EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_GET)(
163 IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,
164 IN EFI_HANDLE ControllerHandle,
165 OUT VOID **Buffer
166 );
167
168 /**
169 Set the authentication information for a given controller handle.
170
171 @param[in] This The pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.
172 @param[in] ControllerHandle The handle to the Controller.
173 @param[in] Buffer The pointer to the authentication information.
174
175 @retval EFI_SUCCESS Successfully set authentication information for the
176 given ControllerHandle.
177 @retval EFI_UNSUPPORTED If the platform policies do not allow setting of
178 the authentication information.
179 @retval EFI_DEVICE_ERROR The authentication information could not be configured
180 due to a hardware error.
181 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data.
182
183 **/
184 typedef
185 EFI_STATUS
186 (EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_SET)(
187 IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,
188 IN EFI_HANDLE ControllerHandle,
189 IN VOID *Buffer
190 );
191
192 ///
193 /// This protocol is used on any device handle to obtain authentication
194 /// information associated with the physical or logical device.
195 ///
196 struct _EFI_AUTHENTICATION_INFO_PROTOCOL {
197 EFI_AUTHENTICATION_INFO_PROTOCOL_GET Get;
198 EFI_AUTHENTICATION_INFO_PROTOCOL_SET Set;
199 };
200
201 extern EFI_GUID gEfiAuthenticationInfoProtocolGuid;
202 extern EFI_GUID gEfiAuthenticationChapRadiusGuid;
203 extern EFI_GUID gEfiAuthenticationChapLocalGuid;
204
205 #endif