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