]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/AuthenticationInfo.h
Grammatical and disclaimer changes (does not follow internal C coding stds.)
[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 - 2010, 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.
149
150 @retval EFI_SUCCESS Successfully retrieved authentication information
151 for the given ControllerHandle.
152 @retval EFI_INVALID_PARAMETER No matching authentication information found for
153 the given ControllerHandle.
154 @retval EFI_DEVICE_ERROR The authentication information could not be retrieved
155 due to a hardware error.
156
157 **/
158 typedef
159 EFI_STATUS
160 (EFIAPI *EFI_AUTHENTICATION_PROTOCOL_INFO_GET)(
161 IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,
162 IN EFI_HANDLE *ControllerHandle,
163 OUT VOID *Buffer
164 );
165
166 /**
167 Set the authentication information for a given controller handle.
168
169 @param[in] This The pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.
170 @param[in] ControllerHandle The handle to the Controller.
171 @param[in] Buffer The pointer to the authentication information.
172
173 @retval EFI_SUCCESS Successfully set authentication information for the
174 given ControllerHandle.
175 @retval EFI_UNSUPPORTED If the platform policies do not allow setting of
176 the authentication information.
177 @retval EFI_DEVICE_ERROR The authentication information could not be configured
178 due to a hardware error.
179 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data.
180
181 **/
182 typedef
183 EFI_STATUS
184 (EFIAPI *EFI_AUTHENTICATION_PROTOCOL_INFO_SET)(
185 IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,
186 IN EFI_HANDLE *ControllerHandle,
187 IN VOID *Buffer
188 );
189
190 ///
191 /// This protocol is used on any device handle to obtain authentication
192 /// information associated with the physical or logical device.
193 ///
194 struct _EFI_AUTHENTICATION_INFO_PROTOCOL {
195 EFI_AUTHENTICATION_PROTOCOL_INFO_GET Get;
196 EFI_AUTHENTICATION_PROTOCOL_INFO_SET Set;
197 };
198
199 extern EFI_GUID gEfiAuthenticationInfoProtocolGuid;
200 extern EFI_GUID gEfiAuthenticationChapRadiusGuid;
201 extern EFI_GUID gEfiAuthenticationChapLocalGuid;
202
203 #endif