Fix typos in wpa_supplicant configuration parameter documentation
[mech_eap.git] / src / eap_peer / eap_config.h
index f07e83b..f980072 100644 (file)
@@ -1,15 +1,9 @@
 /*
  * EAP peer configuration data
- * Copyright (c) 2003-2008, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2003-2013, Jouni Malinen <j@w1.fi>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
  */
 
 #ifndef EAP_CONFIG_H
@@ -41,6 +35,9 @@ struct eap_peer_config {
         *
         * If not set, the identity field will be used for both unencrypted and
         * protected fields.
+        *
+        * This field can also be used with EAP-SIM/AKA/AKA' to store the
+        * pseudonym identity.
         */
        u8 *anonymous_identity;
 
@@ -83,10 +80,19 @@ struct eap_peer_config {
         * wpa_supplicant is run in the background.
         *
         * Alternatively, a named configuration blob can be used by setting
-        * this to blob://<blob name>.
+        * this to blob://blob_name.
+        *
+        * Alternatively, this can be used to only perform matching of the
+        * server certificate (SHA-256 hash of the DER encoded X.509
+        * certificate). In this case, the possible CA certificates in the
+        * server certificate chain are ignored and only the server certificate
+        * is verified. This is configured with the following format:
+        * hash:://server/sha256/cert_hash_in_hex
+        * For example: "hash://server/sha256/
+        * 5a1bc1296205e6fdbe3979728efe3920798885c1c4590b5f90f43222d239ca6a"
         *
         * On Windows, trusted CA certificates can be loaded from the system
-        * certificate store by setting this to cert_store://<name>, e.g.,
+        * certificate store by setting this to cert_store://name, e.g.,
         * ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT".
         * Note that when running wpa_supplicant as an application, the user
         * certificate store (My user account) is used, whereas computer store
@@ -115,7 +121,7 @@ struct eap_peer_config {
         * wpa_supplicant is run in the background.
         *
         * Alternatively, a named configuration blob can be used by setting
-        * this to blob://<blob name>.
+        * this to blob://blob_name.
         */
        u8 *client_cert;
 
@@ -142,7 +148,7 @@ struct eap_peer_config {
         * (Computer account) is used when running wpasvc as a service.
         *
         * Alternatively, a named configuration blob can be used by setting
-        * this to blob://<blob name>.
+        * this to blob://blob_name.
         */
        u8 *private_key;
 
@@ -151,7 +157,7 @@ struct eap_peer_config {
         *
         * If left out, this will be asked through control interface.
         */
-       u8 *private_key_passwd;
+       char *private_key_passwd;
 
        /**
         * dh_file - File path to DH/DSA parameters file (in PEM format)
@@ -167,7 +173,7 @@ struct eap_peer_config {
         * wpa_supplicant is run in the background.
         *
         * Alternatively, a named configuration blob can be used by setting
-        * this to blob://<blob name>.
+        * this to blob://blob_name.
         */
        u8 *dh_file;
 
@@ -175,11 +181,15 @@ struct eap_peer_config {
         * subject_match - Constraint for server certificate subject
         *
         * This substring is matched against the subject of the authentication
-        * server certificate. If this string is set, the server sertificate is
+        * server certificate. If this string is set, the server certificate is
         * only accepted if it contains this string in the subject. The subject
         * string is in following format:
         *
         * /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@n.example.com
+        *
+        * Note: Since this is a substring match, this cannot be used securely
+        * to do a suffix match against a possible domain name in the CN entry.
+        * For such a use case, domain_suffix_match should be used instead.
         */
        u8 *subject_match;
 
@@ -188,7 +198,7 @@ struct eap_peer_config {
         *
         * Semicolon separated string of entries to be matched against the
         * alternative subject name of the authentication server certificate.
-        * If this string is set, the server sertificate is only accepted if it
+        * If this string is set, the server certificate is only accepted if it
         * contains one of the entries in an alternative subject name
         * extension.
         *
@@ -202,6 +212,39 @@ struct eap_peer_config {
        u8 *altsubject_match;
 
        /**
+        * domain_suffix_match - Constraint for server domain name
+        *
+        * If set, this FQDN is used as a suffix match requirement for the
+        * server certificate in SubjectAltName dNSName element(s). If a
+        * matching dNSName is found, this constraint is met. If no dNSName
+        * values are present, this constraint is matched against SubjectName CN
+        * using same suffix match comparison. Suffix match here means that the
+        * host/domain name is compared one label at a time starting from the
+        * top-level domain and all the labels in domain_suffix_match shall be
+        * included in the certificate. The certificate may include additional
+        * sub-level labels in addition to the required labels.
+        *
+        * For example, domain_suffix_match=example.com would match
+        * test.example.com but would not match test-example.com.
+        */
+       char *domain_suffix_match;
+
+       /**
+        * domain_match - Constraint for server domain name
+        *
+        * If set, this FQDN is used as a full match requirement for the
+        * server certificate in SubjectAltName dNSName element(s). If a
+        * matching dNSName is found, this constraint is met. If no dNSName
+        * values are present, this constraint is matched against SubjectName CN
+        * using same full match comparison. This behavior is similar to
+        * domain_suffix_match, but has the requirement of a full match, i.e.,
+        * no subdomains or wildcard matches are allowed. Case-insensitive
+        * comparison is used, so "Example.com" matches "example.com", but would
+        * not match "test.Example.com".
+        */
+       char *domain_match;
+
+       /**
         * ca_cert2 - File path to CA certificate file (PEM/DER) (Phase 2)
         *
         * This file can have one or more trusted CA certificates. If ca_cert2
@@ -215,7 +258,7 @@ struct eap_peer_config {
         * EAP-TTLS/PEAP/FAST tunnel) authentication.
         *
         * Alternatively, a named configuration blob can be used by setting
-        * this to blob://<blob name>.
+        * this to blob://blob_name.
         */
        u8 *ca_cert2;
 
@@ -242,7 +285,7 @@ struct eap_peer_config {
         * wpa_supplicant is run in the background.
         *
         * Alternatively, a named configuration blob can be used by setting
-        * this to blob://<blob name>.
+        * this to blob://blob_name.
         */
        u8 *client_cert2;
 
@@ -255,7 +298,7 @@ struct eap_peer_config {
         * wpa_supplicant is run in the background.
         *
         * Alternatively, a named configuration blob can be used by setting
-        * this to blob://<blob name>.
+        * this to blob://blob_name.
         */
        u8 *private_key2;
 
@@ -265,7 +308,7 @@ struct eap_peer_config {
         * This field is like private_key_passwd, but used for phase 2 (inside
         * EAP-TTLS/PEAP/FAST tunnel) authentication.
         */
-       u8 *private_key2_passwd;
+       char *private_key2_passwd;
 
        /**
         * dh_file2 - File path to DH/DSA parameters file (in PEM format)
@@ -276,7 +319,7 @@ struct eap_peer_config {
         * wpa_supplicant is run in the background.
         *
         * Alternatively, a named configuration blob can be used by setting
-        * this to blob://<blob name>.
+        * this to blob://blob_name.
         */
        u8 *dh_file2;
 
@@ -297,6 +340,22 @@ struct eap_peer_config {
        u8 *altsubject_match2;
 
        /**
+        * domain_suffix_match2 - Constraint for server domain name
+        *
+        * This field is like domain_suffix_match, but used for phase 2 (inside
+        * EAP-TTLS/PEAP/FAST tunnel) authentication.
+        */
+       char *domain_suffix_match2;
+
+       /**
+        * domain_match2 - Constraint for server domain name
+        *
+        * This field is like domain_match, but used for phase 2 (inside
+        * EAP-TTLS/PEAP/FAST tunnel) authentication.
+        */
+       char *domain_match2;
+
+       /**
         * eap_methods - Allowed EAP methods
         *
         * (vendor=EAP_VENDOR_IETF,method=EAP_TYPE_NONE) terminated list of
@@ -344,18 +403,31 @@ struct eap_peer_config {
         * 2 = allow authenticated provisioning,
         * 3 = allow both unauthenticated and authenticated provisioning
         *
-        * fast_max_pac_list_len=<num> option can be used to set the maximum
+        * fast_max_pac_list_len=num option can be used to set the maximum
         * number of PAC entries to store in a PAC list (default: 10).
         *
         * fast_pac_format=binary option can be used to select binary format
-        * for storing PAC entires in order to save some space (the default
+        * for storing PAC entries in order to save some space (the default
         * text format uses about 2.5 times the size of minimal binary format).
         *
         * crypto_binding option can be used to control PEAPv0 cryptobinding
         * behavior:
-        * 0 = do not use cryptobinding
-        * 1 = use cryptobinding if server supports it (default)
+        * 0 = do not use cryptobinding (default)
+        * 1 = use cryptobinding if server supports it
         * 2 = require cryptobinding
+        *
+        * EAP-WSC (WPS) uses following options: pin=Device_Password and
+        * uuid=Device_UUID
+        *
+        * For wired IEEE 802.1X authentication, "allow_canned_success=1" can be
+        * used to configure a mode that allows EAP-Success (and EAP-Failure)
+        * without going through authentication step. Some switches use such
+        * sequence when forcing the port to be authorized/unauthorized or as a
+        * fallback option if the authentication server is unreachable. By
+        * default, wpa_supplicant discards such frames to protect against
+        * potential attacks by rogue devices, but this option can be used to
+        * disable that protection for cases where the server/authenticator does
+        * not need to be authenticated.
         */
        char *phase1;
 
@@ -363,7 +435,9 @@ struct eap_peer_config {
         * phase2 - Phase2 (inner authentication with TLS tunnel) parameters
         *
         * String with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
-        * "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS.
+        * "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS. "mschapv2_retry=0" can
+        * be used to disable MSCHAPv2 password retry in authentication failure
+        * cases.
         */
        char *phase2;
 
@@ -409,6 +483,47 @@ struct eap_peer_config {
        char *engine_id;
 
        /**
+        * engine2 - Enable OpenSSL engine (e.g., for smartcard) (Phase 2)
+        *
+        * This is used if private key operations for EAP-TLS are performed
+        * using a smartcard.
+        *
+        * This field is like engine, but used for phase 2 (inside
+        * EAP-TTLS/PEAP/FAST tunnel) authentication.
+        */
+       int engine2;
+
+
+       /**
+        * pin2 - PIN for USIM, GSM SIM, and smartcards (Phase 2)
+        *
+        * This field is used to configure PIN for SIM and smartcards for
+        * EAP-SIM and EAP-AKA. In addition, this is used with EAP-TLS if a
+        * smartcard is used for private key operations.
+        *
+        * This field is like pin2, but used for phase 2 (inside
+        * EAP-TTLS/PEAP/FAST tunnel) authentication.
+        *
+        * If left out, this will be asked through control interface.
+        */
+       char *pin2;
+
+       /**
+        * engine2_id - Engine ID for OpenSSL engine (Phase 2)
+        *
+        * "opensc" to select OpenSC engine or "pkcs11" to select PKCS#11
+        * engine.
+        *
+        * This is used if private key operations for EAP-TLS are performed
+        * using a smartcard.
+        *
+        * This field is like engine_id, but used for phase 2 (inside
+        * EAP-TTLS/PEAP/FAST tunnel) authentication.
+        */
+       char *engine2_id;
+
+
+       /**
         * key_id - Key ID for OpenSSL engine
         *
         * This is used if private key operations for EAP-TLS are performed
@@ -417,6 +532,44 @@ struct eap_peer_config {
        char *key_id;
 
        /**
+        * cert_id - Cert ID for OpenSSL engine
+        *
+        * This is used if the certificate operations for EAP-TLS are performed
+        * using a smartcard.
+        */
+       char *cert_id;
+
+       /**
+        * ca_cert_id - CA Cert ID for OpenSSL engine
+        *
+        * This is used if the CA certificate for EAP-TLS is on a smartcard.
+        */
+       char *ca_cert_id;
+
+       /**
+        * key2_id - Key ID for OpenSSL engine (phase2)
+        *
+        * This is used if private key operations for EAP-TLS are performed
+        * using a smartcard.
+        */
+       char *key2_id;
+
+       /**
+        * cert2_id - Cert ID for OpenSSL engine (phase2)
+        *
+        * This is used if the certificate operations for EAP-TLS are performed
+        * using a smartcard.
+        */
+       char *cert2_id;
+
+       /**
+        * ca_cert2_id - CA Cert ID for OpenSSL engine (phase2)
+        *
+        * This is used if the CA certificate for EAP-TLS is on a smartcard.
+        */
+       char *ca_cert2_id;
+
+       /**
         * otp - One-time-password
         *
         * This field should not be set in configuration step. It is only used
@@ -496,7 +649,7 @@ struct eap_peer_config {
         * to the file should be used since working directory may change when
         * wpa_supplicant is run in the background.
         * Alternatively, a named configuration blob can be used by setting
-        * this to blob://<blob name>.
+        * this to blob://blob_name.
         */
        char *pac_file;
 
@@ -534,6 +687,7 @@ struct eap_peer_config {
        int fragment_size;
 
 #define EAP_CONFIG_FLAGS_PASSWORD_NTHASH BIT(0)
+#define EAP_CONFIG_FLAGS_EXT_PASSWORD BIT(1)
        /**
         * flags - Network configuration flags (bitfield)
         *
@@ -541,8 +695,64 @@ struct eap_peer_config {
         * for the network parameters.
         * bit 0 = password is represented as a 16-byte NtPasswordHash value
         *         instead of plaintext password
+        * bit 1 = password is stored in external storage; the value in the
+        *         password field is the name of that external entry
         */
        u32 flags;
+
+       /**
+        * ocsp - Whether to use/require OCSP to check server certificate
+        *
+        * 0 = do not use OCSP stapling (TLS certificate status extension)
+        * 1 = try to use OCSP stapling, but not require response
+        * 2 = require valid OCSP stapling response
+        */
+       int ocsp;
+
+       /**
+        * external_sim_resp - Response from external SIM processing
+        *
+        * This field should not be set in configuration step. It is only used
+        * internally when control interface is used to request external
+        * SIM/USIM processing.
+        */
+       char *external_sim_resp;
+
+       /**
+        * sim_num - User selected SIM identifier
+        *
+        * This variable is used for identifying which SIM is used if the system
+        * has more than one.
+        */
+       int sim_num;
+
+       /**
+        * openssl_ciphers - OpenSSL cipher string
+        *
+        * This is an OpenSSL specific configuration option for configuring the
+        * ciphers for this connection. If not set, the default cipher suite
+        * list is used.
+        */
+       char *openssl_ciphers;
+
+       /**
+        * erp - Whether EAP Re-authentication Protocol (ERP) is enabled
+        */
+       int erp;
+
+       /**
+        * pending_ext_cert_check - External server certificate check status
+        *
+        * This field should not be set in configuration step. It is only used
+        * internally when control interface is used to request external
+        * validation of server certificate chain.
+        */
+       enum {
+               NO_CHECK = 0,
+               PENDING_CHECK,
+               EXT_CERT_CHECK_GOOD,
+               EXT_CERT_CHECK_BAD,
+       } pending_ext_cert_check;
 };