26
|
1 |
/*
|
|
2 |
* Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: EAP-settings class.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
/*
|
49
|
19 |
* %version: 24 %
|
26
|
20 |
*/
|
|
21 |
|
|
22 |
#ifndef _EAP_METHOD_SETTINGS_H_
|
|
23 |
#define _EAP_METHOD_SETTINGS_H_
|
|
24 |
|
49
|
25 |
#include "eap_am_export.h"
|
|
26 |
// Start: added by script change_export_macros.sh.
|
|
27 |
#if defined(EAP_NO_EXPORT_EAP_METHOD_SETTINGS_H)
|
|
28 |
#define EAP_CLASS_VISIBILITY_EAP_METHOD_SETTINGS_H EAP_NONSHARABLE
|
|
29 |
#define EAP_FUNC_VISIBILITY_EAP_METHOD_SETTINGS_H
|
|
30 |
#define EAP_C_FUNC_VISIBILITY_EAP_METHOD_SETTINGS_H
|
|
31 |
#define EAP_FUNC_EXPORT_EAP_METHOD_SETTINGS_H
|
|
32 |
#define EAP_C_FUNC_EXPORT_EAP_METHOD_SETTINGS_H
|
|
33 |
#elif defined(EAP_EXPORT_EAP_METHOD_SETTINGS_H)
|
|
34 |
#define EAP_CLASS_VISIBILITY_EAP_METHOD_SETTINGS_H EAP_EXPORT
|
|
35 |
#define EAP_FUNC_VISIBILITY_EAP_METHOD_SETTINGS_H EAP_FUNC_EXPORT
|
|
36 |
#define EAP_C_FUNC_VISIBILITY_EAP_METHOD_SETTINGS_H EAP_C_FUNC_EXPORT
|
|
37 |
#define EAP_FUNC_EXPORT_EAP_METHOD_SETTINGS_H EAP_FUNC_EXPORT
|
|
38 |
#define EAP_C_FUNC_EXPORT_EAP_METHOD_SETTINGS_H EAP_C_FUNC_EXPORT
|
|
39 |
#else
|
|
40 |
#define EAP_CLASS_VISIBILITY_EAP_METHOD_SETTINGS_H EAP_IMPORT
|
|
41 |
#define EAP_FUNC_VISIBILITY_EAP_METHOD_SETTINGS_H EAP_FUNC_IMPORT
|
|
42 |
#define EAP_C_FUNC_VISIBILITY_EAP_METHOD_SETTINGS_H EAP_C_FUNC_IMPORT
|
|
43 |
#define EAP_FUNC_EXPORT_EAP_METHOD_SETTINGS_H
|
|
44 |
#define EAP_C_FUNC_EXPORT_EAP_METHOD_SETTINGS_H
|
|
45 |
#endif
|
|
46 |
// End: added by script change_export_macros.sh.
|
26
|
47 |
#include "eap_am_tools.h"
|
|
48 |
#include "eap_expanded_type.h"
|
|
49 |
#include "eap_variable_data.h"
|
|
50 |
#include "eap_array.h"
|
|
51 |
|
|
52 |
//-------------------------------------------------------------------------------
|
|
53 |
|
49
|
54 |
class EAP_CLASS_VISIBILITY_EAP_METHOD_SETTINGS_H eap_certificate_entry_c
|
26
|
55 |
{
|
|
56 |
|
|
57 |
private:
|
|
58 |
|
|
59 |
/// This is pointer to the tools class.
|
|
60 |
abs_eap_am_tools_c * const m_am_tools;
|
|
61 |
|
|
62 |
public:
|
|
63 |
|
|
64 |
eap_certificate_entry_c(
|
|
65 |
abs_eap_am_tools_c * const tools);
|
|
66 |
|
|
67 |
virtual ~eap_certificate_entry_c();
|
|
68 |
|
|
69 |
enum eap_certificate_type_e
|
|
70 |
{
|
|
71 |
eap_certificate_type_none,
|
|
72 |
eap_certificate_type_user,
|
|
73 |
eap_certificate_type_CA,
|
|
74 |
};
|
|
75 |
|
|
76 |
bool get_is_valid();
|
|
77 |
|
|
78 |
bool get_is_valid_data();
|
|
79 |
|
|
80 |
eap_certificate_entry_c * copy();
|
|
81 |
|
|
82 |
void trace() const;
|
|
83 |
|
|
84 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
85 |
|
|
86 |
// Specifies whether this entry describes user or CA certificate (mandatory)
|
|
87 |
eap_certificate_type_e m_CertType;
|
|
88 |
|
|
89 |
// Subject name in distinguished name ASCII form. This is optional.
|
|
90 |
// For example "/C=US/O=Some organization/CN=Some common name".
|
|
91 |
bool m_SubjectNamePresent;
|
|
92 |
eap_variable_data_c m_SubjectName;
|
|
93 |
|
|
94 |
// Issuer name in distinguished name ASCII form. This is optional.
|
|
95 |
// For example "/C=US/O=Some organization/CN=Some common name".
|
|
96 |
bool m_IssuerNamePresent;
|
|
97 |
eap_variable_data_c m_IssuerName;
|
|
98 |
|
|
99 |
// Serial number in ASCII form. This is optional.
|
|
100 |
bool m_SerialNumberPresent;
|
|
101 |
eap_variable_data_c m_SerialNumber;
|
|
102 |
|
|
103 |
// Subject key in binary form. This is mandatory.
|
|
104 |
bool m_SubjectKeyIDPresent;
|
|
105 |
eap_variable_data_c m_SubjectKeyID;
|
|
106 |
|
|
107 |
// Thumbprint in binary form. This is optional.
|
|
108 |
bool m_ThumbprintPresent;
|
|
109 |
eap_variable_data_c m_Thumbprint;
|
|
110 |
|
|
111 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
112 |
|
|
113 |
// This holds only the certificate label. This is the text UI will show.
|
|
114 |
bool m_LabelPresent;
|
|
115 |
eap_variable_data_c m_Label;
|
|
116 |
|
|
117 |
// Primary name of the certificate if any, UI uses this.
|
|
118 |
bool m_PrimaryNamePresent;
|
|
119 |
eap_variable_data_c m_PrimaryName;
|
|
120 |
|
|
121 |
// Secondary name of the certificate if any, UI uses this.
|
|
122 |
bool m_SecondaryNamePresent;
|
|
123 |
eap_variable_data_c m_SecondaryName;
|
|
124 |
|
|
125 |
// UI uses this to indicate enabled certificate.
|
|
126 |
bool m_iIsEnabledPresent;
|
|
127 |
bool m_iIsEnabled;
|
|
128 |
|
|
129 |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
130 |
};
|
|
131 |
|
|
132 |
//-------------------------------------------------------------------------------
|
|
133 |
|
49
|
134 |
class EAP_CLASS_VISIBILITY_EAP_METHOD_SETTINGS_H eap_method_values_c
|
26
|
135 |
{
|
|
136 |
|
|
137 |
private:
|
|
138 |
|
|
139 |
/// This is pointer to the tools class.
|
|
140 |
abs_eap_am_tools_c * const m_am_tools;
|
|
141 |
|
|
142 |
protected:
|
|
143 |
|
|
144 |
abs_eap_am_tools_c * get_am_tools() const;
|
|
145 |
|
|
146 |
public:
|
|
147 |
|
|
148 |
eap_method_values_c(
|
|
149 |
abs_eap_am_tools_c * const tools);
|
|
150 |
|
|
151 |
virtual ~eap_method_values_c();
|
|
152 |
|
|
153 |
bool m_is_valid;
|
|
154 |
|
|
155 |
/// Status of the operation.
|
|
156 |
eap_status_e m_completion_status;
|
|
157 |
|
|
158 |
/// Specifies the EAP-method these settings are for.
|
|
159 |
eap_type_value_e m_EAPType;
|
|
160 |
|
|
161 |
/// Specifies the index type (bearer protocol) these settings are for.
|
|
162 |
/// Values are ELan or EVpn.
|
|
163 |
u32_t m_IndexType;
|
|
164 |
|
|
165 |
/// Specifies unique index in the settings of the bearer protocol.
|
|
166 |
u32_t m_Index;
|
|
167 |
|
|
168 |
/// Use automatic Ca certificate.
|
|
169 |
bool m_UseAutomaticCACertificatePresent;
|
|
170 |
bool m_UseAutomaticCACertificate;
|
|
171 |
|
|
172 |
/// Use automatic username.
|
|
173 |
bool m_UseAutomaticUsernamePresent;
|
|
174 |
bool m_UseAutomaticUsername;
|
|
175 |
|
|
176 |
/// Use automatic realm.
|
|
177 |
bool m_UseAutomaticRealmPresent;
|
|
178 |
bool m_UseAutomaticRealm;
|
|
179 |
|
|
180 |
/// Username in ASCII format
|
|
181 |
bool m_UsernamePresent;
|
|
182 |
eap_variable_data_c m_Username_fix;
|
|
183 |
|
|
184 |
/// Get: Whether password is stored in database.
|
|
185 |
/// Set: Whether password must be cleared from database.
|
|
186 |
bool m_PasswordExistPresent;
|
|
187 |
bool m_PasswordExist;
|
|
188 |
|
|
189 |
/// Password in ASCII format
|
|
190 |
bool m_PasswordPresent;
|
|
191 |
eap_variable_data_c m_Password;
|
|
192 |
|
|
193 |
/// Realm in ASCII format
|
|
194 |
bool m_RealmPresent;
|
|
195 |
eap_variable_data_c m_Realm;
|
|
196 |
|
|
197 |
/// Use pseudonym identities in EAP-SIM/AKA
|
|
198 |
bool m_UsePseudonymsPresent;
|
|
199 |
bool m_UsePseudonyms;
|
|
200 |
|
|
201 |
/// Whether EAP-TLS/TTLS/PEAP should verify server realm
|
|
202 |
bool m_VerifyServerRealmPresent;
|
|
203 |
bool m_VerifyServerRealm;
|
|
204 |
|
|
205 |
/// Whether EAP-TLS/TTLS/PEAP should require client authentication
|
|
206 |
bool m_RequireClientAuthenticationPresent;
|
|
207 |
bool m_RequireClientAuthentication;
|
|
208 |
|
|
209 |
/// General session validity time (in minutes)
|
|
210 |
bool m_SessionValidityTimePresent;
|
|
211 |
u32_t m_SessionValidityTime;
|
|
212 |
|
|
213 |
/// An array of allowed cipher suites for EAP-TLS/TTLS/PEAP.
|
|
214 |
/// Refer to RFC2246 chapter A.5 for the values.
|
|
215 |
bool m_CipherSuitesPresent;
|
|
216 |
eap_array_c<u16_t> m_CipherSuites;
|
|
217 |
|
|
218 |
/// Which EAP-PEAP versions are allowed
|
|
219 |
bool m_PEAPVersionsPresent;
|
|
220 |
bool m_PEAPv0Allowed;
|
|
221 |
bool m_PEAPv1Allowed;
|
|
222 |
bool m_PEAPv2Allowed;
|
|
223 |
|
|
224 |
/// Array listing the allowed certificates for EAP-TLS/TTLS/PEAP.
|
|
225 |
/// Subject key ID and Certificate type are the only mandatory certificate
|
|
226 |
/// details needed at the moment.
|
|
227 |
bool m_CertificatesPresent;
|
|
228 |
eap_array_c<eap_certificate_entry_c> m_Certificates;
|
|
229 |
|
|
230 |
/// Array listing the allowed encapsulated EAP types (in priority order).
|
|
231 |
/// Use EAP type values from eap_type_value_e.
|
|
232 |
bool m_EnabledEncapsulatedEAPTypesPresent;
|
|
233 |
eap_array_c<eap_type_value_e> m_EnabledEncapsulatedEAPTypes;
|
|
234 |
|
|
235 |
/// Array listing the disabled encapsulated EAP types.
|
|
236 |
/// Use EAP type values from eap_type_value_e.
|
|
237 |
bool m_DisabledEncapsulatedEAPTypesPresent;
|
|
238 |
eap_array_c<eap_type_value_e> m_DisabledEncapsulatedEAPTypes;
|
|
239 |
|
|
240 |
/// Whether Authenticated provisioning mode allowed or not in EAP-FAST.
|
|
241 |
bool m_AuthProvModeAllowedPresent;
|
|
242 |
bool m_AuthProvModeAllowed;
|
|
243 |
|
|
244 |
/// Whether Unauthenticated provisioning mode allowed or not in EAP-FAST.
|
|
245 |
bool m_UnauthProvModeAllowedPresent;
|
|
246 |
bool m_UnauthProvModeAllowed;
|
|
247 |
|
|
248 |
/// PAC group reference in ASCII format for EAP-FAST.
|
|
249 |
bool m_PACGroupReferencePresent;
|
|
250 |
eap_variable_data_c m_PACGroupReference;
|
|
251 |
|
|
252 |
/// Whether to Warn (or Prompt) for ADHP (Authenticated Diffie-Hellman Protocol)
|
|
253 |
/// auto-provisioning when there is no PAC at all. EAP-FAST specific.
|
|
254 |
bool m_WarnADHPNoPACPresent;
|
|
255 |
bool m_WarnADHPNoPAC;
|
|
256 |
|
|
257 |
/// Whether to Warn (or Prompt) for ADHP auto-provisioning when
|
|
258 |
/// there is no PAC that matches the A-ID sent by server. EAP-FAST specific.
|
|
259 |
bool m_WarnADHPNoMatchingPACPresent;
|
|
260 |
bool m_WarnADHPNoMatchingPAC;
|
|
261 |
|
|
262 |
/// Whether to Warn (or Prompt) when client encouters a server that has provisioned
|
|
263 |
/// the client with a PAC before but is not currently selected as the default server.
|
|
264 |
/// EAP-FAST specific.
|
|
265 |
bool m_WarnNotDefaultServerPresent;
|
|
266 |
bool m_WarnNotDefaultServer;
|
|
267 |
|
|
268 |
// Array listing the active and disabled EAP types (in priority order).
|
|
269 |
// Use EAP type values from eap_type_value_e.
|
|
270 |
bool m_SelectedEAPTypesPresent;
|
|
271 |
eap_array_c<eap_type_value_e> m_active_eap_methods;
|
|
272 |
eap_array_c<eap_type_value_e> m_disabled_eap_methods;
|
|
273 |
|
|
274 |
bool m_TunnelingTypePresent;
|
|
275 |
eap_type_value_e m_TunnelingType;
|
|
276 |
|
|
277 |
bool m_DestinationIndexAndTypePresent;
|
|
278 |
u32_t m_DestinationIndexType;
|
|
279 |
u32_t m_DestinationIndex;
|
|
280 |
|
|
281 |
bool m_MethodInfoPresent;
|
|
282 |
eap_variable_data_c m_KReleaseDate;
|
|
283 |
eap_variable_data_c m_KEapTypeVersion;
|
|
284 |
eap_variable_data_c m_KManufacturer;
|
|
285 |
|
|
286 |
bool m_ButtonIdPresent; // JPH: remove this
|
|
287 |
i32_t m_ButtonId; // JPH: remove this
|
|
288 |
|
|
289 |
bool m_ShowPassWordPromptPresent;
|
|
290 |
bool m_ShowPassWordPrompt;
|
|
291 |
|
|
292 |
bool m_UseIdentityPrivacyPresent;
|
|
293 |
bool m_UseIdentityPrivacy;
|
|
294 |
|
|
295 |
};
|
|
296 |
|
|
297 |
//-------------------------------------------------------------------------------
|
|
298 |
|
49
|
299 |
class EAP_CLASS_VISIBILITY_EAP_METHOD_SETTINGS_H eap_method_settings_c
|
26
|
300 |
: public eap_method_values_c
|
|
301 |
{
|
|
302 |
public:
|
|
303 |
|
|
304 |
eap_method_settings_c(
|
|
305 |
abs_eap_am_tools_c * const tools);
|
|
306 |
|
|
307 |
eap_method_settings_c(
|
|
308 |
abs_eap_am_tools_c * const tools,
|
|
309 |
const eap_method_settings_c * const init);
|
|
310 |
|
|
311 |
virtual ~eap_method_settings_c();
|
|
312 |
|
|
313 |
void trace() const;
|
|
314 |
|
|
315 |
};
|
|
316 |
|
|
317 |
//-------------------------------------------------------------------------------
|
|
318 |
|
|
319 |
#if defined(USE_EAP_TRACE)
|
|
320 |
|
|
321 |
#define EAP_TRACE_METHOD_SETTINGS(settings) { (settings)->trace(); }
|
|
322 |
|
|
323 |
#else
|
|
324 |
|
|
325 |
#define EAP_TRACE_METHOD_SETTINGS(settings)
|
|
326 |
|
|
327 |
#endif //#if defined(USE_EAP_TRACE)
|
|
328 |
|
|
329 |
|
|
330 |
//-------------------------------------------------------------------------------
|
|
331 |
|
|
332 |
#endif //#ifndef _EAP_METHOD_SETTINGS_H_
|
|
333 |
|
|
334 |
// End of file
|