Subrata Banik | 20fe24b | 2021-12-09 02:46:38 +0530 | [diff] [blame] | 1 | /** @file |
| 2 | This file defines the EFI EAP Configuration protocol. |
| 3 | |
| 4 | Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR> |
| 5 | SPDX-License-Identifier: BSD-2-Clause-Patent |
| 6 | |
| 7 | @par Revision Reference: |
| 8 | This Protocol is introduced in UEFI Specification 2.5 |
| 9 | |
| 10 | **/ |
| 11 | |
| 12 | #ifndef __EFI_EAP_CONFIGURATION_PROTOCOL_H__ |
| 13 | #define __EFI_EAP_CONFIGURATION_PROTOCOL_H__ |
| 14 | |
| 15 | /// |
| 16 | /// EFI EAP Configuration protocol provides a way to set and get EAP configuration. |
| 17 | /// |
| 18 | #define EFI_EAP_CONFIGURATION_PROTOCOL_GUID \ |
| 19 | { \ |
| 20 | 0xe5b58dbb, 0x7688, 0x44b4, {0x97, 0xbf, 0x5f, 0x1d, 0x4b, 0x7c, 0xc8, 0xdb } \ |
| 21 | } |
| 22 | |
| 23 | typedef struct _EFI_EAP_CONFIGURATION_PROTOCOL EFI_EAP_CONFIGURATION_PROTOCOL; |
| 24 | |
| 25 | /// |
| 26 | /// Make sure it not conflict with any real EapTypeXXX |
| 27 | /// |
| 28 | #define EFI_EAP_TYPE_ATTRIBUTE 0 |
| 29 | |
| 30 | typedef enum { |
| 31 | /// |
| 32 | /// EFI_EAP_TYPE_ATTRIBUTE |
| 33 | /// |
| 34 | EfiEapConfigEapAuthMethod, |
| 35 | EfiEapConfigEapSupportedAuthMethod, |
| 36 | /// |
| 37 | /// EapTypeIdentity |
| 38 | /// |
| 39 | EfiEapConfigIdentityString, |
| 40 | /// |
| 41 | /// EapTypeEAPTLS/EapTypePEAP |
| 42 | /// |
| 43 | EfiEapConfigEapTlsCACert, |
| 44 | EfiEapConfigEapTlsClientCert, |
| 45 | EfiEapConfigEapTlsClientPrivateKeyFile, |
| 46 | EfiEapConfigEapTlsClientPrivateKeyFilePassword, // ASCII format, Volatile |
| 47 | EfiEapConfigEapTlsCipherSuite, |
| 48 | EfiEapConfigEapTlsSupportedCipherSuite, |
| 49 | /// |
| 50 | /// EapTypeMSChapV2 |
| 51 | /// |
| 52 | EfiEapConfigEapMSChapV2Password, // UNICODE format, Volatile |
| 53 | /// |
| 54 | /// EapTypePEAP |
| 55 | /// |
| 56 | EfiEapConfigEap2ndAuthMethod, |
| 57 | /// |
| 58 | /// More... |
| 59 | /// |
| 60 | } EFI_EAP_CONFIG_DATA_TYPE; |
| 61 | |
| 62 | /// |
| 63 | /// EFI_EAP_TYPE |
| 64 | /// |
| 65 | typedef UINT8 EFI_EAP_TYPE; |
| 66 | #define EFI_EAP_TYPE_ATTRIBUTE 0 |
| 67 | #define EFI_EAP_TYPE_IDENTITY 1 |
| 68 | #define EFI_EAP_TYPE_NOTIFICATION 2 |
| 69 | #define EFI_EAP_TYPE_NAK 3 |
| 70 | #define EFI_EAP_TYPE_MD5CHALLENGE 4 |
| 71 | #define EFI_EAP_TYPE_OTP 5 |
| 72 | #define EFI_EAP_TYPE_GTC 6 |
| 73 | #define EFI_EAP_TYPE_EAPTLS 13 |
| 74 | #define EFI_EAP_TYPE_EAPSIM 18 |
| 75 | #define EFI_EAP_TYPE_TTLS 21 |
| 76 | #define EFI_EAP_TYPE_PEAP 25 |
| 77 | #define EFI_EAP_TYPE_MSCHAPV2 26 |
| 78 | #define EFI_EAP_TYPE_EAP_EXTENSION 33 |
| 79 | |
| 80 | /** |
| 81 | Set EAP configuration data. |
| 82 | |
| 83 | The SetData() function sets EAP configuration to non-volatile storage or volatile |
| 84 | storage. |
| 85 | |
| 86 | @param[in] This Pointer to the EFI_EAP_CONFIGURATION_PROTOCOL instance. |
| 87 | @param[in] EapType EAP type. |
| 88 | @param[in] DataType Configuration data type. |
| 89 | @param[in] Data Pointer to configuration data. |
| 90 | @param[in] DataSize Total size of configuration data. |
| 91 | |
| 92 | @retval EFI_SUCCESS The EAP configuration data is set successfully. |
| 93 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: |
| 94 | Data is NULL. |
| 95 | DataSize is 0. |
| 96 | @retval EFI_UNSUPPORTED The EapType or DataType is unsupported. |
| 97 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. |
| 98 | **/ |
| 99 | typedef |
| 100 | EFI_STATUS |
| 101 | (EFIAPI *EFI_EAP_CONFIGURATION_SET_DATA) ( |
| 102 | IN EFI_EAP_CONFIGURATION_PROTOCOL *This, |
| 103 | IN EFI_EAP_TYPE EapType, |
| 104 | IN EFI_EAP_CONFIG_DATA_TYPE DataType, |
| 105 | IN VOID *Data, |
| 106 | IN UINTN DataSize |
| 107 | ); |
| 108 | |
| 109 | /** |
| 110 | Get EAP configuration data. |
| 111 | |
| 112 | The GetData() function gets EAP configuration. |
| 113 | |
| 114 | @param[in] This Pointer to the EFI_EAP_CONFIGURATION_PROTOCOL instance. |
| 115 | @param[in] EapType EAP type. |
| 116 | @param[in] DataType Configuration data type. |
| 117 | @param[in, out] Data Pointer to configuration data. |
| 118 | @param[in, out] DataSize Total size of configuration data. On input, it means |
| 119 | the size of Data buffer. On output, it means the size |
| 120 | of copied Data buffer if EFI_SUCCESS, and means the |
| 121 | size of desired Data buffer if EFI_BUFFER_TOO_SMALL. |
| 122 | |
| 123 | @retval EFI_SUCCESS The EAP configuration data is got successfully. |
| 124 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: |
| 125 | Data is NULL. |
| 126 | DataSize is NULL. |
| 127 | @retval EFI_UNSUPPORTED The EapType or DataType is unsupported. |
| 128 | @retval EFI_NOT_FOUND The EAP configuration data is not found. |
| 129 | @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer. |
| 130 | **/ |
| 131 | typedef |
| 132 | EFI_STATUS |
| 133 | (EFIAPI *EFI_EAP_CONFIGURATION_GET_DATA) ( |
| 134 | IN EFI_EAP_CONFIGURATION_PROTOCOL *This, |
| 135 | IN EFI_EAP_TYPE EapType, |
| 136 | IN EFI_EAP_CONFIG_DATA_TYPE DataType, |
| 137 | IN OUT VOID *Data, |
| 138 | IN OUT UINTN *DataSize |
| 139 | ); |
| 140 | |
| 141 | /// |
| 142 | /// The EFI_EAP_CONFIGURATION_PROTOCOL |
| 143 | /// is designed to provide a way to set and get EAP configuration, such as Certificate, |
| 144 | /// private key file. |
| 145 | /// |
| 146 | struct _EFI_EAP_CONFIGURATION_PROTOCOL { |
| 147 | EFI_EAP_CONFIGURATION_SET_DATA SetData; |
| 148 | EFI_EAP_CONFIGURATION_GET_DATA GetData; |
| 149 | }; |
| 150 | |
| 151 | extern EFI_GUID gEfiEapConfigurationProtocolGuid; |
| 152 | |
| 153 | #endif |