2 * EAP peer configuration data
3 * Copyright (c) 2003-2008, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
23 * struct eap_peer_config - EAP peer configuration/credentials
25 struct eap_peer_config {
27 * identity - EAP Identity
29 * This field is used to set the real user identity or NAI (for
30 * EAP-PSK/PAX/SAKE/GPSK).
35 * identity_len - EAP Identity length
40 * anonymous_identity - Anonymous EAP Identity
42 * This field is used for unencrypted use with EAP types that support
43 * different tunnelled identity, e.g., EAP-TTLS, in order to reveal the
44 * real identity (identity field) only to the authentication server.
46 * If not set, the identity field will be used for both unencrypted and
49 u8 *anonymous_identity;
52 * anonymous_identity_len - Length of anonymous_identity
54 size_t anonymous_identity_len;
57 * password - Password string for EAP
59 * This field can include either the plaintext password (default
60 * option) or a NtPasswordHash (16-byte MD4 hash of the unicode
61 * presentation of the password) if flags field has
62 * EAP_CONFIG_FLAGS_PASSWORD_NTHASH bit set to 1. NtPasswordHash can
63 * only be used with authentication mechanism that use this hash as the
64 * starting point for operation: MSCHAP and MSCHAPv2 (EAP-MSCHAPv2,
65 * EAP-TTLS/MSCHAPv2, EAP-TTLS/MSCHAP, LEAP).
67 * In addition, this field is used to configure a pre-shared key for
68 * EAP-PSK/PAX/SAKE/GPSK. The length of the PSK must be 16 for EAP-PSK
69 * and EAP-PAX and 32 for EAP-SAKE. EAP-GPSK can use a variable length
75 * password_len - Length of password field
80 * ca_cert - File path to CA certificate file (PEM/DER)
82 * This file can have one or more trusted CA certificates. If ca_cert
83 * and ca_path are not included, server certificate will not be
84 * verified. This is insecure and a trusted CA certificate should
85 * always be configured when using EAP-TLS/TTLS/PEAP. Full path to the
86 * file should be used since working directory may change when
87 * wpa_supplicant is run in the background.
89 * Alternatively, a named configuration blob can be used by setting
90 * this to blob://blob_name.
92 * Alternatively, this can be used to only perform matching of the
93 * server certificate (SHA-256 hash of the DER encoded X.509
94 * certificate). In this case, the possible CA certificates in the
95 * server certificate chain are ignored and only the server certificate
96 * is verified. This is configured with the following format:
97 * hash:://server/sha256/cert_hash_in_hex
98 * For example: "hash://server/sha256/
99 * 5a1bc1296205e6fdbe3979728efe3920798885c1c4590b5f90f43222d239ca6a"
101 * On Windows, trusted CA certificates can be loaded from the system
102 * certificate store by setting this to cert_store://name, e.g.,
103 * ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT".
104 * Note that when running wpa_supplicant as an application, the user
105 * certificate store (My user account) is used, whereas computer store
106 * (Computer account) is used when running wpasvc as a service.
111 * ca_path - Directory path for CA certificate files (PEM)
113 * This path may contain multiple CA certificates in OpenSSL format.
114 * Common use for this is to point to system trusted CA list which is
115 * often installed into directory like /etc/ssl/certs. If configured,
116 * these certificates are added to the list of trusted CAs. ca_cert
117 * may also be included in that case, but it is not required.
122 * client_cert - File path to client certificate file (PEM/DER)
124 * This field is used with EAP method that use TLS authentication.
125 * Usually, this is only configured for EAP-TLS, even though this could
126 * in theory be used with EAP-TTLS and EAP-PEAP, too. Full path to the
127 * file should be used since working directory may change when
128 * wpa_supplicant is run in the background.
130 * Alternatively, a named configuration blob can be used by setting
131 * this to blob://blob_name.
136 * private_key - File path to client private key file (PEM/DER/PFX)
138 * When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
139 * commented out. Both the private key and certificate will be read
140 * from the PKCS#12 file in this case. Full path to the file should be
141 * used since working directory may change when wpa_supplicant is run
144 * Windows certificate store can be used by leaving client_cert out and
145 * configuring private_key in one of the following formats:
147 * cert://substring_to_match
149 * hash://certificate_thumbprint_in_hex
151 * For example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
153 * Note that when running wpa_supplicant as an application, the user
154 * certificate store (My user account) is used, whereas computer store
155 * (Computer account) is used when running wpasvc as a service.
157 * Alternatively, a named configuration blob can be used by setting
158 * this to blob://blob_name.
163 * private_key_passwd - Password for private key file
165 * If left out, this will be asked through control interface.
167 u8 *private_key_passwd;
170 * dh_file - File path to DH/DSA parameters file (in PEM format)
172 * This is an optional configuration file for setting parameters for an
173 * ephemeral DH key exchange. In most cases, the default RSA
174 * authentication does not use this configuration. However, it is
175 * possible setup RSA to use ephemeral DH key exchange. In addition,
176 * ciphers with DSA keys always use ephemeral DH keys. This can be used
177 * to achieve forward secrecy. If the file is in DSA parameters format,
178 * it will be automatically converted into DH params. Full path to the
179 * file should be used since working directory may change when
180 * wpa_supplicant is run in the background.
182 * Alternatively, a named configuration blob can be used by setting
183 * this to blob://blob_name.
188 * subject_match - Constraint for server certificate subject
190 * This substring is matched against the subject of the authentication
191 * server certificate. If this string is set, the server sertificate is
192 * only accepted if it contains this string in the subject. The subject
193 * string is in following format:
195 * /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@n.example.com
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 sertificate 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 * ca_cert2 - File path to CA certificate file (PEM/DER) (Phase 2)
220 * This file can have one or more trusted CA certificates. If ca_cert2
221 * and ca_path2 are not included, server certificate will not be
222 * verified. This is insecure and a trusted CA certificate should
223 * always be configured. Full path to the file should be used since
224 * working directory may change when wpa_supplicant is run in the
227 * This field is like ca_cert, but used for phase 2 (inside
228 * EAP-TTLS/PEAP/FAST tunnel) authentication.
230 * Alternatively, a named configuration blob can be used by setting
231 * this to blob://blob_name.
236 * ca_path2 - Directory path for CA certificate files (PEM) (Phase 2)
238 * This path may contain multiple CA certificates in OpenSSL format.
239 * Common use for this is to point to system trusted CA list which is
240 * often installed into directory like /etc/ssl/certs. If configured,
241 * these certificates are added to the list of trusted CAs. ca_cert
242 * may also be included in that case, but it is not required.
244 * This field is like ca_path, but used for phase 2 (inside
245 * EAP-TTLS/PEAP/FAST tunnel) authentication.
250 * client_cert2 - File path to client certificate file
252 * This field is like client_cert, but used for phase 2 (inside
253 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
254 * file should be used since working directory may change when
255 * wpa_supplicant is run in the background.
257 * Alternatively, a named configuration blob can be used by setting
258 * this to blob://blob_name.
263 * private_key2 - File path to client private key file
265 * This field is like private_key, but used for phase 2 (inside
266 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
267 * file should be used since working directory may change when
268 * wpa_supplicant is run in the background.
270 * Alternatively, a named configuration blob can be used by setting
271 * this to blob://blob_name.
276 * private_key2_passwd - Password for private key file
278 * This field is like private_key_passwd, but used for phase 2 (inside
279 * EAP-TTLS/PEAP/FAST tunnel) authentication.
281 u8 *private_key2_passwd;
284 * dh_file2 - File path to DH/DSA parameters file (in PEM format)
286 * This field is like dh_file, but used for phase 2 (inside
287 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
288 * file should be used since working directory may change when
289 * wpa_supplicant is run in the background.
291 * Alternatively, a named configuration blob can be used by setting
292 * this to blob://blob_name.
297 * subject_match2 - Constraint for server certificate subject
299 * This field is like subject_match, but used for phase 2 (inside
300 * EAP-TTLS/PEAP/FAST tunnel) authentication.
305 * altsubject_match2 - Constraint for server certificate alt. subject
307 * This field is like altsubject_match, but used for phase 2 (inside
308 * EAP-TTLS/PEAP/FAST tunnel) authentication.
310 u8 *altsubject_match2;
313 * eap_methods - Allowed EAP methods
315 * (vendor=EAP_VENDOR_IETF,method=EAP_TYPE_NONE) terminated list of
316 * allowed EAP methods or %NULL if all methods are accepted.
318 struct eap_method_type *eap_methods;
321 * phase1 - Phase 1 (outer authentication) parameters
323 * String with field-value pairs, e.g., "peapver=0" or
324 * "peapver=1 peaplabel=1".
326 * 'peapver' can be used to force which PEAP version (0 or 1) is used.
328 * 'peaplabel=1' can be used to force new label, "client PEAP
329 * encryption", to be used during key derivation when PEAPv1 or newer.
331 * Most existing PEAPv1 implementation seem to be using the old label,
332 * "client EAP encryption", and wpa_supplicant is now using that as the
335 * Some servers, e.g., Radiator, may require peaplabel=1 configuration
336 * to interoperate with PEAPv1; see eap_testing.txt for more details.
338 * 'peap_outer_success=0' can be used to terminate PEAP authentication
339 * on tunneled EAP-Success. This is required with some RADIUS servers
340 * that implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
341 * Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode).
343 * include_tls_length=1 can be used to force wpa_supplicant to include
344 * TLS Message Length field in all TLS messages even if they are not
347 * sim_min_num_chal=3 can be used to configure EAP-SIM to require three
348 * challenges (by default, it accepts 2 or 3).
350 * result_ind=1 can be used to enable EAP-SIM and EAP-AKA to use
351 * protected result indication.
353 * fast_provisioning option can be used to enable in-line provisioning
354 * of EAP-FAST credentials (PAC):
356 * 1 = allow unauthenticated provisioning,
357 * 2 = allow authenticated provisioning,
358 * 3 = allow both unauthenticated and authenticated provisioning
360 * fast_max_pac_list_len=num option can be used to set the maximum
361 * number of PAC entries to store in a PAC list (default: 10).
363 * fast_pac_format=binary option can be used to select binary format
364 * for storing PAC entries in order to save some space (the default
365 * text format uses about 2.5 times the size of minimal binary format).
367 * crypto_binding option can be used to control PEAPv0 cryptobinding
369 * 0 = do not use cryptobinding (default)
370 * 1 = use cryptobinding if server supports it
371 * 2 = require cryptobinding
373 * EAP-WSC (WPS) uses following options: pin=Device_Password and
379 * phase2 - Phase2 (inner authentication with TLS tunnel) parameters
381 * String with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
382 * "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS.
387 * pcsc - Parameters for PC/SC smartcard interface for USIM and GSM SIM
389 * This field is used to configure PC/SC smartcard interface.
390 * Currently, the only configuration is whether this field is %NULL (do
391 * not use PC/SC) or non-NULL (e.g., "") to enable PC/SC.
393 * This field is used for EAP-SIM and EAP-AKA.
398 * pin - PIN for USIM, GSM SIM, and smartcards
400 * This field is used to configure PIN for SIM and smartcards for
401 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
402 * smartcard is used for private key operations.
404 * If left out, this will be asked through control interface.
409 * engine - Enable OpenSSL engine (e.g., for smartcard access)
411 * This is used if private key operations for EAP-TLS are performed
417 * engine_id - Engine ID for OpenSSL engine
419 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
422 * This is used if private key operations for EAP-TLS are performed
428 * engine2 - Enable OpenSSL engine (e.g., for smartcard) (Phase 2)
430 * This is used if private key operations for EAP-TLS are performed
433 * This field is like engine, but used for phase 2 (inside
434 * EAP-TTLS/PEAP/FAST tunnel) authentication.
440 * pin2 - PIN for USIM, GSM SIM, and smartcards (Phase 2)
442 * This field is used to configure PIN for SIM and smartcards for
443 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
444 * smartcard is used for private key operations.
446 * This field is like pin2, but used for phase 2 (inside
447 * EAP-TTLS/PEAP/FAST tunnel) authentication.
449 * If left out, this will be asked through control interface.
454 * engine2_id - Engine ID for OpenSSL engine (Phase 2)
456 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
459 * This is used if private key operations for EAP-TLS are performed
462 * This field is like engine_id, but used for phase 2 (inside
463 * EAP-TTLS/PEAP/FAST tunnel) authentication.
469 * key_id - Key ID for OpenSSL engine
471 * This is used if private key operations for EAP-TLS are performed
477 * cert_id - Cert ID for OpenSSL engine
479 * This is used if the certificate operations for EAP-TLS are performed
485 * ca_cert_id - CA Cert ID for OpenSSL engine
487 * This is used if the CA certificate for EAP-TLS is on a smartcard.
492 * key2_id - Key ID for OpenSSL engine (phase2)
494 * This is used if private key operations for EAP-TLS are performed
500 * cert2_id - Cert ID for OpenSSL engine (phase2)
502 * This is used if the certificate operations for EAP-TLS are performed
508 * ca_cert2_id - CA Cert ID for OpenSSL engine (phase2)
510 * This is used if the CA certificate for EAP-TLS is on a smartcard.
515 * otp - One-time-password
517 * This field should not be set in configuration step. It is only used
518 * internally when OTP is entered through the control interface.
523 * otp_len - Length of the otp field
528 * pending_req_identity - Whether there is a pending identity request
530 * This field should not be set in configuration step. It is only used
531 * internally when control interface is used to request needed
534 int pending_req_identity;
537 * pending_req_password - Whether there is a pending password request
539 * This field should not be set in configuration step. It is only used
540 * internally when control interface is used to request needed
543 int pending_req_password;
546 * pending_req_pin - Whether there is a pending PIN request
548 * This field should not be set in configuration step. It is only used
549 * internally when control interface is used to request needed
555 * pending_req_new_password - Pending password update request
557 * This field should not be set in configuration step. It is only used
558 * internally when control interface is used to request needed
561 int pending_req_new_password;
564 * pending_req_passphrase - Pending passphrase request
566 * This field should not be set in configuration step. It is only used
567 * internally when control interface is used to request needed
570 int pending_req_passphrase;
573 * pending_req_otp - Whether there is a pending OTP request
575 * This field should not be set in configuration step. It is only used
576 * internally when control interface is used to request needed
579 char *pending_req_otp;
582 * pending_req_otp_len - Length of the pending OTP request
584 size_t pending_req_otp_len;
587 * pac_file - File path or blob name for the PAC entries (EAP-FAST)
589 * wpa_supplicant will need to be able to create this file and write
590 * updates to it when PAC is being provisioned or refreshed. Full path
591 * to the file should be used since working directory may change when
592 * wpa_supplicant is run in the background.
593 * Alternatively, a named configuration blob can be used by setting
594 * this to blob://blob_name.
599 * mschapv2_retry - MSCHAPv2 retry in progress
601 * This field is used internally by EAP-MSCHAPv2 and should not be set
602 * as part of configuration.
607 * new_password - New password for password update
609 * This field is used during MSCHAPv2 password update. This is normally
610 * requested from the user through the control interface and not set
611 * from configuration.
616 * new_password_len - Length of new_password field
618 size_t new_password_len;
621 * fragment_size - Maximum EAP fragment size in bytes (default 1398)
623 * This value limits the fragment size for EAP methods that support
624 * fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set
625 * small enough to make the EAP messages fit in MTU of the network
626 * interface used for EAPOL. The default value is suitable for most
631 #define EAP_CONFIG_FLAGS_PASSWORD_NTHASH BIT(0)
633 * flags - Network configuration flags (bitfield)
635 * This variable is used for internal flags to describe further details
636 * for the network parameters.
637 * bit 0 = password is represented as a 16-byte NtPasswordHash value
638 * instead of plaintext password
645 * struct wpa_config_blob - Named configuration blob
647 * This data structure is used to provide storage for binary objects to store
648 * abstract information like certificates and private keys inlined with the
649 * configuration data.
651 struct wpa_config_blob {
658 * data - Pointer to binary data
663 * len - Length of binary data
668 * next - Pointer to next blob in the configuration
670 struct wpa_config_blob *next;
677 #endif /* EAP_CONFIG_H */