1  /*
2   * EAP peer configuration data
3   * Copyright (c) 2003-2019, Jouni Malinen <j@w1.fi>
4   *
5   * This software may be distributed under the terms of the BSD license.
6   * See README for more details.
7   */
8  
9  #ifndef EAP_CONFIG_H
10  #define EAP_CONFIG_H
11  
12  /**
13   * struct eap_peer_cert_config - EAP peer certificate configuration/credential
14   */
15  struct eap_peer_cert_config {
16  	/**
17  	 * ca_cert - File path to CA certificate file (PEM/DER)
18  	 *
19  	 * This file can have one or more trusted CA certificates. If ca_cert
20  	 * and ca_path are not included, server certificate will not be
21  	 * verified. This is insecure and a trusted CA certificate should
22  	 * always be configured when using EAP-TLS/TTLS/PEAP. Full path to the
23  	 * file should be used since working directory may change when
24  	 * wpa_supplicant is run in the background.
25  	 *
26  	 * Alternatively, a named configuration blob can be used by setting
27  	 * this to blob://blob_name.
28  	 *
29  	 * Alternatively, this can be used to only perform matching of the
30  	 * server certificate (SHA-256 hash of the DER encoded X.509
31  	 * certificate). In this case, the possible CA certificates in the
32  	 * server certificate chain are ignored and only the server certificate
33  	 * is verified. This is configured with the following format:
34  	 * hash:://server/sha256/cert_hash_in_hex
35  	 * For example: "hash://server/sha256/
36  	 * 5a1bc1296205e6fdbe3979728efe3920798885c1c4590b5f90f43222d239ca6a"
37  	 *
38  	 * On Windows, trusted CA certificates can be loaded from the system
39  	 * certificate store by setting this to cert_store://name, e.g.,
40  	 * ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT".
41  	 * Note that when running wpa_supplicant as an application, the user
42  	 * certificate store (My user account) is used, whereas computer store
43  	 * (Computer account) is used when running wpasvc as a service.
44  	 */
45  	char *ca_cert;
46  
47  	/**
48  	 * ca_path - Directory path for CA certificate files (PEM)
49  	 *
50  	 * This path may contain multiple CA certificates in OpenSSL format.
51  	 * Common use for this is to point to system trusted CA list which is
52  	 * often installed into directory like /etc/ssl/certs. If configured,
53  	 * these certificates are added to the list of trusted CAs. ca_cert
54  	 * may also be included in that case, but it is not required.
55  	 */
56  	char *ca_path;
57  
58  	/**
59  	 * client_cert - File path to client certificate file (PEM/DER)
60  	 *
61  	 * This field is used with EAP method that use TLS authentication.
62  	 * Usually, this is only configured for EAP-TLS, even though this could
63  	 * in theory be used with EAP-TTLS and EAP-PEAP, too. Full path to the
64  	 * file should be used since working directory may change when
65  	 * wpa_supplicant is run in the background.
66  	 *
67  	 * Alternatively, a named configuration blob can be used by setting
68  	 * this to blob://blob_name.
69  	 */
70  	char *client_cert;
71  
72  	/**
73  	 * private_key - File path to client private key file (PEM/DER/PFX)
74  	 *
75  	 * When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
76  	 * commented out. Both the private key and certificate will be read
77  	 * from the PKCS#12 file in this case. Full path to the file should be
78  	 * used since working directory may change when wpa_supplicant is run
79  	 * in the background.
80  	 *
81  	 * Windows certificate store can be used by leaving client_cert out and
82  	 * configuring private_key in one of the following formats:
83  	 *
84  	 * cert://substring_to_match
85  	 *
86  	 * hash://certificate_thumbprint_in_hex
87  	 *
88  	 * For example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
89  	 *
90  	 * Note that when running wpa_supplicant as an application, the user
91  	 * certificate store (My user account) is used, whereas computer store
92  	 * (Computer account) is used when running wpasvc as a service.
93  	 *
94  	 * Alternatively, a named configuration blob can be used by setting
95  	 * this to blob://blob_name.
96  	 */
97  	char *private_key;
98  
99  	/**
100  	 * private_key_passwd - Password for private key file
101  	 *
102  	 * If left out, this will be asked through control interface.
103  	 */
104  	char *private_key_passwd;
105  
106  	/**
107  	 * subject_match - Constraint for server certificate subject
108  	 *
109  	 * This substring is matched against the subject of the authentication
110  	 * server certificate. If this string is set, the server certificate is
111  	 * only accepted if it contains this string in the subject. The subject
112  	 * string is in following format:
113  	 *
114  	 * /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@n.example.com
115  	 *
116  	 * Note: Since this is a substring match, this cannot be used securely
117  	 * to do a suffix match against a possible domain name in the CN entry.
118  	 * For such a use case, domain_suffix_match should be used instead.
119  	 */
120  	char *subject_match;
121  
122  	/**
123  	 * check_cert_subject - Constraint for server certificate subject fields
124  	 *
125  	 * If check_cert_subject is set, the value of every field will be
126  	 * checked against the DN of the subject in the authentication server
127  	 * certificate. If the values do not match, the certificate verification
128  	 * will fail, rejecting the server. This option allows wpa_supplicant to
129  	 * match every individual field in the right order against the DN of the
130  	 * subject in the server certificate.
131  	 *
132  	 * For example, check_cert_subject=C=US/O=XX/OU=ABC/OU=XYZ/CN=1234 will
133  	 * check every individual DN field of the subject in the server
134  	 * certificate. If OU=XYZ comes first in terms of the order in the
135  	 * server certificate (DN field of server certificate
136  	 * C=US/O=XX/OU=XYZ/OU=ABC/CN=1234), wpa_supplicant will reject the
137  	 * server because the order of 'OU' is not matching the specified string
138  	 * in check_cert_subject.
139  	 *
140  	 * This option also allows '*' as a wildcard. This option has some
141  	 * limitation.
142  	 * It can only be used as per the following example.
143  	 *
144  	 * For example, check_cert_subject=C=US/O=XX/OU=Production* and we have
145  	 * two servers and DN of the subject in the first server certificate is
146  	 * (C=US/O=XX/OU=Production Unit) and DN of the subject in the second
147  	 * server is (C=US/O=XX/OU=Production Factory). In this case,
148  	 * wpa_supplicant will allow both servers because the value of 'OU'
149  	 * field in both server certificates matches 'OU' value in
150  	 * 'check_cert_subject' up to 'wildcard'.
151  	 *
152  	 * (Allow all servers, e.g., check_cert_subject=*)
153  	 */
154  	char *check_cert_subject;
155  
156  	/**
157  	 * altsubject_match - Constraint for server certificate alt. subject
158  	 *
159  	 * Semicolon separated string of entries to be matched against the
160  	 * alternative subject name of the authentication server certificate.
161  	 * If this string is set, the server certificate is only accepted if it
162  	 * contains one of the entries in an alternative subject name
163  	 * extension.
164  	 *
165  	 * altSubjectName string is in following format: TYPE:VALUE
166  	 *
167  	 * Example: EMAIL:server@example.com
168  	 * Example: DNS:server.example.com;DNS:server2.example.com
169  	 *
170  	 * Following types are supported: EMAIL, DNS, URI
171  	 */
172  	char *altsubject_match;
173  
174  	/**
175  	 * domain_suffix_match - Constraint for server domain name
176  	 *
177  	 * If set, this semicolon deliminated list of FQDNs is used as suffix
178  	 * match requirements for the server certificate in SubjectAltName
179  	 * dNSName element(s). If a matching dNSName is found against any of the
180  	 * specified values, this constraint is met. If no dNSName values are
181  	 * present, this constraint is matched against SubjectName CN using same
182  	 * suffix match comparison. Suffix match here means that the host/domain
183  	 * name is compared case-insentively one label at a time starting from
184  	 * the top-level domain and all the labels in domain_suffix_match shall
185  	 * be included in the certificate. The certificate may include
186  	 * additional sub-level labels in addition to the required labels.
187  	 *
188  	 * For example, domain_suffix_match=example.com would match
189  	 * test.example.com but would not match test-example.com. Multiple
190  	 * match options can be specified in following manner:
191  	 * example.org;example.com.
192  	 */
193  	char *domain_suffix_match;
194  
195  	/**
196  	 * domain_match - Constraint for server domain name
197  	 *
198  	 * If set, this FQDN is used as a full match requirement for the
199  	 * server certificate in SubjectAltName dNSName element(s). If a
200  	 * matching dNSName is found, this constraint is met. If no dNSName
201  	 * values are present, this constraint is matched against SubjectName CN
202  	 * using same full match comparison. This behavior is similar to
203  	 * domain_suffix_match, but has the requirement of a full match, i.e.,
204  	 * no subdomains or wildcard matches are allowed. Case-insensitive
205  	 * comparison is used, so "Example.com" matches "example.com", but would
206  	 * not match "test.Example.com".
207  	 *
208  	 * More than one match string can be provided by using semicolons to
209  	 * separate the strings (e.g., example.org;example.com). When multiple
210  	 * strings are specified, a match with any one of the values is
211  	 * considered a sufficient match for the certificate, i.e., the
212  	 * conditions are ORed together.
213  	 */
214  	char *domain_match;
215  
216  	/**
217  	 * pin - PIN for USIM, GSM SIM, and smartcards
218  	 *
219  	 * This field is used to configure PIN for SIM and smartcards for
220  	 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
221  	 * smartcard is used for private key operations.
222  	 *
223  	 * If left out, this will be asked through control interface.
224  	 */
225  	char *pin;
226  
227  	/**
228  	 * engine - Enable OpenSSL engine (e.g., for smartcard access)
229  	 *
230  	 * This is used if private key operations for EAP-TLS are performed
231  	 * using a smartcard.
232  	 */
233  	int engine;
234  
235  	/**
236  	 * engine_id - Engine ID for OpenSSL engine
237  	 *
238  	 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
239  	 * engine.
240  	 *
241  	 * This is used if private key operations for EAP-TLS are performed
242  	 * using a smartcard.
243  	 */
244  	char *engine_id;
245  
246  
247  	/**
248  	 * key_id - Key ID for OpenSSL engine
249  	 *
250  	 * This is used if private key operations for EAP-TLS are performed
251  	 * using a smartcard.
252  	 */
253  	char *key_id;
254  
255  	/**
256  	 * cert_id - Cert ID for OpenSSL engine
257  	 *
258  	 * This is used if the certificate operations for EAP-TLS are performed
259  	 * using a smartcard.
260  	 */
261  	char *cert_id;
262  
263  	/**
264  	 * ca_cert_id - CA Cert ID for OpenSSL engine
265  	 *
266  	 * This is used if the CA certificate for EAP-TLS is on a smartcard.
267  	 */
268  	char *ca_cert_id;
269  
270  	/**
271  	 * ocsp - Whether to use/require OCSP to check server certificate
272  	 *
273  	 * 0 = do not use OCSP stapling (TLS certificate status extension)
274  	 * 1 = try to use OCSP stapling, but not require response
275  	 * 2 = require valid OCSP stapling response
276  	 */
277  	int ocsp;
278  };
279  
280  /**
281   * struct eap_peer_config - EAP peer configuration/credentials
282   */
283  struct eap_peer_config {
284  	/**
285  	 * identity - EAP Identity
286  	 *
287  	 * This field is used to set the real user identity or NAI (for
288  	 * EAP-PSK/PAX/SAKE/GPSK).
289  	 */
290  	u8 *identity;
291  
292  	/**
293  	 * identity_len - EAP Identity length
294  	 */
295  	size_t identity_len;
296  
297  	/**
298  	 * anonymous_identity -  Anonymous EAP Identity
299  	 *
300  	 * This field is used for unencrypted use with EAP types that support
301  	 * different tunnelled identity, e.g., EAP-TTLS, in order to reveal the
302  	 * real identity (identity field) only to the authentication server.
303  	 *
304  	 * If not set, the identity field will be used for both unencrypted and
305  	 * protected fields.
306  	 *
307  	 * This field can also be used with EAP-SIM/AKA/AKA' to store the
308  	 * pseudonym identity.
309  	 */
310  	u8 *anonymous_identity;
311  
312  	/**
313  	 * anonymous_identity_len - Length of anonymous_identity
314  	 */
315  	size_t anonymous_identity_len;
316  
317  	u8 *imsi_identity;
318  	size_t imsi_identity_len;
319  
320  	/**
321  	 * imsi_privacy_cert - IMSI privacy certificate
322  	 *
323  	 * This field is used with EAP-SIM/AKA/AKA' to encrypt the permanent
324  	 * identity (IMSI) to improve privacy. The referenced PEM-encoded
325  	 * X.509v3 certificate needs to include a 2048-bit RSA public key and
326  	 * this is from the operator who authenticates the SIM/USIM.
327  	 */
328  	char *imsi_privacy_cert;
329  
330  	/**
331  	 * imsi_privacy_attr - IMSI privacy attribute
332  	 *
333  	 * This field is used to help the EAP-SIM/AKA/AKA' server to identify
334  	 * the used certificate (and as such, the matching private key). This
335  	 * is set to an attribute in name=value format if the operator needs
336  	 * this information.
337  	 */
338  	char *imsi_privacy_attr;
339  
340  	/**
341  	 * machine_identity - EAP Identity for machine credential
342  	 *
343  	 * This field is used to set the machine identity or NAI for cases where
344  	 * and explicit machine credential (instead of or in addition to a user
345  	 * credential (from %identity) is needed.
346  	 */
347  	u8 *machine_identity;
348  
349  	/**
350  	 * machine_identity_len - EAP Identity length for machine credential
351  	 */
352  	size_t machine_identity_len;
353  
354  	/**
355  	 * password - Password string for EAP
356  	 *
357  	 * This field can include either the plaintext password (default
358  	 * option) or a NtPasswordHash (16-byte MD4 hash of the unicode
359  	 * presentation of the password) if flags field has
360  	 * EAP_CONFIG_FLAGS_PASSWORD_NTHASH bit set to 1. NtPasswordHash can
361  	 * only be used with authentication mechanism that use this hash as the
362  	 * starting point for operation: MSCHAP and MSCHAPv2 (EAP-MSCHAPv2,
363  	 * EAP-TTLS/MSCHAPv2, EAP-TTLS/MSCHAP, LEAP).
364  	 *
365  	 * In addition, this field is used to configure a pre-shared key for
366  	 * EAP-PSK/PAX/SAKE/GPSK. The length of the PSK must be 16 for EAP-PSK
367  	 * and EAP-PAX and 32 for EAP-SAKE. EAP-GPSK can use a variable length
368  	 * PSK.
369  	 */
370  	u8 *password;
371  
372  	/**
373  	 * password_len - Length of password field
374  	 */
375  	size_t password_len;
376  
377  	/**
378  	 * machine_password - Password string for EAP machine credential
379  	 *
380  	 * This field is used when machine credential based on username/password
381  	 * is needed instead of a user credential (from %password). See
382  	 * %password for more details on the format.
383  	 */
384  	u8 *machine_password;
385  
386  	/**
387  	 * machine_password_len - Length of machine credential password field
388  	 */
389  	size_t machine_password_len;
390  
391  	/**
392  	 * cert - Certificate parameters for Phase 1
393  	 */
394  	struct eap_peer_cert_config cert;
395  
396  	/**
397  	 * phase2_cert - Certificate parameters for Phase 2
398  	 *
399  	 * This is like cert, but used for Phase 2 (inside
400  	 * EAP-TTLS/PEAP/FAST/TEAP tunnel) authentication.
401  	 */
402  	struct eap_peer_cert_config phase2_cert;
403  
404  	/**
405  	 * machine_cert - Certificate parameters for Phase 2 machine credential
406  	 *
407  	 * This is like cert, but used for Phase 2 (inside EAP-TEAP tunnel)
408  	 * authentication with machine credentials (while phase2_cert is used
409  	 * for user credentials).
410  	 */
411  	struct eap_peer_cert_config machine_cert;
412  
413  	/**
414  	 * eap_methods - Allowed EAP methods
415  	 *
416  	 * (vendor=EAP_VENDOR_IETF,method=EAP_TYPE_NONE) terminated list of
417  	 * allowed EAP methods or %NULL if all methods are accepted.
418  	 */
419  	struct eap_method_type *eap_methods;
420  
421  	/**
422  	 * phase1 - Phase 1 (outer authentication) parameters
423  	 *
424  	 * String with field-value pairs, e.g., "peapver=0" or
425  	 * "peapver=1 peaplabel=1".
426  	 *
427  	 * 'peapver' can be used to force which PEAP version (0 or 1) is used.
428  	 *
429  	 * 'peaplabel=1' can be used to force new label, "client PEAP
430  	 * encryption",	to be used during key derivation when PEAPv1 or newer.
431  	 *
432  	 * Most existing PEAPv1 implementation seem to be using the old label,
433  	 * "client EAP encryption", and wpa_supplicant is now using that as the
434  	 * default value.
435  	 *
436  	 * Some servers, e.g., Radiator, may require peaplabel=1 configuration
437  	 * to interoperate with PEAPv1; see eap_testing.txt for more details.
438  	 *
439  	 * 'peap_outer_success=0' can be used to terminate PEAP authentication
440  	 * on tunneled EAP-Success. This is required with some RADIUS servers
441  	 * that implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
442  	 * Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode).
443  	 *
444  	 * include_tls_length=1 can be used to force wpa_supplicant to include
445  	 * TLS Message Length field in all TLS messages even if they are not
446  	 * fragmented.
447  	 *
448  	 * sim_min_num_chal=3 can be used to configure EAP-SIM to require three
449  	 * challenges (by default, it accepts 2 or 3).
450  	 *
451  	 * result_ind=1 can be used to enable EAP-SIM and EAP-AKA to use
452  	 * protected result indication.
453  	 *
454  	 * fast_provisioning option can be used to enable in-line provisioning
455  	 * of EAP-FAST credentials (PAC):
456  	 * 0 = disabled,
457  	 * 1 = allow unauthenticated provisioning,
458  	 * 2 = allow authenticated provisioning,
459  	 * 3 = allow both unauthenticated and authenticated provisioning
460  	 *
461  	 * fast_max_pac_list_len=num option can be used to set the maximum
462  	 * number of PAC entries to store in a PAC list (default: 10).
463  	 *
464  	 * fast_pac_format=binary option can be used to select binary format
465  	 * for storing PAC entries in order to save some space (the default
466  	 * text format uses about 2.5 times the size of minimal binary format).
467  	 *
468  	 * crypto_binding option can be used to control PEAPv0 cryptobinding
469  	 * behavior:
470  	 * 0 = do not use cryptobinding (default)
471  	 * 1 = use cryptobinding if server supports it
472  	 * 2 = require cryptobinding
473  	 *
474  	 * phase2_auth option can be used to control Phase 2 (i.e., within TLS
475  	 * tunnel) behavior for PEAP:
476  	 * 0 = do not require Phase 2 authentication
477  	 * 1 = require Phase 2 authentication when client certificate
478  	 *  (private_key/client_cert) is no used and TLS session resumption was
479  	 *  not used (default)
480  	 * 2 = require Phase 2 authentication in all cases
481  	 *
482  	 * EAP-WSC (WPS) uses following options: pin=Device_Password and
483  	 * uuid=Device_UUID
484  	 *
485  	 * For wired IEEE 802.1X authentication, "allow_canned_success=1" can be
486  	 * used to configure a mode that allows EAP-Success (and EAP-Failure)
487  	 * without going through authentication step. Some switches use such
488  	 * sequence when forcing the port to be authorized/unauthorized or as a
489  	 * fallback option if the authentication server is unreachable. By
490  	 * default, wpa_supplicant discards such frames to protect against
491  	 * potential attacks by rogue devices, but this option can be used to
492  	 * disable that protection for cases where the server/authenticator does
493  	 * not need to be authenticated.
494  	 */
495  	char *phase1;
496  
497  	/**
498  	 * phase2 - Phase2 (inner authentication with TLS tunnel) parameters
499  	 *
500  	 * String with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
501  	 * "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS. "mschapv2_retry=0" can
502  	 * be used to disable MSCHAPv2 password retry in authentication failure
503  	 * cases.
504  	 */
505  	char *phase2;
506  
507  	/**
508  	 * machine_phase2 - Phase2 parameters for machine credentials
509  	 *
510  	 * See phase2 for more details.
511  	 */
512  	char *machine_phase2;
513  
514  	/**
515  	 * pcsc - Parameters for PC/SC smartcard interface for USIM and GSM SIM
516  	 *
517  	 * This field is used to configure PC/SC smartcard interface.
518  	 * Currently, the only configuration is whether this field is %NULL (do
519  	 * not use PC/SC) or non-NULL (e.g., "") to enable PC/SC.
520  	 *
521  	 * This field is used for EAP-SIM and EAP-AKA.
522  	 */
523  	char *pcsc;
524  
525  	/**
526  	 * otp - One-time-password
527  	 *
528  	 * This field should not be set in configuration step. It is only used
529  	 * internally when OTP is entered through the control interface.
530  	 */
531  	u8 *otp;
532  
533  	/**
534  	 * otp_len - Length of the otp field
535  	 */
536  	size_t otp_len;
537  
538  	/**
539  	 * pending_req_identity - Whether there is a pending identity request
540  	 *
541  	 * This field should not be set in configuration step. It is only used
542  	 * internally when control interface is used to request needed
543  	 * information.
544  	 */
545  	int pending_req_identity;
546  
547  	/**
548  	 * pending_req_password - Whether there is a pending password request
549  	 *
550  	 * This field should not be set in configuration step. It is only used
551  	 * internally when control interface is used to request needed
552  	 * information.
553  	 */
554  	int pending_req_password;
555  
556  	/**
557  	 * pending_req_pin - Whether there is a pending PIN request
558  	 *
559  	 * This field should not be set in configuration step. It is only used
560  	 * internally when control interface is used to request needed
561  	 * information.
562  	 */
563  	int pending_req_pin;
564  
565  	/**
566  	 * pending_req_new_password - Pending password update request
567  	 *
568  	 * This field should not be set in configuration step. It is only used
569  	 * internally when control interface is used to request needed
570  	 * information.
571  	 */
572  	int pending_req_new_password;
573  
574  	/**
575  	 * pending_req_passphrase - Pending passphrase request
576  	 *
577  	 * This field should not be set in configuration step. It is only used
578  	 * internally when control interface is used to request needed
579  	 * information.
580  	 */
581  	int pending_req_passphrase;
582  
583  	/**
584  	 * pending_req_sim - Pending SIM request
585  	 *
586  	 * This field should not be set in configuration step. It is only used
587  	 * internally when control interface is used to request needed
588  	 * information.
589  	 */
590  	int pending_req_sim;
591  
592  	/**
593  	 * pending_req_otp - Whether there is a pending OTP request
594  	 *
595  	 * This field should not be set in configuration step. It is only used
596  	 * internally when control interface is used to request needed
597  	 * information.
598  	 */
599  	char *pending_req_otp;
600  
601  	/**
602  	 * pending_req_otp_len - Length of the pending OTP request
603  	 */
604  	size_t pending_req_otp_len;
605  
606  	/**
607  	 * pac_file - File path or blob name for the PAC entries (EAP-FAST)
608  	 *
609  	 * wpa_supplicant will need to be able to create this file and write
610  	 * updates to it when PAC is being provisioned or refreshed. Full path
611  	 * to the file should be used since working directory may change when
612  	 * wpa_supplicant is run in the background.
613  	 * Alternatively, a named configuration blob can be used by setting
614  	 * this to blob://blob_name.
615  	 */
616  	char *pac_file;
617  
618  	/**
619  	 * mschapv2_retry - MSCHAPv2 retry in progress
620  	 *
621  	 * This field is used internally by EAP-MSCHAPv2 and should not be set
622  	 * as part of configuration.
623  	 */
624  	int mschapv2_retry;
625  
626  	/**
627  	 * new_password - New password for password update
628  	 *
629  	 * This field is used during MSCHAPv2 password update. This is normally
630  	 * requested from the user through the control interface and not set
631  	 * from configuration.
632  	 */
633  	u8 *new_password;
634  
635  	/**
636  	 * new_password_len - Length of new_password field
637  	 */
638  	size_t new_password_len;
639  
640  	/**
641  	 * fragment_size - Maximum EAP fragment size in bytes (default 1398)
642  	 *
643  	 * This value limits the fragment size for EAP methods that support
644  	 * fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set
645  	 * small enough to make the EAP messages fit in MTU of the network
646  	 * interface used for EAPOL. The default value is suitable for most
647  	 * cases.
648  	 */
649  	int fragment_size;
650  
651  #define EAP_CONFIG_FLAGS_PASSWORD_NTHASH BIT(0)
652  #define EAP_CONFIG_FLAGS_EXT_PASSWORD BIT(1)
653  #define EAP_CONFIG_FLAGS_MACHINE_PASSWORD_NTHASH BIT(2)
654  #define EAP_CONFIG_FLAGS_EXT_MACHINE_PASSWORD BIT(3)
655  	/**
656  	 * flags - Network configuration flags (bitfield)
657  	 *
658  	 * This variable is used for internal flags to describe further details
659  	 * for the network parameters.
660  	 * bit 0 = password is represented as a 16-byte NtPasswordHash value
661  	 *         instead of plaintext password
662  	 * bit 1 = password is stored in external storage; the value in the
663  	 *         password field is the name of that external entry
664  	 * bit 2 = machine password is represented as a 16-byte NtPasswordHash
665  	 *         value instead of plaintext password
666  	 * bit 3 = machine password is stored in external storage; the value in
667  	 *         the password field is the name of that external entry
668  	 */
669  	u32 flags;
670  
671  	/**
672  	 * external_sim_resp - Response from external SIM processing
673  	 *
674  	 * This field should not be set in configuration step. It is only used
675  	 * internally when control interface is used to request external
676  	 * SIM/USIM processing.
677  	 */
678  	char *external_sim_resp;
679  
680  	/**
681  	 * sim_num - User selected SIM identifier
682  	 *
683  	 * This variable is used for identifying which SIM is used if the system
684  	 * has more than one.
685  	 */
686  	int sim_num;
687  
688  	/**
689  	 * openssl_ciphers - OpenSSL cipher string
690  	 *
691  	 * This is an OpenSSL specific configuration option for configuring the
692  	 * ciphers for this connection. If not set, the default cipher suite
693  	 * list is used.
694  	 */
695  	char *openssl_ciphers;
696  
697  	/**
698  	 * erp - Whether EAP Re-authentication Protocol (ERP) is enabled
699  	 */
700  	int erp;
701  
702  	/**
703  	 * pending_ext_cert_check - External server certificate check status
704  	 *
705  	 * This field should not be set in configuration step. It is only used
706  	 * internally when control interface is used to request external
707  	 * validation of server certificate chain.
708  	 */
709  	enum {
710  		NO_CHECK = 0,
711  		PENDING_CHECK,
712  		EXT_CERT_CHECK_GOOD,
713  		EXT_CERT_CHECK_BAD,
714  	} pending_ext_cert_check;
715  };
716  
717  
718  /**
719   * struct wpa_config_blob - Named configuration blob
720   *
721   * This data structure is used to provide storage for binary objects to store
722   * abstract information like certificates and private keys inlined with the
723   * configuration data.
724   */
725  struct wpa_config_blob {
726  	/**
727  	 * name - Blob name
728  	 */
729  	char *name;
730  
731  	/**
732  	 * data - Pointer to binary data
733  	 */
734  	u8 *data;
735  
736  	/**
737  	 * len - Length of binary data
738  	 */
739  	size_t len;
740  
741  	/**
742  	 * next - Pointer to next blob in the configuration
743  	 */
744  	struct wpa_config_blob *next;
745  };
746  
747  #endif /* EAP_CONFIG_H */
748