]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Migrate to mbed TLS 2.x
authorSteffan Karger <steffan@karger.me>
Sun, 17 Apr 2016 18:35:42 +0000 (20:35 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 28 Apr 2016 12:31:01 +0000 (14:31 +0200)
commit86d8cd6860dfc74cb1a040ff8fe03140ebe7f930
tree4344bb2a514b1714af0476c5ec650a6d1cd40378
parentfab49d17d36053189cf504d57e53a8b0cb907f6f
Migrate to mbed TLS 2.x

PolarSSL / mbed TLS 1.3 is going end-of-life by 2016-12-31, so let's move
the master branch on to the 2.x series.

This patch purges all references to polarssl, except for file names and
some comments referring to 1.2 and earlier, which were never released as
'mbed TLS'.  A separate patch for the file names follows, so the real
changes are easier to spot without git-fu.

This patch intends to not change any behaviour.

The vast majority of this patch is just renaming functions and structs.
There are some small changes in the implementation:
 * In ssl_polarssl.c: the debug callback prototype changed, so our
   implementation changed a bit too.
 * in ssl_polarssl.c: the old polarssl ssl_context is now split into a
   mbedtls_ssl_config and mbedtls_ssl_context.  The intention is that
   mbedtls_ssl_config is shared among connections, and mbedtls_ssl_context
   contains the per-connection state.  That doesn't work for us, because
   we use per-connection verify callback data, while the verify callback
   is registered on mbed_tls_config.  Therefore we still need to init a
   mbed_tls_config struct for each connection.
 * in ssl_polarssl.c: the mbed bio handling changed, so our
   implementation changed a bit too.
 * in ssl_polarssl.c and ssl_verify_polarssl.c: the mbedtls x509 parse
   functions now fail if we don't provide a NUL-terminated string, so use
   strlen()+1 as the length argument to include the terminating NUL.

I tested this patch to work with:
 * 'make check' (with 2.0.0 and 2.2.1, other tests just with 2.2.1)
 * static key mode
 * TLS mode with PEM key file
 * TLS mode with password protected PEM key file
 * TLS mode with management-external-key
 * TLS mode with PKCS#11
 * TLS mode with inline ca/key/cert/dh

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1460918143-408-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11458
Signed-off-by: Gert Doering <gert@greenie.muc.de>
17 files changed:
configure.ac
include/openvpn-plugin.h.in
src/openvpn/crypto_backend.h
src/openvpn/crypto_polarssl.c
src/openvpn/crypto_polarssl.h
src/openvpn/options.c
src/openvpn/options.h
src/openvpn/pkcs11_polarssl.c
src/openvpn/plugin.h
src/openvpn/ssl.c
src/openvpn/ssl_backend.h
src/openvpn/ssl_polarssl.c
src/openvpn/ssl_polarssl.h
src/openvpn/ssl_verify.h
src/openvpn/ssl_verify_polarssl.c
src/openvpn/ssl_verify_polarssl.h
src/openvpn/syshead.h