]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-TLS: Extend TLS version config to allow TLS v1.3 to be disabled
authorJouni Malinen <j@w1.fi>
Tue, 1 May 2018 18:52:45 +0000 (21:52 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 1 May 2018 19:13:38 +0000 (22:13 +0300)
This may be needed to avoid interoperability issues with the new
protocol version and significant changes for EAP use cases in both key
derivation and handshake termination.

Signed-off-by: Jouni Malinen <j@w1.fi>
hostapd/config_file.c
src/crypto/tls.h
src/crypto/tls_openssl.c
src/eap_peer/eap_tls_common.c
wpa_supplicant/wpa_supplicant.conf

index bd52f4ae7b3961c366f436bb01312bd3b3fa5d8b..c2d2d6244fa7b6d534e0506677ad9be2fa953b68 100644 (file)
@@ -2150,6 +2150,8 @@ static unsigned int parse_tls_flags(const char *val)
                flags |= TLS_CONN_DISABLE_TLSv1_1;
        if (os_strstr(val, "[DISABLE-TLSv1.2]"))
                flags |= TLS_CONN_DISABLE_TLSv1_2;
+       if (os_strstr(val, "[DISABLE-TLSv1.3]"))
+               flags |= TLS_CONN_DISABLE_TLSv1_3;
        if (os_strstr(val, "[SUITEB]"))
                flags |= TLS_CONN_SUITEB;
        if (os_strstr(val, "[SUITEB-NO-ECDH]"))
index dc4117c38e9b48ee73d6212bde16992c038a45ec..585db8bbed179449d231b7ae539da4d7f2519b4f 100644 (file)
@@ -101,6 +101,7 @@ struct tls_config {
 #define TLS_CONN_REQUIRE_OCSP_ALL BIT(10)
 #define TLS_CONN_SUITEB BIT(11)
 #define TLS_CONN_SUITEB_NO_ECDH BIT(12)
+#define TLS_CONN_DISABLE_TLSv1_3 BIT(13)
 
 /**
  * struct tls_connection_params - Parameters for TLS connection
index c1da6d08bf9b0c4f3bb59d729d3b9baaad68201b..b4bfc9b7377bb421b48b0302ae647fe7d53aa703 100644 (file)
@@ -2470,6 +2470,12 @@ static int tls_set_conn_flags(struct tls_connection *conn, unsigned int flags,
        else
                SSL_clear_options(ssl, SSL_OP_NO_TLSv1_2);
 #endif /* SSL_OP_NO_TLSv1_2 */
+#ifdef SSL_OP_NO_TLSv1_3
+       if (flags & TLS_CONN_DISABLE_TLSv1_3)
+               SSL_set_options(ssl, SSL_OP_NO_TLSv1_3);
+       else
+               SSL_clear_options(ssl, SSL_OP_NO_TLSv1_3);
+#endif /* SSL_OP_NO_TLSv1_3 */
 #ifdef CONFIG_SUITEB
 #ifdef OPENSSL_IS_BORINGSSL
        /* Start with defaults from BoringSSL */
index a72cc08bd5dc14804cad6a04c3dc0452562035da..e0d8d43c82584733d320a5e1d3ff3527fb58f6e6 100644 (file)
@@ -80,6 +80,10 @@ static void eap_tls_params_flags(struct tls_connection_params *params,
                params->flags |= TLS_CONN_DISABLE_TLSv1_2;
        if (os_strstr(txt, "tls_disable_tlsv1_2=0"))
                params->flags &= ~TLS_CONN_DISABLE_TLSv1_2;
+       if (os_strstr(txt, "tls_disable_tlsv1_3=1"))
+               params->flags |= TLS_CONN_DISABLE_TLSv1_3;
+       if (os_strstr(txt, "tls_disable_tlsv1_3=0"))
+               params->flags &= ~TLS_CONN_DISABLE_TLSv1_3;
        if (os_strstr(txt, "tls_ext_cert_check=1"))
                params->flags |= TLS_CONN_EXT_CERT_CHECK;
        if (os_strstr(txt, "tls_ext_cert_check=0"))
index 5c478b69630675962deeb8c2cb38618f5152f4a5..892e73501c5cbd10590d12483b97590ddd625fc5 100644 (file)
@@ -1210,6 +1210,8 @@ fast_reauth=1
 #      that have issues interoperating with updated TLS version)
 # tls_disable_tlsv1_2=1 - disable use of TLSv1.2 (a workaround for AAA servers
 #      that have issues interoperating with updated TLS version)
+# tls_disable_tlsv1_3=1 - disable use of TLSv1.3 (a workaround for AAA servers
+#      that have issues interoperating with updated TLS version)
 # tls_ext_cert_check=0 - No external server certificate validation (default)
 # tls_ext_cert_check=1 - External server certificate validation enabled; this
 #      requires an external program doing validation of server certificate