]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/Eap.h
MdePkg: Add new MM MP Protocol definition.
[mirror_edk2.git] / MdePkg / Include / Protocol / Eap.h
... / ...
CommitLineData
1/** @file\r
2 EFI EAP(Extended Authenticaton Protocol) Protocol Definition\r
3 The EFI EAP Protocol is used to abstract the ability to configure and extend the\r
4 EAP framework.\r
5 The definitions in this file are defined in UEFI Specification 2.3.1B, which have\r
6 not been verified by one implementation yet.\r
7\r
8 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
9 SPDX-License-Identifier: BSD-2-Clause-Patent\r
10\r
11 @par Revision Reference:\r
12 This Protocol is introduced in UEFI Specification 2.2\r
13\r
14**/\r
15\r
16#ifndef __EFI_EAP_PROTOCOL_H__\r
17#define __EFI_EAP_PROTOCOL_H__\r
18\r
19\r
20#define EFI_EAP_PROTOCOL_GUID \\r
21 { \\r
22 0x5d9f96db, 0xe731, 0x4caa, {0xa0, 0xd, 0x72, 0xe1, 0x87, 0xcd, 0x77, 0x62 } \\r
23 }\r
24\r
25typedef struct _EFI_EAP_PROTOCOL EFI_EAP_PROTOCOL;\r
26\r
27///\r
28/// Type for the identification number assigned to the Port by the\r
29/// System in which the Port resides.\r
30///\r
31typedef VOID * EFI_PORT_HANDLE;\r
32\r
33///\r
34/// EAP Authentication Method Type (RFC 3748)\r
35///@{\r
36#define EFI_EAP_TYPE_TLS 13 ///< REQUIRED - RFC 5216\r
37///@}\r
38\r
39//\r
40// EAP_TYPE MD5, OTP and TOEKN_CARD has been removed from UEFI2.3.1B.\r
41// Definitions are kept for backward compatibility.\r
42//\r
43#define EFI_EAP_TYPE_MD5 4\r
44#define EFI_EAP_TYPE_OTP 5\r
45#define EFI_EAP_TYPE_TOKEN_CARD 6\r
46\r
47/**\r
48 One user provided EAP authentication method.\r
49\r
50 Build EAP response packet in response to the EAP request packet specified by\r
51 (RequestBuffer, RequestSize).\r
52\r
53 @param[in] PortNumber Specified the Port where the EAP request packet comes.\r
54 @param[in] RequestBuffer Pointer to the most recently received EAP- Request packet.\r
55 @param[in] RequestSize Packet size in bytes for the most recently received\r
56 EAP-Request packet.\r
57 @param[in] Buffer Pointer to the buffer to hold the built packet.\r
58 @param[in, out] BufferSize Pointer to the buffer size in bytes.\r
59 On input, it is the buffer size provided by the caller.\r
60 On output, it is the buffer size in fact needed to contain\r
61 the packet.\r
62\r
63 @retval EFI_SUCCESS The required EAP response packet is built successfully.\r
64 @retval others Failures are encountered during the packet building process.\r
65\r
66**/\r
67typedef\r
68EFI_STATUS\r
69(EFIAPI *EFI_EAP_BUILD_RESPONSE_PACKET)(\r
70 IN EFI_PORT_HANDLE PortNumber,\r
71 IN UINT8 *RequestBuffer,\r
72 IN UINTN RequestSize,\r
73 IN UINT8 *Buffer,\r
74 IN OUT UINTN *BufferSize\r
75 );\r
76\r
77/**\r
78 Set the desired EAP authentication method for the Port.\r
79\r
80 The SetDesiredAuthMethod() function sets the desired EAP authentication method indicated\r
81 by EapAuthType for the Port.\r
82\r
83 If EapAuthType is an invalid EAP authentication type, then EFI_INVALID_PARAMETER is\r
84 returned.\r
85 If the EAP authentication method of EapAuthType is unsupported by the Ports, then it will\r
86 return EFI_UNSUPPORTED.\r
87 The cryptographic strength of EFI_EAP_TYPE_TLS shall be at least of hash strength\r
88 SHA-256 and RSA key length of at least 2048 bits.\r
89\r
90 @param[in] This A pointer to the EFI_EAP_PROTOCOL instance that indicates\r
91 the calling context.\r
92 @param[in] EapAuthType The type of the EAP authentication method to register. It should\r
93 be the type value defined by RFC. See RFC 2284 for details.\r
94 @param[in] Handler The handler of the EAP authentication method to register.\r
95\r
96 @retval EFI_SUCCESS The EAP authentication method of EapAuthType is\r
97 registered successfully.\r
98 @retval EFI_INVALID_PARAMETER EapAuthType is an invalid EAP authentication type.\r
99 @retval EFI_UNSUPPORTED The EAP authentication method of EapAuthType is\r
100 unsupported by the Port.\r
101\r
102**/\r
103typedef\r
104EFI_STATUS\r
105(EFIAPI *EFI_EAP_SET_DESIRED_AUTHENTICATION_METHOD)(\r
106 IN EFI_EAP_PROTOCOL *This,\r
107 IN UINT8 EapAuthType\r
108 );\r
109\r
110/**\r
111 Register an EAP authentication method.\r
112\r
113 The RegisterAuthMethod() function registers the user provided EAP authentication method,\r
114 the type of which is EapAuthType and the handler of which is Handler.\r
115\r
116 If EapAuthType is an invalid EAP authentication type, then EFI_INVALID_PARAMETER is\r
117 returned.\r
118 If there is not enough system memory to perform the registration, then\r
119 EFI_OUT_OF_RESOURCES is returned.\r
120\r
121 @param[in] This A pointer to the EFI_EAP_PROTOCOL instance that indicates\r
122 the calling context.\r
123 @param[in] EapAuthType The type of the EAP authentication method to register. It should\r
124 be the type value defined by RFC. See RFC 2284 for details.\r
125 @param[in] Handler The handler of the EAP authentication method to register.\r
126\r
127 @retval EFI_SUCCESS The EAP authentication method of EapAuthType is\r
128 registered successfully.\r
129 @retval EFI_INVALID_PARAMETER EapAuthType is an invalid EAP authentication type.\r
130 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to perform the registration.\r
131\r
132**/\r
133typedef\r
134EFI_STATUS\r
135(EFIAPI *EFI_EAP_REGISTER_AUTHENTICATION_METHOD)(\r
136 IN EFI_EAP_PROTOCOL *This,\r
137 IN UINT8 EapAuthType,\r
138 IN EFI_EAP_BUILD_RESPONSE_PACKET Handler\r
139 );\r
140\r
141///\r
142/// EFI_EAP_PROTOCOL\r
143/// is used to configure the desired EAP authentication method for the EAP\r
144/// framework and extend the EAP framework by registering new EAP authentication\r
145/// method on a Port. The EAP framework is built on a per-Port basis. Herein, a\r
146/// Port means a NIC. For the details of EAP protocol, please refer to RFC 2284.\r
147///\r
148struct _EFI_EAP_PROTOCOL {\r
149 EFI_EAP_SET_DESIRED_AUTHENTICATION_METHOD SetDesiredAuthMethod;\r
150 EFI_EAP_REGISTER_AUTHENTICATION_METHOD RegisterAuthMethod;\r
151};\r
152\r
153extern EFI_GUID gEfiEapProtocolGuid;\r
154\r
155#endif\r
156\r