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 size_t imsi_identity_len;
53 * password - Password string for EAP
55 * This field can include either the plaintext password (default
56 * option) or a NtPasswordHash (16-byte MD4 hash of the unicode
57 * presentation of the password) if flags field has
58 * EAP_CONFIG_FLAGS_PASSWORD_NTHASH bit set to 1. NtPasswordHash can
59 * only be used with authentication mechanism that use this hash as the
60 * starting point for operation: MSCHAP and MSCHAPv2 (EAP-MSCHAPv2,
61 * EAP-TTLS/MSCHAPv2, EAP-TTLS/MSCHAP, LEAP).
63 * In addition, this field is used to configure a pre-shared key for
64 * EAP-PSK/PAX/SAKE/GPSK. The length of the PSK must be 16 for EAP-PSK
65 * and EAP-PAX and 32 for EAP-SAKE. EAP-GPSK can use a variable length
71 * password_len - Length of password field
76 * ca_cert - File path to CA certificate file (PEM/DER)
78 * This file can have one or more trusted CA certificates. If ca_cert
79 * and ca_path are not included, server certificate will not be
80 * verified. This is insecure and a trusted CA certificate should
81 * always be configured when using EAP-TLS/TTLS/PEAP. Full path to the
82 * file should be used since working directory may change when
83 * wpa_supplicant is run in the background.
85 * Alternatively, a named configuration blob can be used by setting
86 * this to blob://blob_name.
88 * Alternatively, this can be used to only perform matching of the
89 * server certificate (SHA-256 hash of the DER encoded X.509
90 * certificate). In this case, the possible CA certificates in the
91 * server certificate chain are ignored and only the server certificate
92 * is verified. This is configured with the following format:
93 * hash:://server/sha256/cert_hash_in_hex
94 * For example: "hash://server/sha256/
95 * 5a1bc1296205e6fdbe3979728efe3920798885c1c4590b5f90f43222d239ca6a"
97 * On Windows, trusted CA certificates can be loaded from the system
98 * certificate store by setting this to cert_store://name, e.g.,
99 * ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT".
100 * Note that when running wpa_supplicant as an application, the user
101 * certificate store (My user account) is used, whereas computer store
102 * (Computer account) is used when running wpasvc as a service.
107 * ca_path - Directory path for CA certificate files (PEM)
109 * This path may contain multiple CA certificates in OpenSSL format.
110 * Common use for this is to point to system trusted CA list which is
111 * often installed into directory like /etc/ssl/certs. If configured,
112 * these certificates are added to the list of trusted CAs. ca_cert
113 * may also be included in that case, but it is not required.
118 * client_cert - File path to client certificate file (PEM/DER)
120 * This field is used with EAP method that use TLS authentication.
121 * Usually, this is only configured for EAP-TLS, even though this could
122 * in theory be used with EAP-TTLS and EAP-PEAP, too. Full path to the
123 * file should be used since working directory may change when
124 * wpa_supplicant is run in the background.
126 * Alternatively, a named configuration blob can be used by setting
127 * this to blob://blob_name.
132 * private_key - File path to client private key file (PEM/DER/PFX)
134 * When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
135 * commented out. Both the private key and certificate will be read
136 * from the PKCS#12 file in this case. Full path to the file should be
137 * used since working directory may change when wpa_supplicant is run
140 * Windows certificate store can be used by leaving client_cert out and
141 * configuring private_key in one of the following formats:
143 * cert://substring_to_match
145 * hash://certificate_thumbprint_in_hex
147 * For example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
149 * Note that when running wpa_supplicant as an application, the user
150 * certificate store (My user account) is used, whereas computer store
151 * (Computer account) is used when running wpasvc as a service.
153 * Alternatively, a named configuration blob can be used by setting
154 * this to blob://blob_name.
159 * private_key_passwd - Password for private key file
161 * If left out, this will be asked through control interface.
163 char *private_key_passwd;
166 * dh_file - File path to DH/DSA parameters file (in PEM format)
168 * This is an optional configuration file for setting parameters for an
169 * ephemeral DH key exchange. In most cases, the default RSA
170 * authentication does not use this configuration. However, it is
171 * possible setup RSA to use ephemeral DH key exchange. In addition,
172 * ciphers with DSA keys always use ephemeral DH keys. This can be used
173 * to achieve forward secrecy. If the file is in DSA parameters format,
174 * it will be automatically converted into DH params. Full path to the
175 * file should be used since working directory may change when
176 * wpa_supplicant is run in the background.
178 * Alternatively, a named configuration blob can be used by setting
179 * this to blob://blob_name.
184 * subject_match - Constraint for server certificate subject
186 * This substring is matched against the subject of the authentication
187 * server certificate. If this string is set, the server certificate is
188 * only accepted if it contains this string in the subject. The subject
189 * string is in following format:
191 * /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@n.example.com
193 * Note: Since this is a substring match, this cannot be used securely
194 * to do a suffix match against a possible domain name in the CN entry.
195 * For such a use case, domain_suffix_match should be used instead.
200 * altsubject_match - Constraint for server certificate alt. subject
202 * Semicolon separated string of entries to be matched against the
203 * alternative subject name of the authentication server certificate.
204 * If this string is set, the server certificate is only accepted if it
205 * contains one of the entries in an alternative subject name
208 * altSubjectName string is in following format: TYPE:VALUE
210 * Example: EMAIL:server@example.com
211 * Example: DNS:server.example.com;DNS:server2.example.com
213 * Following types are supported: EMAIL, DNS, URI
215 u8 *altsubject_match;
218 * domain_suffix_match - Constraint for server domain name
220 * If set, this FQDN is used as a suffix match requirement for the
221 * server certificate in SubjectAltName dNSName element(s). If a
222 * matching dNSName is found, this constraint is met. If no dNSName
223 * values are present, this constraint is matched against SubjectName CN
224 * using same suffix match comparison. Suffix match here means that the
225 * host/domain name is compared one label at a time starting from the
226 * top-level domain and all the labels in domain_suffix_match shall be
227 * included in the certificate. The certificate may include additional
228 * sub-level labels in addition to the required labels.
230 * For example, domain_suffix_match=example.com would match
231 * test.example.com but would not match test-example.com.
233 char *domain_suffix_match;
236 * domain_match - Constraint for server domain name
238 * If set, this FQDN is used as a full match requirement for the
239 * server certificate in SubjectAltName dNSName element(s). If a
240 * matching dNSName is found, this constraint is met. If no dNSName
241 * values are present, this constraint is matched against SubjectName CN
242 * using same full match comparison. This behavior is similar to
243 * domain_suffix_match, but has the requirement of a full match, i.e.,
244 * no subdomains or wildcard matches are allowed. Case-insensitive
245 * comparison is used, so "Example.com" matches "example.com", but would
246 * not match "test.Example.com".
251 * ca_cert2 - File path to CA certificate file (PEM/DER) (Phase 2)
253 * This file can have one or more trusted CA certificates. If ca_cert2
254 * and ca_path2 are not included, server certificate will not be
255 * verified. This is insecure and a trusted CA certificate should
256 * always be configured. Full path to the file should be used since
257 * working directory may change when wpa_supplicant is run in the
260 * This field is like ca_cert, but used for phase 2 (inside
261 * EAP-TTLS/PEAP/FAST tunnel) authentication.
263 * Alternatively, a named configuration blob can be used by setting
264 * this to blob://blob_name.
269 * ca_path2 - Directory path for CA certificate files (PEM) (Phase 2)
271 * This path may contain multiple CA certificates in OpenSSL format.
272 * Common use for this is to point to system trusted CA list which is
273 * often installed into directory like /etc/ssl/certs. If configured,
274 * these certificates are added to the list of trusted CAs. ca_cert
275 * may also be included in that case, but it is not required.
277 * This field is like ca_path, but used for phase 2 (inside
278 * EAP-TTLS/PEAP/FAST tunnel) authentication.
283 * client_cert2 - File path to client certificate file
285 * This field is like client_cert, but used for phase 2 (inside
286 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
287 * file should be used since working directory may change when
288 * wpa_supplicant is run in the background.
290 * Alternatively, a named configuration blob can be used by setting
291 * this to blob://blob_name.
296 * private_key2 - File path to client private key file
298 * This field is like private_key, but used for phase 2 (inside
299 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
300 * file should be used since working directory may change when
301 * wpa_supplicant is run in the background.
303 * Alternatively, a named configuration blob can be used by setting
304 * this to blob://blob_name.
309 * private_key2_passwd - Password for private key file
311 * This field is like private_key_passwd, but used for phase 2 (inside
312 * EAP-TTLS/PEAP/FAST tunnel) authentication.
314 char *private_key2_passwd;
317 * dh_file2 - File path to DH/DSA parameters file (in PEM format)
319 * This field is like dh_file, but used for phase 2 (inside
320 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
321 * file should be used since working directory may change when
322 * wpa_supplicant is run in the background.
324 * Alternatively, a named configuration blob can be used by setting
325 * this to blob://blob_name.
330 * subject_match2 - Constraint for server certificate subject
332 * This field is like subject_match, but used for phase 2 (inside
333 * EAP-TTLS/PEAP/FAST tunnel) authentication.
338 * altsubject_match2 - Constraint for server certificate alt. subject
340 * This field is like altsubject_match, but used for phase 2 (inside
341 * EAP-TTLS/PEAP/FAST tunnel) authentication.
343 u8 *altsubject_match2;
346 * domain_suffix_match2 - Constraint for server domain name
348 * This field is like domain_suffix_match, but used for phase 2 (inside
349 * EAP-TTLS/PEAP/FAST tunnel) authentication.
351 char *domain_suffix_match2;
354 * domain_match2 - Constraint for server domain name
356 * This field is like domain_match, but used for phase 2 (inside
357 * EAP-TTLS/PEAP/FAST tunnel) authentication.
362 * eap_methods - Allowed EAP methods
364 * (vendor=EAP_VENDOR_IETF,method=EAP_TYPE_NONE) terminated list of
365 * allowed EAP methods or %NULL if all methods are accepted.
367 struct eap_method_type *eap_methods;
370 * phase1 - Phase 1 (outer authentication) parameters
372 * String with field-value pairs, e.g., "peapver=0" or
373 * "peapver=1 peaplabel=1".
375 * 'peapver' can be used to force which PEAP version (0 or 1) is used.
377 * 'peaplabel=1' can be used to force new label, "client PEAP
378 * encryption", to be used during key derivation when PEAPv1 or newer.
380 * Most existing PEAPv1 implementation seem to be using the old label,
381 * "client EAP encryption", and wpa_supplicant is now using that as the
384 * Some servers, e.g., Radiator, may require peaplabel=1 configuration
385 * to interoperate with PEAPv1; see eap_testing.txt for more details.
387 * 'peap_outer_success=0' can be used to terminate PEAP authentication
388 * on tunneled EAP-Success. This is required with some RADIUS servers
389 * that implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
390 * Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode).
392 * include_tls_length=1 can be used to force wpa_supplicant to include
393 * TLS Message Length field in all TLS messages even if they are not
396 * sim_min_num_chal=3 can be used to configure EAP-SIM to require three
397 * challenges (by default, it accepts 2 or 3).
399 * result_ind=1 can be used to enable EAP-SIM and EAP-AKA to use
400 * protected result indication.
402 * fast_provisioning option can be used to enable in-line provisioning
403 * of EAP-FAST credentials (PAC):
405 * 1 = allow unauthenticated provisioning,
406 * 2 = allow authenticated provisioning,
407 * 3 = allow both unauthenticated and authenticated provisioning
409 * fast_max_pac_list_len=num option can be used to set the maximum
410 * number of PAC entries to store in a PAC list (default: 10).
412 * fast_pac_format=binary option can be used to select binary format
413 * for storing PAC entries in order to save some space (the default
414 * text format uses about 2.5 times the size of minimal binary format).
416 * crypto_binding option can be used to control PEAPv0 cryptobinding
418 * 0 = do not use cryptobinding (default)
419 * 1 = use cryptobinding if server supports it
420 * 2 = require cryptobinding
422 * EAP-WSC (WPS) uses following options: pin=Device_Password and
425 * For wired IEEE 802.1X authentication, "allow_canned_success=1" can be
426 * used to configure a mode that allows EAP-Success (and EAP-Failure)
427 * without going through authentication step. Some switches use such
428 * sequence when forcing the port to be authorized/unauthorized or as a
429 * fallback option if the authentication server is unreachable. By
430 * default, wpa_supplicant discards such frames to protect against
431 * potential attacks by rogue devices, but this option can be used to
432 * disable that protection for cases where the server/authenticator does
433 * not need to be authenticated.
438 * phase2 - Phase2 (inner authentication with TLS tunnel) parameters
440 * String with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
441 * "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS. "mschapv2_retry=0" can
442 * be used to disable MSCHAPv2 password retry in authentication failure
448 * pcsc - Parameters for PC/SC smartcard interface for USIM and GSM SIM
450 * This field is used to configure PC/SC smartcard interface.
451 * Currently, the only configuration is whether this field is %NULL (do
452 * not use PC/SC) or non-NULL (e.g., "") to enable PC/SC.
454 * This field is used for EAP-SIM and EAP-AKA.
459 * pin - PIN for USIM, GSM SIM, and smartcards
461 * This field is used to configure PIN for SIM and smartcards for
462 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
463 * smartcard is used for private key operations.
465 * If left out, this will be asked through control interface.
470 * engine - Enable OpenSSL engine (e.g., for smartcard access)
472 * This is used if private key operations for EAP-TLS are performed
478 * engine_id - Engine ID for OpenSSL engine
480 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
483 * This is used if private key operations for EAP-TLS are performed
489 * engine2 - Enable OpenSSL engine (e.g., for smartcard) (Phase 2)
491 * This is used if private key operations for EAP-TLS are performed
494 * This field is like engine, but used for phase 2 (inside
495 * EAP-TTLS/PEAP/FAST tunnel) authentication.
501 * pin2 - PIN for USIM, GSM SIM, and smartcards (Phase 2)
503 * This field is used to configure PIN for SIM and smartcards for
504 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
505 * smartcard is used for private key operations.
507 * This field is like pin2, but used for phase 2 (inside
508 * EAP-TTLS/PEAP/FAST tunnel) authentication.
510 * If left out, this will be asked through control interface.
515 * engine2_id - Engine ID for OpenSSL engine (Phase 2)
517 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
520 * This is used if private key operations for EAP-TLS are performed
523 * This field is like engine_id, but used for phase 2 (inside
524 * EAP-TTLS/PEAP/FAST tunnel) authentication.
530 * key_id - Key ID for OpenSSL engine
532 * This is used if private key operations for EAP-TLS are performed
538 * cert_id - Cert ID for OpenSSL engine
540 * This is used if the certificate operations for EAP-TLS are performed
546 * ca_cert_id - CA Cert ID for OpenSSL engine
548 * This is used if the CA certificate for EAP-TLS is on a smartcard.
553 * key2_id - Key ID for OpenSSL engine (phase2)
555 * This is used if private key operations for EAP-TLS are performed
561 * cert2_id - Cert ID for OpenSSL engine (phase2)
563 * This is used if the certificate operations for EAP-TLS are performed
569 * ca_cert2_id - CA Cert ID for OpenSSL engine (phase2)
571 * This is used if the CA certificate for EAP-TLS is on a smartcard.
576 * otp - One-time-password
578 * This field should not be set in configuration step. It is only used
579 * internally when OTP is entered through the control interface.
584 * otp_len - Length of the otp field
589 * pending_req_identity - Whether there is a pending identity request
591 * This field should not be set in configuration step. It is only used
592 * internally when control interface is used to request needed
595 int pending_req_identity;
598 * pending_req_password - Whether there is a pending password request
600 * This field should not be set in configuration step. It is only used
601 * internally when control interface is used to request needed
604 int pending_req_password;
607 * pending_req_pin - Whether there is a pending PIN request
609 * This field should not be set in configuration step. It is only used
610 * internally when control interface is used to request needed
616 * pending_req_new_password - Pending password update request
618 * This field should not be set in configuration step. It is only used
619 * internally when control interface is used to request needed
622 int pending_req_new_password;
625 * pending_req_passphrase - Pending passphrase request
627 * This field should not be set in configuration step. It is only used
628 * internally when control interface is used to request needed
631 int pending_req_passphrase;
634 * pending_req_sim - Pending SIM request
636 * This field should not be set in configuration step. It is only used
637 * internally when control interface is used to request needed
643 * pending_req_otp - Whether there is a pending OTP request
645 * This field should not be set in configuration step. It is only used
646 * internally when control interface is used to request needed
649 char *pending_req_otp;
652 * pending_req_otp_len - Length of the pending OTP request
654 size_t pending_req_otp_len;
657 * pac_file - File path or blob name for the PAC entries (EAP-FAST)
659 * wpa_supplicant will need to be able to create this file and write
660 * updates to it when PAC is being provisioned or refreshed. Full path
661 * to the file should be used since working directory may change when
662 * wpa_supplicant is run in the background.
663 * Alternatively, a named configuration blob can be used by setting
664 * this to blob://blob_name.
669 * mschapv2_retry - MSCHAPv2 retry in progress
671 * This field is used internally by EAP-MSCHAPv2 and should not be set
672 * as part of configuration.
677 * new_password - New password for password update
679 * This field is used during MSCHAPv2 password update. This is normally
680 * requested from the user through the control interface and not set
681 * from configuration.
686 * new_password_len - Length of new_password field
688 size_t new_password_len;
691 * fragment_size - Maximum EAP fragment size in bytes (default 1398)
693 * This value limits the fragment size for EAP methods that support
694 * fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set
695 * small enough to make the EAP messages fit in MTU of the network
696 * interface used for EAPOL. The default value is suitable for most
701 #define EAP_CONFIG_FLAGS_PASSWORD_NTHASH BIT(0)
702 #define EAP_CONFIG_FLAGS_EXT_PASSWORD BIT(1)
704 * flags - Network configuration flags (bitfield)
706 * This variable is used for internal flags to describe further details
707 * for the network parameters.
708 * bit 0 = password is represented as a 16-byte NtPasswordHash value
709 * instead of plaintext password
710 * bit 1 = password is stored in external storage; the value in the
711 * password field is the name of that external entry
716 * ocsp - Whether to use/require OCSP to check server certificate
718 * 0 = do not use OCSP stapling (TLS certificate status extension)
719 * 1 = try to use OCSP stapling, but not require response
720 * 2 = require valid OCSP stapling response
725 * external_sim_resp - Response from external SIM processing
727 * This field should not be set in configuration step. It is only used
728 * internally when control interface is used to request external
729 * SIM/USIM processing.
731 char *external_sim_resp;
734 * sim_num - User selected SIM identifier
736 * This variable is used for identifying which SIM is used if the system
742 * openssl_ciphers - OpenSSL cipher string
744 * This is an OpenSSL specific configuration option for configuring the
745 * ciphers for this connection. If not set, the default cipher suite
748 char *openssl_ciphers;
751 * erp - Whether EAP Re-authentication Protocol (ERP) is enabled
756 * pending_ext_cert_check - External server certificate check status
758 * This field should not be set in configuration step. It is only used
759 * internally when control interface is used to request external
760 * validation of server certificate chain.
767 } pending_ext_cert_check;
772 * struct wpa_config_blob - Named configuration blob
774 * This data structure is used to provide storage for binary objects to store
775 * abstract information like certificates and private keys inlined with the
776 * configuration data.
778 struct wpa_config_blob {
785 * data - Pointer to binary data
790 * len - Length of binary data
795 * next - Pointer to next blob in the configuration
797 struct wpa_config_blob *next;
800 #endif /* EAP_CONFIG_H */