2 * EAP peer configuration data
3 * Copyright (c) 2003-2008, 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 u8 *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
193 * altsubject_match - Constraint for server certificate alt. subject
195 * Semicolon separated string of entries to be matched against the
196 * alternative subject name of the authentication server certificate.
197 * If this string is set, the server sertificate is only accepted if it
198 * contains one of the entries in an alternative subject name
201 * altSubjectName string is in following format: TYPE:VALUE
203 * Example: EMAIL:server@example.com
204 * Example: DNS:server.example.com;DNS:server2.example.com
206 * Following types are supported: EMAIL, DNS, URI
208 u8 *altsubject_match;
211 * ca_cert2 - File path to CA certificate file (PEM/DER) (Phase 2)
213 * This file can have one or more trusted CA certificates. If ca_cert2
214 * and ca_path2 are not included, server certificate will not be
215 * verified. This is insecure and a trusted CA certificate should
216 * always be configured. Full path to the file should be used since
217 * working directory may change when wpa_supplicant is run in the
220 * This field is like ca_cert, but used for phase 2 (inside
221 * EAP-TTLS/PEAP/FAST tunnel) authentication.
223 * Alternatively, a named configuration blob can be used by setting
224 * this to blob://blob_name.
229 * ca_path2 - Directory path for CA certificate files (PEM) (Phase 2)
231 * This path may contain multiple CA certificates in OpenSSL format.
232 * Common use for this is to point to system trusted CA list which is
233 * often installed into directory like /etc/ssl/certs. If configured,
234 * these certificates are added to the list of trusted CAs. ca_cert
235 * may also be included in that case, but it is not required.
237 * This field is like ca_path, but used for phase 2 (inside
238 * EAP-TTLS/PEAP/FAST tunnel) authentication.
243 * client_cert2 - File path to client certificate file
245 * This field is like client_cert, but used for phase 2 (inside
246 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
247 * file should be used since working directory may change when
248 * wpa_supplicant is run in the background.
250 * Alternatively, a named configuration blob can be used by setting
251 * this to blob://blob_name.
256 * private_key2 - File path to client private key file
258 * This field is like private_key, but used for phase 2 (inside
259 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
260 * file should be used since working directory may change when
261 * wpa_supplicant is run in the background.
263 * Alternatively, a named configuration blob can be used by setting
264 * this to blob://blob_name.
269 * private_key2_passwd - Password for private key file
271 * This field is like private_key_passwd, but used for phase 2 (inside
272 * EAP-TTLS/PEAP/FAST tunnel) authentication.
274 u8 *private_key2_passwd;
277 * dh_file2 - File path to DH/DSA parameters file (in PEM format)
279 * This field is like dh_file, but used for phase 2 (inside
280 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
281 * file should be used since working directory may change when
282 * wpa_supplicant is run in the background.
284 * Alternatively, a named configuration blob can be used by setting
285 * this to blob://blob_name.
290 * subject_match2 - Constraint for server certificate subject
292 * This field is like subject_match, but used for phase 2 (inside
293 * EAP-TTLS/PEAP/FAST tunnel) authentication.
298 * altsubject_match2 - Constraint for server certificate alt. subject
300 * This field is like altsubject_match, but used for phase 2 (inside
301 * EAP-TTLS/PEAP/FAST tunnel) authentication.
303 u8 *altsubject_match2;
306 * eap_methods - Allowed EAP methods
308 * (vendor=EAP_VENDOR_IETF,method=EAP_TYPE_NONE) terminated list of
309 * allowed EAP methods or %NULL if all methods are accepted.
311 struct eap_method_type *eap_methods;
314 * phase1 - Phase 1 (outer authentication) parameters
316 * String with field-value pairs, e.g., "peapver=0" or
317 * "peapver=1 peaplabel=1".
319 * 'peapver' can be used to force which PEAP version (0 or 1) is used.
321 * 'peaplabel=1' can be used to force new label, "client PEAP
322 * encryption", to be used during key derivation when PEAPv1 or newer.
324 * Most existing PEAPv1 implementation seem to be using the old label,
325 * "client EAP encryption", and wpa_supplicant is now using that as the
328 * Some servers, e.g., Radiator, may require peaplabel=1 configuration
329 * to interoperate with PEAPv1; see eap_testing.txt for more details.
331 * 'peap_outer_success=0' can be used to terminate PEAP authentication
332 * on tunneled EAP-Success. This is required with some RADIUS servers
333 * that implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
334 * Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode).
336 * include_tls_length=1 can be used to force wpa_supplicant to include
337 * TLS Message Length field in all TLS messages even if they are not
340 * sim_min_num_chal=3 can be used to configure EAP-SIM to require three
341 * challenges (by default, it accepts 2 or 3).
343 * result_ind=1 can be used to enable EAP-SIM and EAP-AKA to use
344 * protected result indication.
346 * fast_provisioning option can be used to enable in-line provisioning
347 * of EAP-FAST credentials (PAC):
349 * 1 = allow unauthenticated provisioning,
350 * 2 = allow authenticated provisioning,
351 * 3 = allow both unauthenticated and authenticated provisioning
353 * fast_max_pac_list_len=num option can be used to set the maximum
354 * number of PAC entries to store in a PAC list (default: 10).
356 * fast_pac_format=binary option can be used to select binary format
357 * for storing PAC entries in order to save some space (the default
358 * text format uses about 2.5 times the size of minimal binary format).
360 * crypto_binding option can be used to control PEAPv0 cryptobinding
362 * 0 = do not use cryptobinding (default)
363 * 1 = use cryptobinding if server supports it
364 * 2 = require cryptobinding
366 * EAP-WSC (WPS) uses following options: pin=Device_Password and
372 * phase2 - Phase2 (inner authentication with TLS tunnel) parameters
374 * String with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
375 * "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS.
380 * pcsc - Parameters for PC/SC smartcard interface for USIM and GSM SIM
382 * This field is used to configure PC/SC smartcard interface.
383 * Currently, the only configuration is whether this field is %NULL (do
384 * not use PC/SC) or non-NULL (e.g., "") to enable PC/SC.
386 * This field is used for EAP-SIM and EAP-AKA.
391 * pin - PIN for USIM, GSM SIM, and smartcards
393 * This field is used to configure PIN for SIM and smartcards for
394 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
395 * smartcard is used for private key operations.
397 * If left out, this will be asked through control interface.
402 * engine - Enable OpenSSL engine (e.g., for smartcard access)
404 * This is used if private key operations for EAP-TLS are performed
410 * engine_id - Engine ID for OpenSSL engine
412 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
415 * This is used if private key operations for EAP-TLS are performed
421 * engine2 - Enable OpenSSL engine (e.g., for smartcard) (Phase 2)
423 * This is used if private key operations for EAP-TLS are performed
426 * This field is like engine, but used for phase 2 (inside
427 * EAP-TTLS/PEAP/FAST tunnel) authentication.
433 * pin2 - PIN for USIM, GSM SIM, and smartcards (Phase 2)
435 * This field is used to configure PIN for SIM and smartcards for
436 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
437 * smartcard is used for private key operations.
439 * This field is like pin2, but used for phase 2 (inside
440 * EAP-TTLS/PEAP/FAST tunnel) authentication.
442 * If left out, this will be asked through control interface.
447 * engine2_id - Engine ID for OpenSSL engine (Phase 2)
449 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
452 * This is used if private key operations for EAP-TLS are performed
455 * This field is like engine_id, but used for phase 2 (inside
456 * EAP-TTLS/PEAP/FAST tunnel) authentication.
462 * key_id - Key ID for OpenSSL engine
464 * This is used if private key operations for EAP-TLS are performed
470 * cert_id - Cert ID for OpenSSL engine
472 * This is used if the certificate operations for EAP-TLS are performed
478 * ca_cert_id - CA Cert ID for OpenSSL engine
480 * This is used if the CA certificate for EAP-TLS is on a smartcard.
485 * key2_id - Key ID for OpenSSL engine (phase2)
487 * This is used if private key operations for EAP-TLS are performed
493 * cert2_id - Cert ID for OpenSSL engine (phase2)
495 * This is used if the certificate operations for EAP-TLS are performed
501 * ca_cert2_id - CA Cert ID for OpenSSL engine (phase2)
503 * This is used if the CA certificate for EAP-TLS is on a smartcard.
508 * otp - One-time-password
510 * This field should not be set in configuration step. It is only used
511 * internally when OTP is entered through the control interface.
516 * otp_len - Length of the otp field
521 * pending_req_identity - Whether there is a pending identity request
523 * This field should not be set in configuration step. It is only used
524 * internally when control interface is used to request needed
527 int pending_req_identity;
530 * pending_req_password - Whether there is a pending password request
532 * This field should not be set in configuration step. It is only used
533 * internally when control interface is used to request needed
536 int pending_req_password;
539 * pending_req_pin - Whether there is a pending PIN request
541 * This field should not be set in configuration step. It is only used
542 * internally when control interface is used to request needed
548 * pending_req_new_password - Pending password update request
550 * This field should not be set in configuration step. It is only used
551 * internally when control interface is used to request needed
554 int pending_req_new_password;
557 * pending_req_passphrase - Pending passphrase request
559 * This field should not be set in configuration step. It is only used
560 * internally when control interface is used to request needed
563 int pending_req_passphrase;
566 * pending_req_otp - Whether there is a pending OTP request
568 * This field should not be set in configuration step. It is only used
569 * internally when control interface is used to request needed
572 char *pending_req_otp;
575 * pending_req_otp_len - Length of the pending OTP request
577 size_t pending_req_otp_len;
580 * pac_file - File path or blob name for the PAC entries (EAP-FAST)
582 * wpa_supplicant will need to be able to create this file and write
583 * updates to it when PAC is being provisioned or refreshed. Full path
584 * to the file should be used since working directory may change when
585 * wpa_supplicant is run in the background.
586 * Alternatively, a named configuration blob can be used by setting
587 * this to blob://blob_name.
592 * mschapv2_retry - MSCHAPv2 retry in progress
594 * This field is used internally by EAP-MSCHAPv2 and should not be set
595 * as part of configuration.
600 * new_password - New password for password update
602 * This field is used during MSCHAPv2 password update. This is normally
603 * requested from the user through the control interface and not set
604 * from configuration.
609 * new_password_len - Length of new_password field
611 size_t new_password_len;
614 * fragment_size - Maximum EAP fragment size in bytes (default 1398)
616 * This value limits the fragment size for EAP methods that support
617 * fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set
618 * small enough to make the EAP messages fit in MTU of the network
619 * interface used for EAPOL. The default value is suitable for most
624 #define EAP_CONFIG_FLAGS_PASSWORD_NTHASH BIT(0)
625 #define EAP_CONFIG_FLAGS_EXT_PASSWORD BIT(1)
627 * flags - Network configuration flags (bitfield)
629 * This variable is used for internal flags to describe further details
630 * for the network parameters.
631 * bit 0 = password is represented as a 16-byte NtPasswordHash value
632 * instead of plaintext password
633 * bit 1 = password is stored in external storage; the value in the
634 * password field is the name of that external entry
641 * struct wpa_config_blob - Named configuration blob
643 * This data structure is used to provide storage for binary objects to store
644 * abstract information like certificates and private keys inlined with the
645 * configuration data.
647 struct wpa_config_blob {
654 * data - Pointer to binary data
659 * len - Length of binary data
664 * next - Pointer to next blob in the configuration
666 struct wpa_config_blob *next;
669 #endif /* EAP_CONFIG_H */