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 * check_cert_subject - Constraint for server certificate subject fields
202 * If check_cert_subject is set, the value of every field will be
203 * checked against the DN of the subject in the authentication server
204 * certificate. If the values do not match, the certificate verification
205 * will fail, rejecting the server. This option allows wpa_supplicant to
206 * match every individual field in the right order against the DN of the
207 * subject in the server certificate.
209 * For example, check_cert_subject=C=US/O=XX/OU=ABC/OU=XYZ/CN=1234 will
210 * check every individual DN field of the subject in the server
211 * certificate. If OU=XYZ comes first in terms of the order in the
212 * server certificate (DN field of server certificate
213 * C=US/O=XX/OU=XYZ/OU=ABC/CN=1234), wpa_supplicant will reject the
214 * server because the order of 'OU' is not matching the specified string
215 * in check_cert_subject.
217 * This option also allows '*' as a wildcard. This option has some
219 * It can only be used as per the following example.
221 * For example, check_cert_subject=C=US/O=XX/OU=Production* and we have
222 * two servers and DN of the subject in the first server certificate is
223 * (C=US/O=XX/OU=Production Unit) and DN of the subject in the second
224 * server is (C=US/O=XX/OU=Production Factory). In this case,
225 * wpa_supplicant will allow both servers because the value of 'OU'
226 * field in both server certificates matches 'OU' value in
227 * 'check_cert_subject' up to 'wildcard'.
229 * (Allow all servers, e.g., check_cert_subject=*)
231 char *check_cert_subject;
234 * check_cert_subject2 - Constraint for server certificate subject fields
236 * This field is like check_cert_subject, but used for phase 2 (inside
237 * EAP-TTLS/PEAP/FAST tunnel) authentication.
239 char *check_cert_subject2;
242 * altsubject_match - Constraint for server certificate alt. subject
244 * Semicolon separated string of entries to be matched against the
245 * alternative subject name of the authentication server certificate.
246 * If this string is set, the server certificate is only accepted if it
247 * contains one of the entries in an alternative subject name
250 * altSubjectName string is in following format: TYPE:VALUE
252 * Example: EMAIL:server@example.com
253 * Example: DNS:server.example.com;DNS:server2.example.com
255 * Following types are supported: EMAIL, DNS, URI
257 char *altsubject_match;
260 * domain_suffix_match - Constraint for server domain name
262 * If set, this semicolon deliminated list of FQDNs is used as suffix
263 * match requirements for the server certificate in SubjectAltName
264 * dNSName element(s). If a matching dNSName is found against any of the
265 * specified values, this constraint is met. If no dNSName values are
266 * present, this constraint is matched against SubjectName CN using same
267 * suffix match comparison. Suffix match here means that the host/domain
268 * name is compared case-insentively one label at a time starting from
269 * the top-level domain and all the labels in domain_suffix_match shall
270 * be included in the certificate. The certificate may include
271 * additional sub-level labels in addition to the required labels.
273 * For example, domain_suffix_match=example.com would match
274 * test.example.com but would not match test-example.com. Multiple
275 * match options can be specified in following manner:
276 * example.org;example.com.
278 char *domain_suffix_match;
281 * domain_match - Constraint for server domain name
283 * If set, this FQDN is used as a full match requirement for the
284 * server certificate in SubjectAltName dNSName element(s). If a
285 * matching dNSName is found, this constraint is met. If no dNSName
286 * values are present, this constraint is matched against SubjectName CN
287 * using same full match comparison. This behavior is similar to
288 * domain_suffix_match, but has the requirement of a full match, i.e.,
289 * no subdomains or wildcard matches are allowed. Case-insensitive
290 * comparison is used, so "Example.com" matches "example.com", but would
291 * not match "test.Example.com".
293 * More than one match string can be provided by using semicolons to
294 * separate the strings (e.g., example.org;example.com). When multiple
295 * strings are specified, a match with any one of the values is
296 * considered a sufficient match for the certificate, i.e., the
297 * conditions are ORed together.
302 * ca_cert2 - File path to CA certificate file (PEM/DER) (Phase 2)
304 * This file can have one or more trusted CA certificates. If ca_cert2
305 * and ca_path2 are not included, server certificate will not be
306 * verified. This is insecure and a trusted CA certificate should
307 * always be configured. Full path to the file should be used since
308 * working directory may change when wpa_supplicant is run in the
311 * This field is like ca_cert, but used for phase 2 (inside
312 * EAP-TTLS/PEAP/FAST tunnel) authentication.
314 * Alternatively, a named configuration blob can be used by setting
315 * this to blob://blob_name.
320 * ca_path2 - Directory path for CA certificate files (PEM) (Phase 2)
322 * This path may contain multiple CA certificates in OpenSSL format.
323 * Common use for this is to point to system trusted CA list which is
324 * often installed into directory like /etc/ssl/certs. If configured,
325 * these certificates are added to the list of trusted CAs. ca_cert
326 * may also be included in that case, but it is not required.
328 * This field is like ca_path, but used for phase 2 (inside
329 * EAP-TTLS/PEAP/FAST tunnel) authentication.
334 * client_cert2 - File path to client certificate file
336 * This field is like client_cert, but used for phase 2 (inside
337 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
338 * file should be used since working directory may change when
339 * wpa_supplicant is run in the background.
341 * Alternatively, a named configuration blob can be used by setting
342 * this to blob://blob_name.
347 * private_key2 - File path to client private key file
349 * This field is like private_key, but used for phase 2 (inside
350 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
351 * file should be used since working directory may change when
352 * wpa_supplicant is run in the background.
354 * Alternatively, a named configuration blob can be used by setting
355 * this to blob://blob_name.
360 * private_key2_passwd - Password for private key file
362 * This field is like private_key_passwd, but used for phase 2 (inside
363 * EAP-TTLS/PEAP/FAST tunnel) authentication.
365 char *private_key2_passwd;
368 * dh_file2 - File path to DH/DSA parameters file (in PEM format)
370 * This field is like dh_file, but used for phase 2 (inside
371 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
372 * file should be used since working directory may change when
373 * wpa_supplicant is run in the background.
375 * Alternatively, a named configuration blob can be used by setting
376 * this to blob://blob_name.
381 * subject_match2 - Constraint for server certificate subject
383 * This field is like subject_match, but used for phase 2 (inside
384 * EAP-TTLS/PEAP/FAST tunnel) authentication.
386 char *subject_match2;
389 * altsubject_match2 - Constraint for server certificate alt. subject
391 * This field is like altsubject_match, but used for phase 2 (inside
392 * EAP-TTLS/PEAP/FAST tunnel) authentication.
394 char *altsubject_match2;
397 * domain_suffix_match2 - Constraint for server domain name
399 * This field is like domain_suffix_match, but used for phase 2 (inside
400 * EAP-TTLS/PEAP/FAST tunnel) authentication.
402 char *domain_suffix_match2;
405 * domain_match2 - Constraint for server domain name
407 * This field is like domain_match, but used for phase 2 (inside
408 * EAP-TTLS/PEAP/FAST tunnel) authentication.
413 * eap_methods - Allowed EAP methods
415 * (vendor=EAP_VENDOR_IETF,method=EAP_TYPE_NONE) terminated list of
416 * allowed EAP methods or %NULL if all methods are accepted.
418 struct eap_method_type *eap_methods;
421 * phase1 - Phase 1 (outer authentication) parameters
423 * String with field-value pairs, e.g., "peapver=0" or
424 * "peapver=1 peaplabel=1".
426 * 'peapver' can be used to force which PEAP version (0 or 1) is used.
428 * 'peaplabel=1' can be used to force new label, "client PEAP
429 * encryption", to be used during key derivation when PEAPv1 or newer.
431 * Most existing PEAPv1 implementation seem to be using the old label,
432 * "client EAP encryption", and wpa_supplicant is now using that as the
435 * Some servers, e.g., Radiator, may require peaplabel=1 configuration
436 * to interoperate with PEAPv1; see eap_testing.txt for more details.
438 * 'peap_outer_success=0' can be used to terminate PEAP authentication
439 * on tunneled EAP-Success. This is required with some RADIUS servers
440 * that implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
441 * Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode).
443 * include_tls_length=1 can be used to force wpa_supplicant to include
444 * TLS Message Length field in all TLS messages even if they are not
447 * sim_min_num_chal=3 can be used to configure EAP-SIM to require three
448 * challenges (by default, it accepts 2 or 3).
450 * result_ind=1 can be used to enable EAP-SIM and EAP-AKA to use
451 * protected result indication.
453 * fast_provisioning option can be used to enable in-line provisioning
454 * of EAP-FAST credentials (PAC):
456 * 1 = allow unauthenticated provisioning,
457 * 2 = allow authenticated provisioning,
458 * 3 = allow both unauthenticated and authenticated provisioning
460 * fast_max_pac_list_len=num option can be used to set the maximum
461 * number of PAC entries to store in a PAC list (default: 10).
463 * fast_pac_format=binary option can be used to select binary format
464 * for storing PAC entries in order to save some space (the default
465 * text format uses about 2.5 times the size of minimal binary format).
467 * crypto_binding option can be used to control PEAPv0 cryptobinding
469 * 0 = do not use cryptobinding (default)
470 * 1 = use cryptobinding if server supports it
471 * 2 = require cryptobinding
473 * EAP-WSC (WPS) uses following options: pin=Device_Password and
476 * For wired IEEE 802.1X authentication, "allow_canned_success=1" can be
477 * used to configure a mode that allows EAP-Success (and EAP-Failure)
478 * without going through authentication step. Some switches use such
479 * sequence when forcing the port to be authorized/unauthorized or as a
480 * fallback option if the authentication server is unreachable. By
481 * default, wpa_supplicant discards such frames to protect against
482 * potential attacks by rogue devices, but this option can be used to
483 * disable that protection for cases where the server/authenticator does
484 * not need to be authenticated.
489 * phase2 - Phase2 (inner authentication with TLS tunnel) parameters
491 * String with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
492 * "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS. "mschapv2_retry=0" can
493 * be used to disable MSCHAPv2 password retry in authentication failure
499 * pcsc - Parameters for PC/SC smartcard interface for USIM and GSM SIM
501 * This field is used to configure PC/SC smartcard interface.
502 * Currently, the only configuration is whether this field is %NULL (do
503 * not use PC/SC) or non-NULL (e.g., "") to enable PC/SC.
505 * This field is used for EAP-SIM and EAP-AKA.
510 * pin - PIN for USIM, GSM SIM, and smartcards
512 * This field is used to configure PIN for SIM and smartcards for
513 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
514 * smartcard is used for private key operations.
516 * If left out, this will be asked through control interface.
521 * engine - Enable OpenSSL engine (e.g., for smartcard access)
523 * This is used if private key operations for EAP-TLS are performed
529 * engine_id - Engine ID for OpenSSL engine
531 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
534 * This is used if private key operations for EAP-TLS are performed
540 * engine2 - Enable OpenSSL engine (e.g., for smartcard) (Phase 2)
542 * This is used if private key operations for EAP-TLS are performed
545 * This field is like engine, but used for phase 2 (inside
546 * EAP-TTLS/PEAP/FAST tunnel) authentication.
552 * pin2 - PIN for USIM, GSM SIM, and smartcards (Phase 2)
554 * This field is used to configure PIN for SIM and smartcards for
555 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
556 * smartcard is used for private key operations.
558 * This field is like pin2, but used for phase 2 (inside
559 * EAP-TTLS/PEAP/FAST tunnel) authentication.
561 * If left out, this will be asked through control interface.
566 * engine2_id - Engine ID for OpenSSL engine (Phase 2)
568 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
571 * This is used if private key operations for EAP-TLS are performed
574 * This field is like engine_id, but used for phase 2 (inside
575 * EAP-TTLS/PEAP/FAST tunnel) authentication.
581 * key_id - Key ID for OpenSSL engine
583 * This is used if private key operations for EAP-TLS are performed
589 * cert_id - Cert ID for OpenSSL engine
591 * This is used if the certificate operations for EAP-TLS are performed
597 * ca_cert_id - CA Cert ID for OpenSSL engine
599 * This is used if the CA certificate for EAP-TLS is on a smartcard.
604 * key2_id - Key ID for OpenSSL engine (phase2)
606 * This is used if private key operations for EAP-TLS are performed
612 * cert2_id - Cert ID for OpenSSL engine (phase2)
614 * This is used if the certificate operations for EAP-TLS are performed
620 * ca_cert2_id - CA Cert ID for OpenSSL engine (phase2)
622 * This is used if the CA certificate for EAP-TLS is on a smartcard.
627 * otp - One-time-password
629 * This field should not be set in configuration step. It is only used
630 * internally when OTP is entered through the control interface.
635 * otp_len - Length of the otp field
640 * pending_req_identity - Whether there is a pending identity request
642 * This field should not be set in configuration step. It is only used
643 * internally when control interface is used to request needed
646 int pending_req_identity;
649 * pending_req_password - Whether there is a pending password request
651 * This field should not be set in configuration step. It is only used
652 * internally when control interface is used to request needed
655 int pending_req_password;
658 * pending_req_pin - Whether there is a pending PIN request
660 * This field should not be set in configuration step. It is only used
661 * internally when control interface is used to request needed
667 * pending_req_new_password - Pending password update request
669 * This field should not be set in configuration step. It is only used
670 * internally when control interface is used to request needed
673 int pending_req_new_password;
676 * pending_req_passphrase - Pending passphrase request
678 * This field should not be set in configuration step. It is only used
679 * internally when control interface is used to request needed
682 int pending_req_passphrase;
685 * pending_req_sim - Pending SIM request
687 * This field should not be set in configuration step. It is only used
688 * internally when control interface is used to request needed
694 * pending_req_otp - Whether there is a pending OTP request
696 * This field should not be set in configuration step. It is only used
697 * internally when control interface is used to request needed
700 char *pending_req_otp;
703 * pending_req_otp_len - Length of the pending OTP request
705 size_t pending_req_otp_len;
708 * pac_file - File path or blob name for the PAC entries (EAP-FAST)
710 * wpa_supplicant will need to be able to create this file and write
711 * updates to it when PAC is being provisioned or refreshed. Full path
712 * to the file should be used since working directory may change when
713 * wpa_supplicant is run in the background.
714 * Alternatively, a named configuration blob can be used by setting
715 * this to blob://blob_name.
720 * mschapv2_retry - MSCHAPv2 retry in progress
722 * This field is used internally by EAP-MSCHAPv2 and should not be set
723 * as part of configuration.
728 * new_password - New password for password update
730 * This field is used during MSCHAPv2 password update. This is normally
731 * requested from the user through the control interface and not set
732 * from configuration.
737 * new_password_len - Length of new_password field
739 size_t new_password_len;
742 * fragment_size - Maximum EAP fragment size in bytes (default 1398)
744 * This value limits the fragment size for EAP methods that support
745 * fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set
746 * small enough to make the EAP messages fit in MTU of the network
747 * interface used for EAPOL. The default value is suitable for most
752 #define EAP_CONFIG_FLAGS_PASSWORD_NTHASH BIT(0)
753 #define EAP_CONFIG_FLAGS_EXT_PASSWORD BIT(1)
755 * flags - Network configuration flags (bitfield)
757 * This variable is used for internal flags to describe further details
758 * for the network parameters.
759 * bit 0 = password is represented as a 16-byte NtPasswordHash value
760 * instead of plaintext password
761 * bit 1 = password is stored in external storage; the value in the
762 * password field is the name of that external entry
767 * ocsp - Whether to use/require OCSP to check server certificate
769 * 0 = do not use OCSP stapling (TLS certificate status extension)
770 * 1 = try to use OCSP stapling, but not require response
771 * 2 = require valid OCSP stapling response
776 * external_sim_resp - Response from external SIM processing
778 * This field should not be set in configuration step. It is only used
779 * internally when control interface is used to request external
780 * SIM/USIM processing.
782 char *external_sim_resp;
785 * sim_num - User selected SIM identifier
787 * This variable is used for identifying which SIM is used if the system
793 * openssl_ciphers - OpenSSL cipher string
795 * This is an OpenSSL specific configuration option for configuring the
796 * ciphers for this connection. If not set, the default cipher suite
799 char *openssl_ciphers;
802 * erp - Whether EAP Re-authentication Protocol (ERP) is enabled
807 * pending_ext_cert_check - External server certificate check status
809 * This field should not be set in configuration step. It is only used
810 * internally when control interface is used to request external
811 * validation of server certificate chain.
818 } pending_ext_cert_check;
823 * struct wpa_config_blob - Named configuration blob
825 * This data structure is used to provide storage for binary objects to store
826 * abstract information like certificates and private keys inlined with the
827 * configuration data.
829 struct wpa_config_blob {
836 * data - Pointer to binary data
841 * len - Length of binary data
846 * next - Pointer to next blob in the configuration
848 struct wpa_config_blob *next;
851 #endif /* EAP_CONFIG_H */