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.
22 /* http://tools.ietf.org/html/draft-ietf-emu-chbind-13#section-5.3.1 */
23 #define CHBIND_CODE_REQUEST 1
24 #define CHBIND_CODE_SUCCESS 2
25 #define CHBIND_CODE_FAILURE 3
26 /* http://tools.ietf.org/html/draft-ietf-emu-chbind-13#section-5.3. */
27 #define CHBIND_NSID_RADIUS 1
29 struct eap_peer_chbind_config
31 /* namespace id for this channel binding info */
34 /* data to be sent in channel binding request */
39 /* lower level callback invoked when response is received */
40 void (*response_cb)(void *ctx, int code, int nsid, u8 *resp_data, size_t resp_data_len);
42 /* context for response callback */
47 * struct eap_peer_config - EAP peer configuration/credentials
49 struct eap_peer_config {
51 * identity - EAP Identity
53 * This field is used to set the real user identity or NAI (for
54 * EAP-PSK/PAX/SAKE/GPSK).
59 * identity_len - EAP Identity length
64 * anonymous_identity - Anonymous EAP Identity
66 * This field is used for unencrypted use with EAP types that support
67 * different tunnelled identity, e.g., EAP-TTLS, in order to reveal the
68 * real identity (identity field) only to the authentication server.
70 * If not set, the identity field will be used for both unencrypted and
73 u8 *anonymous_identity;
76 * anonymous_identity_len - Length of anonymous_identity
78 size_t anonymous_identity_len;
81 * password - Password string for EAP
83 * This field can include either the plaintext password (default
84 * option) or a NtPasswordHash (16-byte MD4 hash of the unicode
85 * presentation of the password) if flags field has
86 * EAP_CONFIG_FLAGS_PASSWORD_NTHASH bit set to 1. NtPasswordHash can
87 * only be used with authentication mechanism that use this hash as the
88 * starting point for operation: MSCHAP and MSCHAPv2 (EAP-MSCHAPv2,
89 * EAP-TTLS/MSCHAPv2, EAP-TTLS/MSCHAP, LEAP).
91 * In addition, this field is used to configure a pre-shared key for
92 * EAP-PSK/PAX/SAKE/GPSK. The length of the PSK must be 16 for EAP-PSK
93 * and EAP-PAX and 32 for EAP-SAKE. EAP-GPSK can use a variable length
99 * password_len - Length of password field
104 * ca_cert - File path to CA certificate file (PEM/DER)
106 * This file can have one or more trusted CA certificates. If ca_cert
107 * and ca_path are not included, server certificate will not be
108 * verified. This is insecure and a trusted CA certificate should
109 * always be configured when using EAP-TLS/TTLS/PEAP. Full path to the
110 * file should be used since working directory may change when
111 * wpa_supplicant is run in the background.
113 * Alternatively, a named configuration blob can be used by setting
114 * this to blob://blob_name.
116 * Alternatively, this can be used to only perform matching of the
117 * server certificate (SHA-256 hash of the DER encoded X.509
118 * certificate). In this case, the possible CA certificates in the
119 * server certificate chain are ignored and only the server certificate
120 * is verified. This is configured with the following format:
121 * hash:://server/sha256/cert_hash_in_hex
122 * For example: "hash://server/sha256/
123 * 5a1bc1296205e6fdbe3979728efe3920798885c1c4590b5f90f43222d239ca6a"
125 * On Windows, trusted CA certificates can be loaded from the system
126 * certificate store by setting this to cert_store://name, e.g.,
127 * ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT".
128 * Note that when running wpa_supplicant as an application, the user
129 * certificate store (My user account) is used, whereas computer store
130 * (Computer account) is used when running wpasvc as a service.
135 * ca_path - Directory path for CA certificate files (PEM)
137 * This path may contain multiple CA certificates in OpenSSL format.
138 * Common use for this is to point to system trusted CA list which is
139 * often installed into directory like /etc/ssl/certs. If configured,
140 * these certificates are added to the list of trusted CAs. ca_cert
141 * may also be included in that case, but it is not required.
146 * client_cert - File path to client certificate file (PEM/DER)
148 * This field is used with EAP method that use TLS authentication.
149 * Usually, this is only configured for EAP-TLS, even though this could
150 * in theory be used with EAP-TTLS and EAP-PEAP, too. Full path to the
151 * file should be used since working directory may change when
152 * wpa_supplicant is run in the background.
154 * Alternatively, a named configuration blob can be used by setting
155 * this to blob://blob_name.
160 * private_key - File path to client private key file (PEM/DER/PFX)
162 * When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
163 * commented out. Both the private key and certificate will be read
164 * from the PKCS#12 file in this case. Full path to the file should be
165 * used since working directory may change when wpa_supplicant is run
168 * Windows certificate store can be used by leaving client_cert out and
169 * configuring private_key in one of the following formats:
171 * cert://substring_to_match
173 * hash://certificate_thumbprint_in_hex
175 * For example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
177 * Note that when running wpa_supplicant as an application, the user
178 * certificate store (My user account) is used, whereas computer store
179 * (Computer account) is used when running wpasvc as a service.
181 * Alternatively, a named configuration blob can be used by setting
182 * this to blob://blob_name.
187 * private_key_passwd - Password for private key file
189 * If left out, this will be asked through control interface.
191 u8 *private_key_passwd;
194 * dh_file - File path to DH/DSA parameters file (in PEM format)
196 * This is an optional configuration file for setting parameters for an
197 * ephemeral DH key exchange. In most cases, the default RSA
198 * authentication does not use this configuration. However, it is
199 * possible setup RSA to use ephemeral DH key exchange. In addition,
200 * ciphers with DSA keys always use ephemeral DH keys. This can be used
201 * to achieve forward secrecy. If the file is in DSA parameters format,
202 * it will be automatically converted into DH params. Full path to the
203 * file should be used since working directory may change when
204 * wpa_supplicant is run in the background.
206 * Alternatively, a named configuration blob can be used by setting
207 * this to blob://blob_name.
212 * subject_match - Constraint for server certificate subject
214 * This substring is matched against the subject of the authentication
215 * server certificate. If this string is set, the server sertificate is
216 * only accepted if it contains this string in the subject. The subject
217 * string is in following format:
219 * /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@n.example.com
224 * altsubject_match - Constraint for server certificate alt. subject
226 * Semicolon separated string of entries to be matched against the
227 * alternative subject name of the authentication server certificate.
228 * If this string is set, the server sertificate is only accepted if it
229 * contains one of the entries in an alternative subject name
232 * altSubjectName string is in following format: TYPE:VALUE
234 * Example: EMAIL:server@example.com
235 * Example: DNS:server.example.com;DNS:server2.example.com
237 * Following types are supported: EMAIL, DNS, URI
239 u8 *altsubject_match;
242 * ca_cert2 - File path to CA certificate file (PEM/DER) (Phase 2)
244 * This file can have one or more trusted CA certificates. If ca_cert2
245 * and ca_path2 are not included, server certificate will not be
246 * verified. This is insecure and a trusted CA certificate should
247 * always be configured. Full path to the file should be used since
248 * working directory may change when wpa_supplicant is run in the
251 * This field is like ca_cert, but used for phase 2 (inside
252 * EAP-TTLS/PEAP/FAST tunnel) authentication.
254 * Alternatively, a named configuration blob can be used by setting
255 * this to blob://blob_name.
260 * ca_path2 - Directory path for CA certificate files (PEM) (Phase 2)
262 * This path may contain multiple CA certificates in OpenSSL format.
263 * Common use for this is to point to system trusted CA list which is
264 * often installed into directory like /etc/ssl/certs. If configured,
265 * these certificates are added to the list of trusted CAs. ca_cert
266 * may also be included in that case, but it is not required.
268 * This field is like ca_path, but used for phase 2 (inside
269 * EAP-TTLS/PEAP/FAST tunnel) authentication.
274 * client_cert2 - File path to client certificate file
276 * This field is like client_cert, but used for phase 2 (inside
277 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
278 * file should be used since working directory may change when
279 * wpa_supplicant is run in the background.
281 * Alternatively, a named configuration blob can be used by setting
282 * this to blob://blob_name.
287 * private_key2 - File path to client private key file
289 * This field is like private_key, but used for phase 2 (inside
290 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
291 * file should be used since working directory may change when
292 * wpa_supplicant is run in the background.
294 * Alternatively, a named configuration blob can be used by setting
295 * this to blob://blob_name.
300 * private_key2_passwd - Password for private key file
302 * This field is like private_key_passwd, but used for phase 2 (inside
303 * EAP-TTLS/PEAP/FAST tunnel) authentication.
305 u8 *private_key2_passwd;
308 * dh_file2 - File path to DH/DSA parameters file (in PEM format)
310 * This field is like dh_file, but used for phase 2 (inside
311 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
312 * file should be used since working directory may change when
313 * wpa_supplicant is run in the background.
315 * Alternatively, a named configuration blob can be used by setting
316 * this to blob://blob_name.
321 * subject_match2 - Constraint for server certificate subject
323 * This field is like subject_match, but used for phase 2 (inside
324 * EAP-TTLS/PEAP/FAST tunnel) authentication.
329 * altsubject_match2 - Constraint for server certificate alt. subject
331 * This field is like altsubject_match, but used for phase 2 (inside
332 * EAP-TTLS/PEAP/FAST tunnel) authentication.
334 u8 *altsubject_match2;
337 * eap_methods - Allowed EAP methods
339 * (vendor=EAP_VENDOR_IETF,method=EAP_TYPE_NONE) terminated list of
340 * allowed EAP methods or %NULL if all methods are accepted.
342 struct eap_method_type *eap_methods;
345 * phase1 - Phase 1 (outer authentication) parameters
347 * String with field-value pairs, e.g., "peapver=0" or
348 * "peapver=1 peaplabel=1".
350 * 'peapver' can be used to force which PEAP version (0 or 1) is used.
352 * 'peaplabel=1' can be used to force new label, "client PEAP
353 * encryption", to be used during key derivation when PEAPv1 or newer.
355 * Most existing PEAPv1 implementation seem to be using the old label,
356 * "client EAP encryption", and wpa_supplicant is now using that as the
359 * Some servers, e.g., Radiator, may require peaplabel=1 configuration
360 * to interoperate with PEAPv1; see eap_testing.txt for more details.
362 * 'peap_outer_success=0' can be used to terminate PEAP authentication
363 * on tunneled EAP-Success. This is required with some RADIUS servers
364 * that implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
365 * Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode).
367 * include_tls_length=1 can be used to force wpa_supplicant to include
368 * TLS Message Length field in all TLS messages even if they are not
371 * sim_min_num_chal=3 can be used to configure EAP-SIM to require three
372 * challenges (by default, it accepts 2 or 3).
374 * result_ind=1 can be used to enable EAP-SIM and EAP-AKA to use
375 * protected result indication.
377 * fast_provisioning option can be used to enable in-line provisioning
378 * of EAP-FAST credentials (PAC):
380 * 1 = allow unauthenticated provisioning,
381 * 2 = allow authenticated provisioning,
382 * 3 = allow both unauthenticated and authenticated provisioning
384 * fast_max_pac_list_len=num option can be used to set the maximum
385 * number of PAC entries to store in a PAC list (default: 10).
387 * fast_pac_format=binary option can be used to select binary format
388 * for storing PAC entries in order to save some space (the default
389 * text format uses about 2.5 times the size of minimal binary format).
391 * crypto_binding option can be used to control PEAPv0 cryptobinding
393 * 0 = do not use cryptobinding (default)
394 * 1 = use cryptobinding if server supports it
395 * 2 = require cryptobinding
397 * EAP-WSC (WPS) uses following options: pin=Device_Password and
403 * phase2 - Phase2 (inner authentication with TLS tunnel) parameters
405 * String with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
406 * "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS.
411 * pcsc - Parameters for PC/SC smartcard interface for USIM and GSM SIM
413 * This field is used to configure PC/SC smartcard interface.
414 * Currently, the only configuration is whether this field is %NULL (do
415 * not use PC/SC) or non-NULL (e.g., "") to enable PC/SC.
417 * This field is used for EAP-SIM and EAP-AKA.
422 * pin - PIN for USIM, GSM SIM, and smartcards
424 * This field is used to configure PIN for SIM and smartcards for
425 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
426 * smartcard is used for private key operations.
428 * If left out, this will be asked through control interface.
433 * engine - Enable OpenSSL engine (e.g., for smartcard access)
435 * This is used if private key operations for EAP-TLS are performed
441 * engine_id - Engine ID for OpenSSL engine
443 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
446 * This is used if private key operations for EAP-TLS are performed
452 * engine2 - Enable OpenSSL engine (e.g., for smartcard) (Phase 2)
454 * This is used if private key operations for EAP-TLS are performed
457 * This field is like engine, but used for phase 2 (inside
458 * EAP-TTLS/PEAP/FAST tunnel) authentication.
464 * pin2 - PIN for USIM, GSM SIM, and smartcards (Phase 2)
466 * This field is used to configure PIN for SIM and smartcards for
467 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
468 * smartcard is used for private key operations.
470 * This field is like pin2, but used for phase 2 (inside
471 * EAP-TTLS/PEAP/FAST tunnel) authentication.
473 * If left out, this will be asked through control interface.
478 * engine2_id - Engine ID for OpenSSL engine (Phase 2)
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
486 * This field is like engine_id, but used for phase 2 (inside
487 * EAP-TTLS/PEAP/FAST tunnel) authentication.
493 * key_id - Key ID for OpenSSL engine
495 * This is used if private key operations for EAP-TLS are performed
501 * cert_id - Cert ID for OpenSSL engine
503 * This is used if the certificate operations for EAP-TLS are performed
509 * ca_cert_id - CA Cert ID for OpenSSL engine
511 * This is used if the CA certificate for EAP-TLS is on a smartcard.
516 * key2_id - Key ID for OpenSSL engine (phase2)
518 * This is used if private key operations for EAP-TLS are performed
524 * cert2_id - Cert ID for OpenSSL engine (phase2)
526 * This is used if the certificate operations for EAP-TLS are performed
532 * ca_cert2_id - CA Cert ID for OpenSSL engine (phase2)
534 * This is used if the CA certificate for EAP-TLS is on a smartcard.
539 * otp - One-time-password
541 * This field should not be set in configuration step. It is only used
542 * internally when OTP is entered through the control interface.
547 * otp_len - Length of the otp field
552 * pending_req_identity - Whether there is a pending identity request
554 * This field should not be set in configuration step. It is only used
555 * internally when control interface is used to request needed
558 int pending_req_identity;
561 * pending_req_password - Whether there is a pending password request
563 * This field should not be set in configuration step. It is only used
564 * internally when control interface is used to request needed
567 int pending_req_password;
570 * pending_req_pin - Whether there is a pending PIN request
572 * This field should not be set in configuration step. It is only used
573 * internally when control interface is used to request needed
579 * pending_req_new_password - Pending password update request
581 * This field should not be set in configuration step. It is only used
582 * internally when control interface is used to request needed
585 int pending_req_new_password;
588 * pending_req_passphrase - Pending passphrase request
590 * This field should not be set in configuration step. It is only used
591 * internally when control interface is used to request needed
594 int pending_req_passphrase;
597 * pending_req_otp - Whether there is a pending OTP request
599 * This field should not be set in configuration step. It is only used
600 * internally when control interface is used to request needed
603 char *pending_req_otp;
606 * pending_req_otp_len - Length of the pending OTP request
608 size_t pending_req_otp_len;
611 * pac_file - File path or blob name for the PAC entries (EAP-FAST)
613 * wpa_supplicant will need to be able to create this file and write
614 * updates to it when PAC is being provisioned or refreshed. Full path
615 * to the file should be used since working directory may change when
616 * wpa_supplicant is run in the background.
617 * Alternatively, a named configuration blob can be used by setting
618 * this to blob://blob_name.
623 * mschapv2_retry - MSCHAPv2 retry in progress
625 * This field is used internally by EAP-MSCHAPv2 and should not be set
626 * as part of configuration.
631 * new_password - New password for password update
633 * This field is used during MSCHAPv2 password update. This is normally
634 * requested from the user through the control interface and not set
635 * from configuration.
640 * new_password_len - Length of new_password field
642 size_t new_password_len;
645 * fragment_size - Maximum EAP fragment size in bytes (default 1398)
647 * This value limits the fragment size for EAP methods that support
648 * fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set
649 * small enough to make the EAP messages fit in MTU of the network
650 * interface used for EAPOL. The default value is suitable for most
656 * chbind_config - eap channel binding config data
658 struct eap_peer_chbind_config *chbind_config;
661 * chbind_config_len - channel binding config data count
663 size_t chbind_config_len;
665 #define EAP_CONFIG_FLAGS_PASSWORD_NTHASH BIT(0)
667 * flags - Network configuration flags (bitfield)
669 * This variable is used for internal flags to describe further details
670 * for the network parameters.
671 * bit 0 = password is represented as a 16-byte NtPasswordHash value
672 * instead of plaintext password
679 * struct wpa_config_blob - Named configuration blob
681 * This data structure is used to provide storage for binary objects to store
682 * abstract information like certificates and private keys inlined with the
683 * configuration data.
685 struct wpa_config_blob {
692 * data - Pointer to binary data
697 * len - Length of binary data
702 * next - Pointer to next blob in the configuration
704 struct wpa_config_blob *next;
711 #endif /* EAP_CONFIG_H */