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