2 * EAP peer configuration data
3 * Copyright (c) 2003-2013, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
13 * struct eap_peer_config - EAP peer configuration/credentials
15 struct eap_peer_config {
17 * identity - EAP Identity
19 * This field is used to set the real user identity or NAI (for
20 * EAP-PSK/PAX/SAKE/GPSK).
25 * identity_len - EAP Identity length
30 * anonymous_identity - Anonymous EAP Identity
32 * This field is used for unencrypted use with EAP types that support
33 * different tunnelled identity, e.g., EAP-TTLS, in order to reveal the
34 * real identity (identity field) only to the authentication server.
36 * If not set, the identity field will be used for both unencrypted and
39 * This field can also be used with EAP-SIM/AKA/AKA' to store the
42 u8 *anonymous_identity;
45 * anonymous_identity_len - Length of anonymous_identity
47 size_t anonymous_identity_len;
50 * password - Password string for EAP
52 * This field can include either the plaintext password (default
53 * option) or a NtPasswordHash (16-byte MD4 hash of the unicode
54 * presentation of the password) if flags field has
55 * EAP_CONFIG_FLAGS_PASSWORD_NTHASH bit set to 1. NtPasswordHash can
56 * only be used with authentication mechanism that use this hash as the
57 * starting point for operation: MSCHAP and MSCHAPv2 (EAP-MSCHAPv2,
58 * EAP-TTLS/MSCHAPv2, EAP-TTLS/MSCHAP, LEAP).
60 * In addition, this field is used to configure a pre-shared key for
61 * EAP-PSK/PAX/SAKE/GPSK. The length of the PSK must be 16 for EAP-PSK
62 * and EAP-PAX and 32 for EAP-SAKE. EAP-GPSK can use a variable length
68 * password_len - Length of password field
73 * ca_cert - File path to CA certificate file (PEM/DER)
75 * This file can have one or more trusted CA certificates. If ca_cert
76 * and ca_path are not included, server certificate will not be
77 * verified. This is insecure and a trusted CA certificate should
78 * always be configured when using EAP-TLS/TTLS/PEAP. Full path to the
79 * file should be used since working directory may change when
80 * wpa_supplicant is run in the background.
82 * Alternatively, a named configuration blob can be used by setting
83 * this to blob://blob_name.
85 * Alternatively, this can be used to only perform matching of the
86 * server certificate (SHA-256 hash of the DER encoded X.509
87 * certificate). In this case, the possible CA certificates in the
88 * server certificate chain are ignored and only the server certificate
89 * is verified. This is configured with the following format:
90 * hash:://server/sha256/cert_hash_in_hex
91 * For example: "hash://server/sha256/
92 * 5a1bc1296205e6fdbe3979728efe3920798885c1c4590b5f90f43222d239ca6a"
94 * On Windows, trusted CA certificates can be loaded from the system
95 * certificate store by setting this to cert_store://name, e.g.,
96 * ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT".
97 * Note that when running wpa_supplicant as an application, the user
98 * certificate store (My user account) is used, whereas computer store
99 * (Computer account) is used when running wpasvc as a service.
104 * ca_path - Directory path for CA certificate files (PEM)
106 * This path may contain multiple CA certificates in OpenSSL format.
107 * Common use for this is to point to system trusted CA list which is
108 * often installed into directory like /etc/ssl/certs. If configured,
109 * these certificates are added to the list of trusted CAs. ca_cert
110 * may also be included in that case, but it is not required.
115 * client_cert - File path to client certificate file (PEM/DER)
117 * This field is used with EAP method that use TLS authentication.
118 * Usually, this is only configured for EAP-TLS, even though this could
119 * in theory be used with EAP-TTLS and EAP-PEAP, too. Full path to the
120 * file should be used since working directory may change when
121 * wpa_supplicant is run in the background.
123 * Alternatively, a named configuration blob can be used by setting
124 * this to blob://blob_name.
129 * private_key - File path to client private key file (PEM/DER/PFX)
131 * When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
132 * commented out. Both the private key and certificate will be read
133 * from the PKCS#12 file in this case. Full path to the file should be
134 * used since working directory may change when wpa_supplicant is run
137 * Windows certificate store can be used by leaving client_cert out and
138 * configuring private_key in one of the following formats:
140 * cert://substring_to_match
142 * hash://certificate_thumbprint_in_hex
144 * For example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
146 * Note that when running wpa_supplicant as an application, the user
147 * certificate store (My user account) is used, whereas computer store
148 * (Computer account) is used when running wpasvc as a service.
150 * Alternatively, a named configuration blob can be used by setting
151 * this to blob://blob_name.
156 * private_key_passwd - Password for private key file
158 * If left out, this will be asked through control interface.
160 char *private_key_passwd;
163 * dh_file - File path to DH/DSA parameters file (in PEM format)
165 * This is an optional configuration file for setting parameters for an
166 * ephemeral DH key exchange. In most cases, the default RSA
167 * authentication does not use this configuration. However, it is
168 * possible setup RSA to use ephemeral DH key exchange. In addition,
169 * ciphers with DSA keys always use ephemeral DH keys. This can be used
170 * to achieve forward secrecy. If the file is in DSA parameters format,
171 * it will be automatically converted into DH params. Full path to the
172 * file should be used since working directory may change when
173 * wpa_supplicant is run in the background.
175 * Alternatively, a named configuration blob can be used by setting
176 * this to blob://blob_name.
181 * subject_match - Constraint for server certificate subject
183 * This substring is matched against the subject of the authentication
184 * server certificate. If this string is set, the server sertificate is
185 * only accepted if it contains this string in the subject. The subject
186 * string is in following format:
188 * /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@n.example.com
190 * Note: Since this is a substring match, this cannot be used securily
191 * to do a suffix match against a possible domain name in the CN entry.
192 * For such a use case, domain_suffix_match should be used instead.
197 * altsubject_match - Constraint for server certificate alt. subject
199 * Semicolon separated string of entries to be matched against the
200 * alternative subject name of the authentication server certificate.
201 * If this string is set, the server sertificate is only accepted if it
202 * contains one of the entries in an alternative subject name
205 * altSubjectName string is in following format: TYPE:VALUE
207 * Example: EMAIL:server@example.com
208 * Example: DNS:server.example.com;DNS:server2.example.com
210 * Following types are supported: EMAIL, DNS, URI
212 u8 *altsubject_match;
215 * domain_suffix_match - Constraint for server domain name
217 * If set, this FQDN is used as a suffix match requirement for the
218 * server certificate in SubjectAltName dNSName element(s). If a
219 * matching dNSName is found, this constraint is met. If no dNSName
220 * values are present, this constraint is matched against SubjectName CN
221 * using same suffix match comparison. Suffix match here means that the
222 * host/domain name is compared one label at a time starting from the
223 * top-level domain and all the labels in domain_suffix_match shall be
224 * included in the certificate. The certificate may include additional
225 * sub-level labels in addition to the required labels.
227 * For example, domain_suffix_match=example.com would match
228 * test.example.com but would not match test-example.com.
230 char *domain_suffix_match;
233 * domain_match - Constraint for server domain name
235 * If set, this FQDN is used as a full match requirement for the
236 * server certificate in SubjectAltName dNSName element(s). If a
237 * matching dNSName is found, this constraint is met. If no dNSName
238 * values are present, this constraint is matched against SubjectName CN
239 * using same full match comparison. This behavior is similar to
240 * domain_suffix_match, but has the requirement of a full match, i.e.,
241 * no subdomains or wildcard matches are allowed. Case-insensitive
242 * comparison is used, so "Example.com" matches "example.com", but would
243 * not match "test.Example.com".
248 * ca_cert2 - File path to CA certificate file (PEM/DER) (Phase 2)
250 * This file can have one or more trusted CA certificates. If ca_cert2
251 * and ca_path2 are not included, server certificate will not be
252 * verified. This is insecure and a trusted CA certificate should
253 * always be configured. Full path to the file should be used since
254 * working directory may change when wpa_supplicant is run in the
257 * This field is like ca_cert, but used for phase 2 (inside
258 * EAP-TTLS/PEAP/FAST tunnel) authentication.
260 * Alternatively, a named configuration blob can be used by setting
261 * this to blob://blob_name.
266 * ca_path2 - Directory path for CA certificate files (PEM) (Phase 2)
268 * This path may contain multiple CA certificates in OpenSSL format.
269 * Common use for this is to point to system trusted CA list which is
270 * often installed into directory like /etc/ssl/certs. If configured,
271 * these certificates are added to the list of trusted CAs. ca_cert
272 * may also be included in that case, but it is not required.
274 * This field is like ca_path, but used for phase 2 (inside
275 * EAP-TTLS/PEAP/FAST tunnel) authentication.
280 * client_cert2 - File path to client certificate file
282 * This field is like client_cert, but used for phase 2 (inside
283 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
284 * file should be used since working directory may change when
285 * wpa_supplicant is run in the background.
287 * Alternatively, a named configuration blob can be used by setting
288 * this to blob://blob_name.
293 * private_key2 - File path to client private key file
295 * This field is like private_key, but used for phase 2 (inside
296 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
297 * file should be used since working directory may change when
298 * wpa_supplicant is run in the background.
300 * Alternatively, a named configuration blob can be used by setting
301 * this to blob://blob_name.
306 * private_key2_passwd - Password for private key file
308 * This field is like private_key_passwd, but used for phase 2 (inside
309 * EAP-TTLS/PEAP/FAST tunnel) authentication.
311 char *private_key2_passwd;
314 * dh_file2 - File path to DH/DSA parameters file (in PEM format)
316 * This field is like dh_file, but used for phase 2 (inside
317 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
318 * file should be used since working directory may change when
319 * wpa_supplicant is run in the background.
321 * Alternatively, a named configuration blob can be used by setting
322 * this to blob://blob_name.
327 * subject_match2 - Constraint for server certificate subject
329 * This field is like subject_match, but used for phase 2 (inside
330 * EAP-TTLS/PEAP/FAST tunnel) authentication.
335 * altsubject_match2 - Constraint for server certificate alt. subject
337 * This field is like altsubject_match, but used for phase 2 (inside
338 * EAP-TTLS/PEAP/FAST tunnel) authentication.
340 u8 *altsubject_match2;
343 * domain_suffix_match2 - Constraint for server domain name
345 * This field is like domain_suffix_match, but used for phase 2 (inside
346 * EAP-TTLS/PEAP/FAST tunnel) authentication.
348 char *domain_suffix_match2;
351 * domain_match2 - Constraint for server domain name
353 * This field is like domain_match, but used for phase 2 (inside
354 * EAP-TTLS/PEAP/FAST tunnel) authentication.
359 * eap_methods - Allowed EAP methods
361 * (vendor=EAP_VENDOR_IETF,method=EAP_TYPE_NONE) terminated list of
362 * allowed EAP methods or %NULL if all methods are accepted.
364 struct eap_method_type *eap_methods;
367 * phase1 - Phase 1 (outer authentication) parameters
369 * String with field-value pairs, e.g., "peapver=0" or
370 * "peapver=1 peaplabel=1".
372 * 'peapver' can be used to force which PEAP version (0 or 1) is used.
374 * 'peaplabel=1' can be used to force new label, "client PEAP
375 * encryption", to be used during key derivation when PEAPv1 or newer.
377 * Most existing PEAPv1 implementation seem to be using the old label,
378 * "client EAP encryption", and wpa_supplicant is now using that as the
381 * Some servers, e.g., Radiator, may require peaplabel=1 configuration
382 * to interoperate with PEAPv1; see eap_testing.txt for more details.
384 * 'peap_outer_success=0' can be used to terminate PEAP authentication
385 * on tunneled EAP-Success. This is required with some RADIUS servers
386 * that implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
387 * Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode).
389 * include_tls_length=1 can be used to force wpa_supplicant to include
390 * TLS Message Length field in all TLS messages even if they are not
393 * sim_min_num_chal=3 can be used to configure EAP-SIM to require three
394 * challenges (by default, it accepts 2 or 3).
396 * result_ind=1 can be used to enable EAP-SIM and EAP-AKA to use
397 * protected result indication.
399 * fast_provisioning option can be used to enable in-line provisioning
400 * of EAP-FAST credentials (PAC):
402 * 1 = allow unauthenticated provisioning,
403 * 2 = allow authenticated provisioning,
404 * 3 = allow both unauthenticated and authenticated provisioning
406 * fast_max_pac_list_len=num option can be used to set the maximum
407 * number of PAC entries to store in a PAC list (default: 10).
409 * fast_pac_format=binary option can be used to select binary format
410 * for storing PAC entries in order to save some space (the default
411 * text format uses about 2.5 times the size of minimal binary format).
413 * crypto_binding option can be used to control PEAPv0 cryptobinding
415 * 0 = do not use cryptobinding (default)
416 * 1 = use cryptobinding if server supports it
417 * 2 = require cryptobinding
419 * EAP-WSC (WPS) uses following options: pin=Device_Password and
422 * For wired IEEE 802.1X authentication, "allow_canned_success=1" can be
423 * used to configure a mode that allows EAP-Success (and EAP-Failure)
424 * without going through authentication step. Some switches use such
425 * sequence when forcing the port to be authorized/unauthorized or as a
426 * fallback option if the authentication server is unreachable. By
427 * default, wpa_supplicant discards such frames to protect against
428 * potential attacks by rogue devices, but this option can be used to
429 * disable that protection for cases where the server/authenticator does
430 * not need to be authenticated.
435 * phase2 - Phase2 (inner authentication with TLS tunnel) parameters
437 * String with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
438 * "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS. "mschapv2_retry=0" can
439 * be used to disable MSCHAPv2 password retry in authentication failure
445 * pcsc - Parameters for PC/SC smartcard interface for USIM and GSM SIM
447 * This field is used to configure PC/SC smartcard interface.
448 * Currently, the only configuration is whether this field is %NULL (do
449 * not use PC/SC) or non-NULL (e.g., "") to enable PC/SC.
451 * This field is used for EAP-SIM and EAP-AKA.
456 * pin - PIN for USIM, GSM SIM, and smartcards
458 * This field is used to configure PIN for SIM and smartcards for
459 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
460 * smartcard is used for private key operations.
462 * If left out, this will be asked through control interface.
467 * engine - Enable OpenSSL engine (e.g., for smartcard access)
469 * This is used if private key operations for EAP-TLS are performed
475 * engine_id - Engine ID for OpenSSL engine
477 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
480 * This is used if private key operations for EAP-TLS are performed
486 * engine2 - Enable OpenSSL engine (e.g., for smartcard) (Phase 2)
488 * This is used if private key operations for EAP-TLS are performed
491 * This field is like engine, but used for phase 2 (inside
492 * EAP-TTLS/PEAP/FAST tunnel) authentication.
498 * pin2 - PIN for USIM, GSM SIM, and smartcards (Phase 2)
500 * This field is used to configure PIN for SIM and smartcards for
501 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
502 * smartcard is used for private key operations.
504 * This field is like pin2, but used for phase 2 (inside
505 * EAP-TTLS/PEAP/FAST tunnel) authentication.
507 * If left out, this will be asked through control interface.
512 * engine2_id - Engine ID for OpenSSL engine (Phase 2)
514 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
517 * This is used if private key operations for EAP-TLS are performed
520 * This field is like engine_id, but used for phase 2 (inside
521 * EAP-TTLS/PEAP/FAST tunnel) authentication.
527 * key_id - Key ID for OpenSSL engine
529 * This is used if private key operations for EAP-TLS are performed
535 * cert_id - Cert ID for OpenSSL engine
537 * This is used if the certificate operations for EAP-TLS are performed
543 * ca_cert_id - CA Cert ID for OpenSSL engine
545 * This is used if the CA certificate for EAP-TLS is on a smartcard.
550 * key2_id - Key ID for OpenSSL engine (phase2)
552 * This is used if private key operations for EAP-TLS are performed
558 * cert2_id - Cert ID for OpenSSL engine (phase2)
560 * This is used if the certificate operations for EAP-TLS are performed
566 * ca_cert2_id - CA Cert ID for OpenSSL engine (phase2)
568 * This is used if the CA certificate for EAP-TLS is on a smartcard.
573 * otp - One-time-password
575 * This field should not be set in configuration step. It is only used
576 * internally when OTP is entered through the control interface.
581 * otp_len - Length of the otp field
586 * pending_req_identity - Whether there is a pending identity request
588 * This field should not be set in configuration step. It is only used
589 * internally when control interface is used to request needed
592 int pending_req_identity;
595 * pending_req_password - Whether there is a pending password request
597 * This field should not be set in configuration step. It is only used
598 * internally when control interface is used to request needed
601 int pending_req_password;
604 * pending_req_pin - Whether there is a pending PIN request
606 * This field should not be set in configuration step. It is only used
607 * internally when control interface is used to request needed
613 * pending_req_new_password - Pending password update request
615 * This field should not be set in configuration step. It is only used
616 * internally when control interface is used to request needed
619 int pending_req_new_password;
622 * pending_req_passphrase - Pending passphrase request
624 * This field should not be set in configuration step. It is only used
625 * internally when control interface is used to request needed
628 int pending_req_passphrase;
631 * pending_req_otp - Whether there is a pending OTP request
633 * This field should not be set in configuration step. It is only used
634 * internally when control interface is used to request needed
637 char *pending_req_otp;
640 * pending_req_otp_len - Length of the pending OTP request
642 size_t pending_req_otp_len;
645 * pac_file - File path or blob name for the PAC entries (EAP-FAST)
647 * wpa_supplicant will need to be able to create this file and write
648 * updates to it when PAC is being provisioned or refreshed. Full path
649 * to the file should be used since working directory may change when
650 * wpa_supplicant is run in the background.
651 * Alternatively, a named configuration blob can be used by setting
652 * this to blob://blob_name.
657 * mschapv2_retry - MSCHAPv2 retry in progress
659 * This field is used internally by EAP-MSCHAPv2 and should not be set
660 * as part of configuration.
665 * new_password - New password for password update
667 * This field is used during MSCHAPv2 password update. This is normally
668 * requested from the user through the control interface and not set
669 * from configuration.
674 * new_password_len - Length of new_password field
676 size_t new_password_len;
679 * fragment_size - Maximum EAP fragment size in bytes (default 1398)
681 * This value limits the fragment size for EAP methods that support
682 * fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set
683 * small enough to make the EAP messages fit in MTU of the network
684 * interface used for EAPOL. The default value is suitable for most
689 #define EAP_CONFIG_FLAGS_PASSWORD_NTHASH BIT(0)
690 #define EAP_CONFIG_FLAGS_EXT_PASSWORD BIT(1)
692 * flags - Network configuration flags (bitfield)
694 * This variable is used for internal flags to describe further details
695 * for the network parameters.
696 * bit 0 = password is represented as a 16-byte NtPasswordHash value
697 * instead of plaintext password
698 * bit 1 = password is stored in external storage; the value in the
699 * password field is the name of that external entry
704 * ocsp - Whether to use/require OCSP to check server certificate
706 * 0 = do not use OCSP stapling (TLS certificate status extension)
707 * 1 = try to use OCSP stapling, but not require response
708 * 2 = require valid OCSP stapling response
713 * external_sim_resp - Response from external SIM processing
715 * This field should not be set in configuration step. It is only used
716 * internally when control interface is used to request external
717 * SIM/USIM processing.
719 char *external_sim_resp;
722 * sim_num - User selected SIM identifier
724 * This variable is used for identifying which SIM is used if the system
730 * openssl_ciphers - OpenSSL cipher string
732 * This is an OpenSSL specific configuration option for configuring the
733 * ciphers for this connection. If not set, the default cipher suite
736 char *openssl_ciphers;
739 * erp - Whether EAP Re-authentication Protocol (ERP) is enabled
746 * struct wpa_config_blob - Named configuration blob
748 * This data structure is used to provide storage for binary objects to store
749 * abstract information like certificates and private keys inlined with the
750 * configuration data.
752 struct wpa_config_blob {
759 * data - Pointer to binary data
764 * len - Length of binary data
769 * next - Pointer to next blob in the configuration
771 struct wpa_config_blob *next;
774 #endif /* EAP_CONFIG_H */