]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Disable TLS Session Ticket extension by default for EAP-TLS/PEAP/TTLS
authorJouni Malinen <j@w1.fi>
Fri, 17 Aug 2012 19:26:28 +0000 (22:26 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 17 Aug 2012 19:26:28 +0000 (22:26 +0300)
Some deployed authentication servers seem to be unable to handle the TLS
Session Ticket extension (they are supposed to ignore unrecognized TLS
extensions, but end up rejecting the ClientHello instead). As a
workaround, disable use of TLS Sesson Ticket extension for EAP-TLS,
EAP-PEAP, and EAP-TTLS (EAP-FAST uses session ticket, so any server that
supports EAP-FAST does not need this workaround).

Signed-hostap: Jouni Malinen <j@w1.fi>

src/eap_peer/eap_fast.c
src/eap_peer/eap_peap.c
src/eap_peer/eap_tls.c
src/eap_peer/eap_tls_common.c
src/eap_peer/eap_tls_common.h
src/eap_peer/eap_ttls.c

index 31d9f7cf3ddd1db4d463b0d931ebd1324ff8bc9d..7ca5288ca26e3db145f87c71cb2f3f4df562a799 100644 (file)
@@ -169,7 +169,7 @@ static void * eap_fast_init(struct eap_sm *sm)
        data->phase2_type.vendor = EAP_VENDOR_IETF;
        data->phase2_type.method = EAP_TYPE_NONE;
 
-       if (eap_peer_tls_ssl_init(sm, &data->ssl, config)) {
+       if (eap_peer_tls_ssl_init(sm, &data->ssl, config, EAP_TYPE_FAST)) {
                wpa_printf(MSG_INFO, "EAP-FAST: Failed to initialize SSL.");
                eap_fast_deinit(sm, data);
                return NULL;
index 0caa77e2a47358e28ba0674d779cd11ff9715a4b..7fff1458a8af871ccf27fb57517838658357a51a 100644 (file)
@@ -159,7 +159,7 @@ static void * eap_peap_init(struct eap_sm *sm)
        data->phase2_type.vendor = EAP_VENDOR_IETF;
        data->phase2_type.method = EAP_TYPE_NONE;
 
-       if (eap_peer_tls_ssl_init(sm, &data->ssl, config)) {
+       if (eap_peer_tls_ssl_init(sm, &data->ssl, config, EAP_TYPE_PEAP)) {
                wpa_printf(MSG_INFO, "EAP-PEAP: Failed to initialize SSL.");
                eap_peap_deinit(sm, data);
                return NULL;
index ed52fb690fd98887d13846a263da772bd08abea2..1dd0e94f2376a53e8db896e704d93651b5aae878 100644 (file)
@@ -44,7 +44,7 @@ static void * eap_tls_init(struct eap_sm *sm)
        data->ssl_ctx = sm->init_phase2 && sm->ssl_ctx2 ? sm->ssl_ctx2 :
                sm->ssl_ctx;
 
-       if (eap_peer_tls_ssl_init(sm, &data->ssl, config)) {
+       if (eap_peer_tls_ssl_init(sm, &data->ssl, config, EAP_TYPE_TLS)) {
                wpa_printf(MSG_INFO, "EAP-TLS: Failed to initialize SSL.");
                eap_tls_deinit(sm, data);
                if (config->engine) {
index 3291048b098899f513a270c1e9ab86f19bf4a6f6..33f2f27bed735a8efcb2b183e16f9956717c014e 100644 (file)
@@ -103,6 +103,18 @@ static int eap_tls_params_from_conf(struct eap_sm *sm,
                                    struct eap_peer_config *config, int phase2)
 {
        os_memset(params, 0, sizeof(*params));
+       if (sm->workaround && data->eap_type != EAP_TYPE_FAST) {
+               /*
+                * Some deployed authentication servers seem to be unable to
+                * handle the TLS Session Ticket extension (they are supposed
+                * to ignore unrecognized TLS extensions, but end up rejecting
+                * the ClientHello instead). As a workaround, disable use of
+                * TLS Sesson Ticket extension for EAP-TLS, EAP-PEAP, and
+                * EAP-TTLS (EAP-FAST uses session ticket, so any server that
+                * supports EAP-FAST does not need this workaround).
+                */
+               params->flags |= TLS_CONN_DISABLE_SESSION_TICKET;
+       }
        if (phase2) {
                wpa_printf(MSG_DEBUG, "TLS: using phase2 config options");
                eap_tls_params_from_conf2(params, config);
@@ -186,13 +198,14 @@ static int eap_tls_init_connection(struct eap_sm *sm,
  * @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
  * @data: Data for TLS processing
  * @config: Pointer to the network configuration
+ * @eap_type: EAP method used in Phase 1 (EAP_TYPE_TLS/PEAP/TTLS/FAST)
  * Returns: 0 on success, -1 on failure
  *
  * This function is used to initialize shared TLS functionality for EAP-TLS,
  * EAP-PEAP, EAP-TTLS, and EAP-FAST.
  */
 int eap_peer_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data,
-                         struct eap_peer_config *config)
+                         struct eap_peer_config *config, u8 eap_type)
 {
        struct tls_connection_params params;
 
@@ -200,6 +213,7 @@ int eap_peer_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data,
                return -1;
 
        data->eap = sm;
+       data->eap_type = eap_type;
        data->phase2 = sm->init_phase2;
        data->ssl_ctx = sm->init_phase2 && sm->ssl_ctx2 ? sm->ssl_ctx2 :
                sm->ssl_ctx;
index 771385bc80df3249a79d1c4fb7ab07d69cbb52c6..58c44ac2e32b30cc8fee4ced94f7dd99b33580b7 100644 (file)
@@ -68,6 +68,11 @@ struct eap_ssl_data {
         * ssl_ctx - TLS library context to use for the connection
         */
        void *ssl_ctx;
+
+       /**
+        * eap_type - EAP method used in Phase 1 (EAP_TYPE_TLS/PEAP/TTLS/FAST)
+        */
+       u8 eap_type;
 };
 
 
@@ -82,7 +87,7 @@ struct eap_ssl_data {
 
 
 int eap_peer_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data,
-                         struct eap_peer_config *config);
+                         struct eap_peer_config *config, u8 eap_type);
 void eap_peer_tls_ssl_deinit(struct eap_sm *sm, struct eap_ssl_data *data);
 u8 * eap_peer_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data,
                             const char *label, size_t len);
index a250c1b4fe54e212ad411b3040acd21470519b80..9360a424c799a8240def25a44f2c9472ae620411 100644 (file)
@@ -110,7 +110,7 @@ static void * eap_ttls_init(struct eap_sm *sm)
                data->phase2_eap_type.method = EAP_TYPE_NONE;
        }
 
-       if (eap_peer_tls_ssl_init(sm, &data->ssl, config)) {
+       if (eap_peer_tls_ssl_init(sm, &data->ssl, config, EAP_TYPE_TTLS)) {
                wpa_printf(MSG_INFO, "EAP-TTLS: Failed to initialize SSL.");
                eap_ttls_deinit(sm, data);
                return NULL;