xref: /freebsd/contrib/wpa/src/eap_peer/eap_config.h (revision e28a4053b110e06768631ac8401ed4a3c05e68a5)
139beb93cSSam Leffler /*
239beb93cSSam Leffler  * EAP peer configuration data
339beb93cSSam Leffler  * Copyright (c) 2003-2008, Jouni Malinen <j@w1.fi>
439beb93cSSam Leffler  *
539beb93cSSam Leffler  * This program is free software; you can redistribute it and/or modify
639beb93cSSam Leffler  * it under the terms of the GNU General Public License version 2 as
739beb93cSSam Leffler  * published by the Free Software Foundation.
839beb93cSSam Leffler  *
939beb93cSSam Leffler  * Alternatively, this software may be distributed under the terms of BSD
1039beb93cSSam Leffler  * license.
1139beb93cSSam Leffler  *
1239beb93cSSam Leffler  * See README and COPYING for more details.
1339beb93cSSam Leffler  */
1439beb93cSSam Leffler 
1539beb93cSSam Leffler #ifndef EAP_CONFIG_H
1639beb93cSSam Leffler #define EAP_CONFIG_H
1739beb93cSSam Leffler 
1839beb93cSSam Leffler /**
1939beb93cSSam Leffler  * struct eap_peer_config - EAP peer configuration/credentials
2039beb93cSSam Leffler  */
2139beb93cSSam Leffler struct eap_peer_config {
2239beb93cSSam Leffler 	/**
2339beb93cSSam Leffler 	 * identity - EAP Identity
2439beb93cSSam Leffler 	 *
2539beb93cSSam Leffler 	 * This field is used to set the real user identity or NAI (for
2639beb93cSSam Leffler 	 * EAP-PSK/PAX/SAKE/GPSK).
2739beb93cSSam Leffler 	 */
2839beb93cSSam Leffler 	u8 *identity;
2939beb93cSSam Leffler 
3039beb93cSSam Leffler 	/**
3139beb93cSSam Leffler 	 * identity_len - EAP Identity length
3239beb93cSSam Leffler 	 */
3339beb93cSSam Leffler 	size_t identity_len;
3439beb93cSSam Leffler 
3539beb93cSSam Leffler 	/**
3639beb93cSSam Leffler 	 * anonymous_identity -  Anonymous EAP Identity
3739beb93cSSam Leffler 	 *
3839beb93cSSam Leffler 	 * This field is used for unencrypted use with EAP types that support
3939beb93cSSam Leffler 	 * different tunnelled identity, e.g., EAP-TTLS, in order to reveal the
4039beb93cSSam Leffler 	 * real identity (identity field) only to the authentication server.
4139beb93cSSam Leffler 	 *
4239beb93cSSam Leffler 	 * If not set, the identity field will be used for both unencrypted and
4339beb93cSSam Leffler 	 * protected fields.
4439beb93cSSam Leffler 	 */
4539beb93cSSam Leffler 	u8 *anonymous_identity;
4639beb93cSSam Leffler 
4739beb93cSSam Leffler 	/**
4839beb93cSSam Leffler 	 * anonymous_identity_len - Length of anonymous_identity
4939beb93cSSam Leffler 	 */
5039beb93cSSam Leffler 	size_t anonymous_identity_len;
5139beb93cSSam Leffler 
5239beb93cSSam Leffler 	/**
5339beb93cSSam Leffler 	 * password - Password string for EAP
5439beb93cSSam Leffler 	 *
5539beb93cSSam Leffler 	 * This field can include either the plaintext password (default
5639beb93cSSam Leffler 	 * option) or a NtPasswordHash (16-byte MD4 hash of the unicode
5739beb93cSSam Leffler 	 * presentation of the password) if flags field has
5839beb93cSSam Leffler 	 * EAP_CONFIG_FLAGS_PASSWORD_NTHASH bit set to 1. NtPasswordHash can
5939beb93cSSam Leffler 	 * only be used with authentication mechanism that use this hash as the
6039beb93cSSam Leffler 	 * starting point for operation: MSCHAP and MSCHAPv2 (EAP-MSCHAPv2,
6139beb93cSSam Leffler 	 * EAP-TTLS/MSCHAPv2, EAP-TTLS/MSCHAP, LEAP).
6239beb93cSSam Leffler 	 *
6339beb93cSSam Leffler 	 * In addition, this field is used to configure a pre-shared key for
6439beb93cSSam Leffler 	 * EAP-PSK/PAX/SAKE/GPSK. The length of the PSK must be 16 for EAP-PSK
6539beb93cSSam Leffler 	 * and EAP-PAX and 32 for EAP-SAKE. EAP-GPSK can use a variable length
6639beb93cSSam Leffler 	 * PSK.
6739beb93cSSam Leffler 	 */
6839beb93cSSam Leffler 	u8 *password;
6939beb93cSSam Leffler 
7039beb93cSSam Leffler 	/**
7139beb93cSSam Leffler 	 * password_len - Length of password field
7239beb93cSSam Leffler 	 */
7339beb93cSSam Leffler 	size_t password_len;
7439beb93cSSam Leffler 
7539beb93cSSam Leffler 	/**
7639beb93cSSam Leffler 	 * ca_cert - File path to CA certificate file (PEM/DER)
7739beb93cSSam Leffler 	 *
7839beb93cSSam Leffler 	 * This file can have one or more trusted CA certificates. If ca_cert
7939beb93cSSam Leffler 	 * and ca_path are not included, server certificate will not be
8039beb93cSSam Leffler 	 * verified. This is insecure and a trusted CA certificate should
8139beb93cSSam Leffler 	 * always be configured when using EAP-TLS/TTLS/PEAP. Full path to the
8239beb93cSSam Leffler 	 * file should be used since working directory may change when
8339beb93cSSam Leffler 	 * wpa_supplicant is run in the background.
8439beb93cSSam Leffler 	 *
8539beb93cSSam Leffler 	 * Alternatively, a named configuration blob can be used by setting
8639beb93cSSam Leffler 	 * this to blob://blob_name.
8739beb93cSSam Leffler 	 *
88*e28a4053SRui Paulo 	 * Alternatively, this can be used to only perform matching of the
89*e28a4053SRui Paulo 	 * server certificate (SHA-256 hash of the DER encoded X.509
90*e28a4053SRui Paulo 	 * certificate). In this case, the possible CA certificates in the
91*e28a4053SRui Paulo 	 * server certificate chain are ignored and only the server certificate
92*e28a4053SRui Paulo 	 * is verified. This is configured with the following format:
93*e28a4053SRui Paulo 	 * hash:://server/sha256/cert_hash_in_hex
94*e28a4053SRui Paulo 	 * For example: "hash://server/sha256/
95*e28a4053SRui Paulo 	 * 5a1bc1296205e6fdbe3979728efe3920798885c1c4590b5f90f43222d239ca6a"
96*e28a4053SRui Paulo 	 *
9739beb93cSSam Leffler 	 * On Windows, trusted CA certificates can be loaded from the system
9839beb93cSSam Leffler 	 * certificate store by setting this to cert_store://name, e.g.,
9939beb93cSSam Leffler 	 * ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT".
10039beb93cSSam Leffler 	 * Note that when running wpa_supplicant as an application, the user
10139beb93cSSam Leffler 	 * certificate store (My user account) is used, whereas computer store
10239beb93cSSam Leffler 	 * (Computer account) is used when running wpasvc as a service.
10339beb93cSSam Leffler 	 */
10439beb93cSSam Leffler 	u8 *ca_cert;
10539beb93cSSam Leffler 
10639beb93cSSam Leffler 	/**
10739beb93cSSam Leffler 	 * ca_path - Directory path for CA certificate files (PEM)
10839beb93cSSam Leffler 	 *
10939beb93cSSam Leffler 	 * This path may contain multiple CA certificates in OpenSSL format.
11039beb93cSSam Leffler 	 * Common use for this is to point to system trusted CA list which is
11139beb93cSSam Leffler 	 * often installed into directory like /etc/ssl/certs. If configured,
11239beb93cSSam Leffler 	 * these certificates are added to the list of trusted CAs. ca_cert
11339beb93cSSam Leffler 	 * may also be included in that case, but it is not required.
11439beb93cSSam Leffler 	 */
11539beb93cSSam Leffler 	u8 *ca_path;
11639beb93cSSam Leffler 
11739beb93cSSam Leffler 	/**
11839beb93cSSam Leffler 	 * client_cert - File path to client certificate file (PEM/DER)
11939beb93cSSam Leffler 	 *
12039beb93cSSam Leffler 	 * This field is used with EAP method that use TLS authentication.
12139beb93cSSam Leffler 	 * Usually, this is only configured for EAP-TLS, even though this could
12239beb93cSSam Leffler 	 * in theory be used with EAP-TTLS and EAP-PEAP, too. Full path to the
12339beb93cSSam Leffler 	 * file should be used since working directory may change when
12439beb93cSSam Leffler 	 * wpa_supplicant is run in the background.
12539beb93cSSam Leffler 	 *
12639beb93cSSam Leffler 	 * Alternatively, a named configuration blob can be used by setting
12739beb93cSSam Leffler 	 * this to blob://blob_name.
12839beb93cSSam Leffler 	 */
12939beb93cSSam Leffler 	u8 *client_cert;
13039beb93cSSam Leffler 
13139beb93cSSam Leffler 	/**
13239beb93cSSam Leffler 	 * private_key - File path to client private key file (PEM/DER/PFX)
13339beb93cSSam Leffler 	 *
13439beb93cSSam Leffler 	 * When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
13539beb93cSSam Leffler 	 * commented out. Both the private key and certificate will be read
13639beb93cSSam Leffler 	 * from the PKCS#12 file in this case. Full path to the file should be
13739beb93cSSam Leffler 	 * used since working directory may change when wpa_supplicant is run
13839beb93cSSam Leffler 	 * in the background.
13939beb93cSSam Leffler 	 *
14039beb93cSSam Leffler 	 * Windows certificate store can be used by leaving client_cert out and
14139beb93cSSam Leffler 	 * configuring private_key in one of the following formats:
14239beb93cSSam Leffler 	 *
14339beb93cSSam Leffler 	 * cert://substring_to_match
14439beb93cSSam Leffler 	 *
14539beb93cSSam Leffler 	 * hash://certificate_thumbprint_in_hex
14639beb93cSSam Leffler 	 *
14739beb93cSSam Leffler 	 * For example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
14839beb93cSSam Leffler 	 *
14939beb93cSSam Leffler 	 * Note that when running wpa_supplicant as an application, the user
15039beb93cSSam Leffler 	 * certificate store (My user account) is used, whereas computer store
15139beb93cSSam Leffler 	 * (Computer account) is used when running wpasvc as a service.
15239beb93cSSam Leffler 	 *
15339beb93cSSam Leffler 	 * Alternatively, a named configuration blob can be used by setting
15439beb93cSSam Leffler 	 * this to blob://blob_name.
15539beb93cSSam Leffler 	 */
15639beb93cSSam Leffler 	u8 *private_key;
15739beb93cSSam Leffler 
15839beb93cSSam Leffler 	/**
15939beb93cSSam Leffler 	 * private_key_passwd - Password for private key file
16039beb93cSSam Leffler 	 *
16139beb93cSSam Leffler 	 * If left out, this will be asked through control interface.
16239beb93cSSam Leffler 	 */
16339beb93cSSam Leffler 	u8 *private_key_passwd;
16439beb93cSSam Leffler 
16539beb93cSSam Leffler 	/**
16639beb93cSSam Leffler 	 * dh_file - File path to DH/DSA parameters file (in PEM format)
16739beb93cSSam Leffler 	 *
16839beb93cSSam Leffler 	 * This is an optional configuration file for setting parameters for an
16939beb93cSSam Leffler 	 * ephemeral DH key exchange. In most cases, the default RSA
17039beb93cSSam Leffler 	 * authentication does not use this configuration. However, it is
17139beb93cSSam Leffler 	 * possible setup RSA to use ephemeral DH key exchange. In addition,
17239beb93cSSam Leffler 	 * ciphers with DSA keys always use ephemeral DH keys. This can be used
17339beb93cSSam Leffler 	 * to achieve forward secrecy. If the file is in DSA parameters format,
17439beb93cSSam Leffler 	 * it will be automatically converted into DH params. Full path to the
17539beb93cSSam Leffler 	 * file should be used since working directory may change when
17639beb93cSSam Leffler 	 * wpa_supplicant is run in the background.
17739beb93cSSam Leffler 	 *
17839beb93cSSam Leffler 	 * Alternatively, a named configuration blob can be used by setting
17939beb93cSSam Leffler 	 * this to blob://blob_name.
18039beb93cSSam Leffler 	 */
18139beb93cSSam Leffler 	u8 *dh_file;
18239beb93cSSam Leffler 
18339beb93cSSam Leffler 	/**
18439beb93cSSam Leffler 	 * subject_match - Constraint for server certificate subject
18539beb93cSSam Leffler 	 *
18639beb93cSSam Leffler 	 * This substring is matched against the subject of the authentication
18739beb93cSSam Leffler 	 * server certificate. If this string is set, the server sertificate is
18839beb93cSSam Leffler 	 * only accepted if it contains this string in the subject. The subject
18939beb93cSSam Leffler 	 * string is in following format:
19039beb93cSSam Leffler 	 *
19139beb93cSSam Leffler 	 * /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@n.example.com
19239beb93cSSam Leffler 	 */
19339beb93cSSam Leffler 	u8 *subject_match;
19439beb93cSSam Leffler 
19539beb93cSSam Leffler 	/**
19639beb93cSSam Leffler 	 * altsubject_match - Constraint for server certificate alt. subject
19739beb93cSSam Leffler 	 *
19839beb93cSSam Leffler 	 * Semicolon separated string of entries to be matched against the
19939beb93cSSam Leffler 	 * alternative subject name of the authentication server certificate.
20039beb93cSSam Leffler 	 * If this string is set, the server sertificate is only accepted if it
20139beb93cSSam Leffler 	 * contains one of the entries in an alternative subject name
20239beb93cSSam Leffler 	 * extension.
20339beb93cSSam Leffler 	 *
20439beb93cSSam Leffler 	 * altSubjectName string is in following format: TYPE:VALUE
20539beb93cSSam Leffler 	 *
20639beb93cSSam Leffler 	 * Example: EMAIL:server@example.com
20739beb93cSSam Leffler 	 * Example: DNS:server.example.com;DNS:server2.example.com
20839beb93cSSam Leffler 	 *
20939beb93cSSam Leffler 	 * Following types are supported: EMAIL, DNS, URI
21039beb93cSSam Leffler 	 */
21139beb93cSSam Leffler 	u8 *altsubject_match;
21239beb93cSSam Leffler 
21339beb93cSSam Leffler 	/**
21439beb93cSSam Leffler 	 * ca_cert2 - File path to CA certificate file (PEM/DER) (Phase 2)
21539beb93cSSam Leffler 	 *
21639beb93cSSam Leffler 	 * This file can have one or more trusted CA certificates. If ca_cert2
21739beb93cSSam Leffler 	 * and ca_path2 are not included, server certificate will not be
21839beb93cSSam Leffler 	 * verified. This is insecure and a trusted CA certificate should
21939beb93cSSam Leffler 	 * always be configured. Full path to the file should be used since
22039beb93cSSam Leffler 	 * working directory may change when wpa_supplicant is run in the
22139beb93cSSam Leffler 	 * background.
22239beb93cSSam Leffler 	 *
22339beb93cSSam Leffler 	 * This field is like ca_cert, but used for phase 2 (inside
22439beb93cSSam Leffler 	 * EAP-TTLS/PEAP/FAST tunnel) authentication.
22539beb93cSSam Leffler 	 *
22639beb93cSSam Leffler 	 * Alternatively, a named configuration blob can be used by setting
22739beb93cSSam Leffler 	 * this to blob://blob_name.
22839beb93cSSam Leffler 	 */
22939beb93cSSam Leffler 	u8 *ca_cert2;
23039beb93cSSam Leffler 
23139beb93cSSam Leffler 	/**
23239beb93cSSam Leffler 	 * ca_path2 - Directory path for CA certificate files (PEM) (Phase 2)
23339beb93cSSam Leffler 	 *
23439beb93cSSam Leffler 	 * This path may contain multiple CA certificates in OpenSSL format.
23539beb93cSSam Leffler 	 * Common use for this is to point to system trusted CA list which is
23639beb93cSSam Leffler 	 * often installed into directory like /etc/ssl/certs. If configured,
23739beb93cSSam Leffler 	 * these certificates are added to the list of trusted CAs. ca_cert
23839beb93cSSam Leffler 	 * may also be included in that case, but it is not required.
23939beb93cSSam Leffler 	 *
24039beb93cSSam Leffler 	 * This field is like ca_path, but used for phase 2 (inside
24139beb93cSSam Leffler 	 * EAP-TTLS/PEAP/FAST tunnel) authentication.
24239beb93cSSam Leffler 	 */
24339beb93cSSam Leffler 	u8 *ca_path2;
24439beb93cSSam Leffler 
24539beb93cSSam Leffler 	/**
24639beb93cSSam Leffler 	 * client_cert2 - File path to client certificate file
24739beb93cSSam Leffler 	 *
24839beb93cSSam Leffler 	 * This field is like client_cert, but used for phase 2 (inside
24939beb93cSSam Leffler 	 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
25039beb93cSSam Leffler 	 * file should be used since working directory may change when
25139beb93cSSam Leffler 	 * wpa_supplicant is run in the background.
25239beb93cSSam Leffler 	 *
25339beb93cSSam Leffler 	 * Alternatively, a named configuration blob can be used by setting
25439beb93cSSam Leffler 	 * this to blob://blob_name.
25539beb93cSSam Leffler 	 */
25639beb93cSSam Leffler 	u8 *client_cert2;
25739beb93cSSam Leffler 
25839beb93cSSam Leffler 	/**
25939beb93cSSam Leffler 	 * private_key2 - File path to client private key file
26039beb93cSSam Leffler 	 *
26139beb93cSSam Leffler 	 * This field is like private_key, but used for phase 2 (inside
26239beb93cSSam Leffler 	 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
26339beb93cSSam Leffler 	 * file should be used since working directory may change when
26439beb93cSSam Leffler 	 * wpa_supplicant is run in the background.
26539beb93cSSam Leffler 	 *
26639beb93cSSam Leffler 	 * Alternatively, a named configuration blob can be used by setting
26739beb93cSSam Leffler 	 * this to blob://blob_name.
26839beb93cSSam Leffler 	 */
26939beb93cSSam Leffler 	u8 *private_key2;
27039beb93cSSam Leffler 
27139beb93cSSam Leffler 	/**
27239beb93cSSam Leffler 	 * private_key2_passwd -  Password for private key file
27339beb93cSSam Leffler 	 *
27439beb93cSSam Leffler 	 * This field is like private_key_passwd, but used for phase 2 (inside
27539beb93cSSam Leffler 	 * EAP-TTLS/PEAP/FAST tunnel) authentication.
27639beb93cSSam Leffler 	 */
27739beb93cSSam Leffler 	u8 *private_key2_passwd;
27839beb93cSSam Leffler 
27939beb93cSSam Leffler 	/**
28039beb93cSSam Leffler 	 * dh_file2 - File path to DH/DSA parameters file (in PEM format)
28139beb93cSSam Leffler 	 *
28239beb93cSSam Leffler 	 * This field is like dh_file, but used for phase 2 (inside
28339beb93cSSam Leffler 	 * EAP-TTLS/PEAP/FAST tunnel) authentication. Full path to the
28439beb93cSSam Leffler 	 * file should be used since working directory may change when
28539beb93cSSam Leffler 	 * wpa_supplicant is run in the background.
28639beb93cSSam Leffler 	 *
28739beb93cSSam Leffler 	 * Alternatively, a named configuration blob can be used by setting
28839beb93cSSam Leffler 	 * this to blob://blob_name.
28939beb93cSSam Leffler 	 */
29039beb93cSSam Leffler 	u8 *dh_file2;
29139beb93cSSam Leffler 
29239beb93cSSam Leffler 	/**
29339beb93cSSam Leffler 	 * subject_match2 - Constraint for server certificate subject
29439beb93cSSam Leffler 	 *
29539beb93cSSam Leffler 	 * This field is like subject_match, but used for phase 2 (inside
29639beb93cSSam Leffler 	 * EAP-TTLS/PEAP/FAST tunnel) authentication.
29739beb93cSSam Leffler 	 */
29839beb93cSSam Leffler 	u8 *subject_match2;
29939beb93cSSam Leffler 
30039beb93cSSam Leffler 	/**
30139beb93cSSam Leffler 	 * altsubject_match2 - Constraint for server certificate alt. subject
30239beb93cSSam Leffler 	 *
30339beb93cSSam Leffler 	 * This field is like altsubject_match, but used for phase 2 (inside
30439beb93cSSam Leffler 	 * EAP-TTLS/PEAP/FAST tunnel) authentication.
30539beb93cSSam Leffler 	 */
30639beb93cSSam Leffler 	u8 *altsubject_match2;
30739beb93cSSam Leffler 
30839beb93cSSam Leffler 	/**
30939beb93cSSam Leffler 	 * eap_methods - Allowed EAP methods
31039beb93cSSam Leffler 	 *
31139beb93cSSam Leffler 	 * (vendor=EAP_VENDOR_IETF,method=EAP_TYPE_NONE) terminated list of
31239beb93cSSam Leffler 	 * allowed EAP methods or %NULL if all methods are accepted.
31339beb93cSSam Leffler 	 */
31439beb93cSSam Leffler 	struct eap_method_type *eap_methods;
31539beb93cSSam Leffler 
31639beb93cSSam Leffler 	/**
31739beb93cSSam Leffler 	 * phase1 - Phase 1 (outer authentication) parameters
31839beb93cSSam Leffler 	 *
31939beb93cSSam Leffler 	 * String with field-value pairs, e.g., "peapver=0" or
32039beb93cSSam Leffler 	 * "peapver=1 peaplabel=1".
32139beb93cSSam Leffler 	 *
32239beb93cSSam Leffler 	 * 'peapver' can be used to force which PEAP version (0 or 1) is used.
32339beb93cSSam Leffler 	 *
32439beb93cSSam Leffler 	 * 'peaplabel=1' can be used to force new label, "client PEAP
32539beb93cSSam Leffler 	 * encryption",	to be used during key derivation when PEAPv1 or newer.
32639beb93cSSam Leffler 	 *
32739beb93cSSam Leffler 	 * Most existing PEAPv1 implementation seem to be using the old label,
32839beb93cSSam Leffler 	 * "client EAP encryption", and wpa_supplicant is now using that as the
32939beb93cSSam Leffler 	 * default value.
33039beb93cSSam Leffler 	 *
33139beb93cSSam Leffler 	 * Some servers, e.g., Radiator, may require peaplabel=1 configuration
33239beb93cSSam Leffler 	 * to interoperate with PEAPv1; see eap_testing.txt for more details.
33339beb93cSSam Leffler 	 *
33439beb93cSSam Leffler 	 * 'peap_outer_success=0' can be used to terminate PEAP authentication
33539beb93cSSam Leffler 	 * on tunneled EAP-Success. This is required with some RADIUS servers
33639beb93cSSam Leffler 	 * that implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
33739beb93cSSam Leffler 	 * Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode).
33839beb93cSSam Leffler 	 *
33939beb93cSSam Leffler 	 * include_tls_length=1 can be used to force wpa_supplicant to include
34039beb93cSSam Leffler 	 * TLS Message Length field in all TLS messages even if they are not
34139beb93cSSam Leffler 	 * fragmented.
34239beb93cSSam Leffler 	 *
34339beb93cSSam Leffler 	 * sim_min_num_chal=3 can be used to configure EAP-SIM to require three
34439beb93cSSam Leffler 	 * challenges (by default, it accepts 2 or 3).
34539beb93cSSam Leffler 	 *
34639beb93cSSam Leffler 	 * result_ind=1 can be used to enable EAP-SIM and EAP-AKA to use
34739beb93cSSam Leffler 	 * protected result indication.
34839beb93cSSam Leffler 	 *
34939beb93cSSam Leffler 	 * fast_provisioning option can be used to enable in-line provisioning
35039beb93cSSam Leffler 	 * of EAP-FAST credentials (PAC):
35139beb93cSSam Leffler 	 * 0 = disabled,
35239beb93cSSam Leffler 	 * 1 = allow unauthenticated provisioning,
35339beb93cSSam Leffler 	 * 2 = allow authenticated provisioning,
35439beb93cSSam Leffler 	 * 3 = allow both unauthenticated and authenticated provisioning
35539beb93cSSam Leffler 	 *
35639beb93cSSam Leffler 	 * fast_max_pac_list_len=num option can be used to set the maximum
35739beb93cSSam Leffler 	 * number of PAC entries to store in a PAC list (default: 10).
35839beb93cSSam Leffler 	 *
35939beb93cSSam Leffler 	 * fast_pac_format=binary option can be used to select binary format
36039beb93cSSam Leffler 	 * for storing PAC entries in order to save some space (the default
36139beb93cSSam Leffler 	 * text format uses about 2.5 times the size of minimal binary format).
36239beb93cSSam Leffler 	 *
36339beb93cSSam Leffler 	 * crypto_binding option can be used to control PEAPv0 cryptobinding
36439beb93cSSam Leffler 	 * behavior:
36539beb93cSSam Leffler 	 * 0 = do not use cryptobinding (default)
36639beb93cSSam Leffler 	 * 1 = use cryptobinding if server supports it
36739beb93cSSam Leffler 	 * 2 = require cryptobinding
36839beb93cSSam Leffler 	 *
36939beb93cSSam Leffler 	 * EAP-WSC (WPS) uses following options: pin=Device_Password and
37039beb93cSSam Leffler 	 * uuid=Device_UUID
37139beb93cSSam Leffler 	 */
37239beb93cSSam Leffler 	char *phase1;
37339beb93cSSam Leffler 
37439beb93cSSam Leffler 	/**
37539beb93cSSam Leffler 	 * phase2 - Phase2 (inner authentication with TLS tunnel) parameters
37639beb93cSSam Leffler 	 *
37739beb93cSSam Leffler 	 * String with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
37839beb93cSSam Leffler 	 * "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS.
37939beb93cSSam Leffler 	 */
38039beb93cSSam Leffler 	char *phase2;
38139beb93cSSam Leffler 
38239beb93cSSam Leffler 	/**
38339beb93cSSam Leffler 	 * pcsc - Parameters for PC/SC smartcard interface for USIM and GSM SIM
38439beb93cSSam Leffler 	 *
38539beb93cSSam Leffler 	 * This field is used to configure PC/SC smartcard interface.
38639beb93cSSam Leffler 	 * Currently, the only configuration is whether this field is %NULL (do
38739beb93cSSam Leffler 	 * not use PC/SC) or non-NULL (e.g., "") to enable PC/SC.
38839beb93cSSam Leffler 	 *
38939beb93cSSam Leffler 	 * This field is used for EAP-SIM and EAP-AKA.
39039beb93cSSam Leffler 	 */
39139beb93cSSam Leffler 	char *pcsc;
39239beb93cSSam Leffler 
39339beb93cSSam Leffler 	/**
39439beb93cSSam Leffler 	 * pin - PIN for USIM, GSM SIM, and smartcards
39539beb93cSSam Leffler 	 *
39639beb93cSSam Leffler 	 * This field is used to configure PIN for SIM and smartcards for
39739beb93cSSam Leffler 	 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
39839beb93cSSam Leffler 	 * smartcard is used for private key operations.
39939beb93cSSam Leffler 	 *
40039beb93cSSam Leffler 	 * If left out, this will be asked through control interface.
40139beb93cSSam Leffler 	 */
40239beb93cSSam Leffler 	char *pin;
40339beb93cSSam Leffler 
40439beb93cSSam Leffler 	/**
40539beb93cSSam Leffler 	 * engine - Enable OpenSSL engine (e.g., for smartcard access)
40639beb93cSSam Leffler 	 *
40739beb93cSSam Leffler 	 * This is used if private key operations for EAP-TLS are performed
40839beb93cSSam Leffler 	 * using a smartcard.
40939beb93cSSam Leffler 	 */
41039beb93cSSam Leffler 	int engine;
41139beb93cSSam Leffler 
41239beb93cSSam Leffler 	/**
41339beb93cSSam Leffler 	 * engine_id - Engine ID for OpenSSL engine
41439beb93cSSam Leffler 	 *
41539beb93cSSam Leffler 	 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
41639beb93cSSam Leffler 	 * engine.
41739beb93cSSam Leffler 	 *
41839beb93cSSam Leffler 	 * This is used if private key operations for EAP-TLS are performed
41939beb93cSSam Leffler 	 * using a smartcard.
42039beb93cSSam Leffler 	 */
42139beb93cSSam Leffler 	char *engine_id;
42239beb93cSSam Leffler 
42339beb93cSSam Leffler 	/**
42439beb93cSSam Leffler 	 * engine2 - Enable OpenSSL engine (e.g., for smartcard) (Phase 2)
42539beb93cSSam Leffler 	 *
42639beb93cSSam Leffler 	 * This is used if private key operations for EAP-TLS are performed
42739beb93cSSam Leffler 	 * using a smartcard.
42839beb93cSSam Leffler 	 *
42939beb93cSSam Leffler 	 * This field is like engine, but used for phase 2 (inside
43039beb93cSSam Leffler 	 * EAP-TTLS/PEAP/FAST tunnel) authentication.
43139beb93cSSam Leffler 	 */
43239beb93cSSam Leffler 	int engine2;
43339beb93cSSam Leffler 
43439beb93cSSam Leffler 
43539beb93cSSam Leffler 	/**
43639beb93cSSam Leffler 	 * pin2 - PIN for USIM, GSM SIM, and smartcards (Phase 2)
43739beb93cSSam Leffler 	 *
43839beb93cSSam Leffler 	 * This field is used to configure PIN for SIM and smartcards for
43939beb93cSSam Leffler 	 * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
44039beb93cSSam Leffler 	 * smartcard is used for private key operations.
44139beb93cSSam Leffler 	 *
44239beb93cSSam Leffler 	 * This field is like pin2, but used for phase 2 (inside
44339beb93cSSam Leffler 	 * EAP-TTLS/PEAP/FAST tunnel) authentication.
44439beb93cSSam Leffler 	 *
44539beb93cSSam Leffler 	 * If left out, this will be asked through control interface.
44639beb93cSSam Leffler 	 */
44739beb93cSSam Leffler 	char *pin2;
44839beb93cSSam Leffler 
44939beb93cSSam Leffler 	/**
45039beb93cSSam Leffler 	 * engine2_id - Engine ID for OpenSSL engine (Phase 2)
45139beb93cSSam Leffler 	 *
45239beb93cSSam Leffler 	 * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
45339beb93cSSam Leffler 	 * engine.
45439beb93cSSam Leffler 	 *
45539beb93cSSam Leffler 	 * This is used if private key operations for EAP-TLS are performed
45639beb93cSSam Leffler 	 * using a smartcard.
45739beb93cSSam Leffler 	 *
45839beb93cSSam Leffler 	 * This field is like engine_id, but used for phase 2 (inside
45939beb93cSSam Leffler 	 * EAP-TTLS/PEAP/FAST tunnel) authentication.
46039beb93cSSam Leffler 	 */
46139beb93cSSam Leffler 	char *engine2_id;
46239beb93cSSam Leffler 
46339beb93cSSam Leffler 
46439beb93cSSam Leffler 	/**
46539beb93cSSam Leffler 	 * key_id - Key ID for OpenSSL engine
46639beb93cSSam Leffler 	 *
46739beb93cSSam Leffler 	 * This is used if private key operations for EAP-TLS are performed
46839beb93cSSam Leffler 	 * using a smartcard.
46939beb93cSSam Leffler 	 */
47039beb93cSSam Leffler 	char *key_id;
47139beb93cSSam Leffler 
47239beb93cSSam Leffler 	/**
47339beb93cSSam Leffler 	 * cert_id - Cert ID for OpenSSL engine
47439beb93cSSam Leffler 	 *
47539beb93cSSam Leffler 	 * This is used if the certificate operations for EAP-TLS are performed
47639beb93cSSam Leffler 	 * using a smartcard.
47739beb93cSSam Leffler 	 */
47839beb93cSSam Leffler 	char *cert_id;
47939beb93cSSam Leffler 
48039beb93cSSam Leffler 	/**
48139beb93cSSam Leffler 	 * ca_cert_id - CA Cert ID for OpenSSL engine
48239beb93cSSam Leffler 	 *
48339beb93cSSam Leffler 	 * This is used if the CA certificate for EAP-TLS is on a smartcard.
48439beb93cSSam Leffler 	 */
48539beb93cSSam Leffler 	char *ca_cert_id;
48639beb93cSSam Leffler 
48739beb93cSSam Leffler 	/**
48839beb93cSSam Leffler 	 * key2_id - Key ID for OpenSSL engine (phase2)
48939beb93cSSam Leffler 	 *
49039beb93cSSam Leffler 	 * This is used if private key operations for EAP-TLS are performed
49139beb93cSSam Leffler 	 * using a smartcard.
49239beb93cSSam Leffler 	 */
49339beb93cSSam Leffler 	char *key2_id;
49439beb93cSSam Leffler 
49539beb93cSSam Leffler 	/**
49639beb93cSSam Leffler 	 * cert2_id - Cert ID for OpenSSL engine (phase2)
49739beb93cSSam Leffler 	 *
49839beb93cSSam Leffler 	 * This is used if the certificate operations for EAP-TLS are performed
49939beb93cSSam Leffler 	 * using a smartcard.
50039beb93cSSam Leffler 	 */
50139beb93cSSam Leffler 	char *cert2_id;
50239beb93cSSam Leffler 
50339beb93cSSam Leffler 	/**
50439beb93cSSam Leffler 	 * ca_cert2_id - CA Cert ID for OpenSSL engine (phase2)
50539beb93cSSam Leffler 	 *
50639beb93cSSam Leffler 	 * This is used if the CA certificate for EAP-TLS is on a smartcard.
50739beb93cSSam Leffler 	 */
50839beb93cSSam Leffler 	char *ca_cert2_id;
50939beb93cSSam Leffler 
51039beb93cSSam Leffler 	/**
51139beb93cSSam Leffler 	 * otp - One-time-password
51239beb93cSSam Leffler 	 *
51339beb93cSSam Leffler 	 * This field should not be set in configuration step. It is only used
51439beb93cSSam Leffler 	 * internally when OTP is entered through the control interface.
51539beb93cSSam Leffler 	 */
51639beb93cSSam Leffler 	u8 *otp;
51739beb93cSSam Leffler 
51839beb93cSSam Leffler 	/**
51939beb93cSSam Leffler 	 * otp_len - Length of the otp field
52039beb93cSSam Leffler 	 */
52139beb93cSSam Leffler 	size_t otp_len;
52239beb93cSSam Leffler 
52339beb93cSSam Leffler 	/**
52439beb93cSSam Leffler 	 * pending_req_identity - Whether there is a pending identity request
52539beb93cSSam Leffler 	 *
52639beb93cSSam Leffler 	 * This field should not be set in configuration step. It is only used
52739beb93cSSam Leffler 	 * internally when control interface is used to request needed
52839beb93cSSam Leffler 	 * information.
52939beb93cSSam Leffler 	 */
53039beb93cSSam Leffler 	int pending_req_identity;
53139beb93cSSam Leffler 
53239beb93cSSam Leffler 	/**
53339beb93cSSam Leffler 	 * pending_req_password - Whether there is a pending password request
53439beb93cSSam Leffler 	 *
53539beb93cSSam Leffler 	 * This field should not be set in configuration step. It is only used
53639beb93cSSam Leffler 	 * internally when control interface is used to request needed
53739beb93cSSam Leffler 	 * information.
53839beb93cSSam Leffler 	 */
53939beb93cSSam Leffler 	int pending_req_password;
54039beb93cSSam Leffler 
54139beb93cSSam Leffler 	/**
54239beb93cSSam Leffler 	 * pending_req_pin - Whether there is a pending PIN request
54339beb93cSSam Leffler 	 *
54439beb93cSSam Leffler 	 * This field should not be set in configuration step. It is only used
54539beb93cSSam Leffler 	 * internally when control interface is used to request needed
54639beb93cSSam Leffler 	 * information.
54739beb93cSSam Leffler 	 */
54839beb93cSSam Leffler 	int pending_req_pin;
54939beb93cSSam Leffler 
55039beb93cSSam Leffler 	/**
55139beb93cSSam Leffler 	 * pending_req_new_password - Pending password update request
55239beb93cSSam Leffler 	 *
55339beb93cSSam Leffler 	 * This field should not be set in configuration step. It is only used
55439beb93cSSam Leffler 	 * internally when control interface is used to request needed
55539beb93cSSam Leffler 	 * information.
55639beb93cSSam Leffler 	 */
55739beb93cSSam Leffler 	int pending_req_new_password;
55839beb93cSSam Leffler 
55939beb93cSSam Leffler 	/**
56039beb93cSSam Leffler 	 * pending_req_passphrase - Pending passphrase request
56139beb93cSSam Leffler 	 *
56239beb93cSSam Leffler 	 * This field should not be set in configuration step. It is only used
56339beb93cSSam Leffler 	 * internally when control interface is used to request needed
56439beb93cSSam Leffler 	 * information.
56539beb93cSSam Leffler 	 */
56639beb93cSSam Leffler 	int pending_req_passphrase;
56739beb93cSSam Leffler 
56839beb93cSSam Leffler 	/**
56939beb93cSSam Leffler 	 * pending_req_otp - Whether there is a pending OTP request
57039beb93cSSam Leffler 	 *
57139beb93cSSam Leffler 	 * This field should not be set in configuration step. It is only used
57239beb93cSSam Leffler 	 * internally when control interface is used to request needed
57339beb93cSSam Leffler 	 * information.
57439beb93cSSam Leffler 	 */
57539beb93cSSam Leffler 	char *pending_req_otp;
57639beb93cSSam Leffler 
57739beb93cSSam Leffler 	/**
57839beb93cSSam Leffler 	 * pending_req_otp_len - Length of the pending OTP request
57939beb93cSSam Leffler 	 */
58039beb93cSSam Leffler 	size_t pending_req_otp_len;
58139beb93cSSam Leffler 
58239beb93cSSam Leffler 	/**
58339beb93cSSam Leffler 	 * pac_file - File path or blob name for the PAC entries (EAP-FAST)
58439beb93cSSam Leffler 	 *
58539beb93cSSam Leffler 	 * wpa_supplicant will need to be able to create this file and write
58639beb93cSSam Leffler 	 * updates to it when PAC is being provisioned or refreshed. Full path
58739beb93cSSam Leffler 	 * to the file should be used since working directory may change when
58839beb93cSSam Leffler 	 * wpa_supplicant is run in the background.
58939beb93cSSam Leffler 	 * Alternatively, a named configuration blob can be used by setting
59039beb93cSSam Leffler 	 * this to blob://blob_name.
59139beb93cSSam Leffler 	 */
59239beb93cSSam Leffler 	char *pac_file;
59339beb93cSSam Leffler 
59439beb93cSSam Leffler 	/**
59539beb93cSSam Leffler 	 * mschapv2_retry - MSCHAPv2 retry in progress
59639beb93cSSam Leffler 	 *
59739beb93cSSam Leffler 	 * This field is used internally by EAP-MSCHAPv2 and should not be set
59839beb93cSSam Leffler 	 * as part of configuration.
59939beb93cSSam Leffler 	 */
60039beb93cSSam Leffler 	int mschapv2_retry;
60139beb93cSSam Leffler 
60239beb93cSSam Leffler 	/**
60339beb93cSSam Leffler 	 * new_password - New password for password update
60439beb93cSSam Leffler 	 *
60539beb93cSSam Leffler 	 * This field is used during MSCHAPv2 password update. This is normally
60639beb93cSSam Leffler 	 * requested from the user through the control interface and not set
60739beb93cSSam Leffler 	 * from configuration.
60839beb93cSSam Leffler 	 */
60939beb93cSSam Leffler 	u8 *new_password;
61039beb93cSSam Leffler 
61139beb93cSSam Leffler 	/**
61239beb93cSSam Leffler 	 * new_password_len - Length of new_password field
61339beb93cSSam Leffler 	 */
61439beb93cSSam Leffler 	size_t new_password_len;
61539beb93cSSam Leffler 
61639beb93cSSam Leffler 	/**
61739beb93cSSam Leffler 	 * fragment_size - Maximum EAP fragment size in bytes (default 1398)
61839beb93cSSam Leffler 	 *
61939beb93cSSam Leffler 	 * This value limits the fragment size for EAP methods that support
62039beb93cSSam Leffler 	 * fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set
62139beb93cSSam Leffler 	 * small enough to make the EAP messages fit in MTU of the network
62239beb93cSSam Leffler 	 * interface used for EAPOL. The default value is suitable for most
62339beb93cSSam Leffler 	 * cases.
62439beb93cSSam Leffler 	 */
62539beb93cSSam Leffler 	int fragment_size;
62639beb93cSSam Leffler 
62739beb93cSSam Leffler #define EAP_CONFIG_FLAGS_PASSWORD_NTHASH BIT(0)
62839beb93cSSam Leffler 	/**
62939beb93cSSam Leffler 	 * flags - Network configuration flags (bitfield)
63039beb93cSSam Leffler 	 *
63139beb93cSSam Leffler 	 * This variable is used for internal flags to describe further details
63239beb93cSSam Leffler 	 * for the network parameters.
63339beb93cSSam Leffler 	 * bit 0 = password is represented as a 16-byte NtPasswordHash value
63439beb93cSSam Leffler 	 *         instead of plaintext password
63539beb93cSSam Leffler 	 */
63639beb93cSSam Leffler 	u32 flags;
63739beb93cSSam Leffler };
63839beb93cSSam Leffler 
63939beb93cSSam Leffler 
64039beb93cSSam Leffler /**
64139beb93cSSam Leffler  * struct wpa_config_blob - Named configuration blob
64239beb93cSSam Leffler  *
64339beb93cSSam Leffler  * This data structure is used to provide storage for binary objects to store
64439beb93cSSam Leffler  * abstract information like certificates and private keys inlined with the
64539beb93cSSam Leffler  * configuration data.
64639beb93cSSam Leffler  */
64739beb93cSSam Leffler struct wpa_config_blob {
64839beb93cSSam Leffler 	/**
64939beb93cSSam Leffler 	 * name - Blob name
65039beb93cSSam Leffler 	 */
65139beb93cSSam Leffler 	char *name;
65239beb93cSSam Leffler 
65339beb93cSSam Leffler 	/**
65439beb93cSSam Leffler 	 * data - Pointer to binary data
65539beb93cSSam Leffler 	 */
65639beb93cSSam Leffler 	u8 *data;
65739beb93cSSam Leffler 
65839beb93cSSam Leffler 	/**
65939beb93cSSam Leffler 	 * len - Length of binary data
66039beb93cSSam Leffler 	 */
66139beb93cSSam Leffler 	size_t len;
66239beb93cSSam Leffler 
66339beb93cSSam Leffler 	/**
66439beb93cSSam Leffler 	 * next - Pointer to next blob in the configuration
66539beb93cSSam Leffler 	 */
66639beb93cSSam Leffler 	struct wpa_config_blob *next;
66739beb93cSSam Leffler };
66839beb93cSSam Leffler 
66939beb93cSSam Leffler #endif /* EAP_CONFIG_H */
670