Skip to content

Commit

Permalink
Disable TLS 1.3 support with mbed TLS
Browse files Browse the repository at this point in the history
As of version 3.5.0 the TLS-Exporter function is not yet implemented in
mbed TLS, and the exporter_master_secret is not exposed to the
application either. Falling back to an older PRF when claiming to use
TLS1.3 seems like false advertising.

Change-Id: If4e1c4af9831eb1090ccb3a3c4d3e76b413f0708
Signed-off-by: Max Fillinger <[email protected]>
Acked-by: Frank Lichtenheld <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg27453.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
mfil authored and cron2 committed Nov 15, 2023
1 parent 85fc834 commit efad93d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 deletions.
18 changes: 2 additions & 16 deletions README.mbedtls
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,5 @@ Plugin/Script features:

*************************************************************************

Mbed TLS 3 supports the TLS 1.3 protocol, but the implementation is not yet
complete. Therefore, using TLS 1.3 in the mbed TLS build of OpenVPN is not yet
supported.

Nevertheless, here are some pointers to make it work with mbed TLS 3.5.0:

* The stock configuration of mbed TLS does not support TLS 1.3. To enable it,
uncomment `#define MBEDTLS_SSL_PROTO_TLS1_3` in your mbedtls_config.h before
compiling the library.
* An OpenVPN client with mbed TLS cannot connect to a server with OpenSSL
using TLS 1.3.
* An OpenVPN client with OpenSSL *can* connect to a server using mbed TLS with
TLS 1.3, but *only* if `#define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE` has
been uncommented in mbedtls_config.h.

Note that none of these limitations apply to TLS 1.2.
Mbed TLS 3 has implemented (parts of) the TLS 1.3 protocol, but we have disabled
support in OpenVPN because the TLS-Exporter function is not yet implemented.
17 changes: 4 additions & 13 deletions src/openvpn/ssl_mbedtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,17 +980,15 @@ tls_ctx_personalise_random(struct tls_root_ctx *ctx)
int
tls_version_max(void)
{
#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
return TLS_VER_1_3;
#elif defined(MBEDTLS_SSL_PROTO_TLS1_2)
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
return TLS_VER_1_2;
#elif defined(MBEDTLS_SSL_PROTO_TLS1_1)
return TLS_VER_1_1;
#elif defined(MBEDTLS_SSL_PROTO_TLS1)
return TLS_VER_1_0;
#else /* if defined(MBEDTLS_SSL_PROTO_TLS1_3) */
#error "mbedtls is compiled without support for any version of TLS."
#endif
#else /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */
#error "mbedtls is compiled without support for TLS 1.0, 1.1 and 1.2."
#endif /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */
}

/**
Expand Down Expand Up @@ -1032,13 +1030,6 @@ tls_version_to_major_minor(int tls_ver, int *major, int *minor)
break;
#endif

#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
case TLS_VER_1_3:
*major = MBEDTLS_SSL_MAJOR_VERSION_3;
*minor = MBEDTLS_SSL_MINOR_VERSION_4;
break;
#endif

default:
msg(M_FATAL, "%s: invalid or unsupported TLS version %d", __func__, tls_ver);
break;
Expand Down

0 comments on commit efad93d

Please sign in to comment.