]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix OpenSSL 1.1.1 not using auto elliptic curve selection
authorArne Schwabe <arne@rfc2549.org>
Sat, 28 Mar 2020 04:08:58 +0000 (05:08 +0100)
committerGert Doering <gert@greenie.muc.de>
Wed, 15 Apr 2020 10:01:20 +0000 (12:01 +0200)
Commit 8a01147ff attempted to avoid calling the deprecated/noop
operation SSL_CTX_set_ecdh_auto by surrounding it with #ifdef.
Unfortunately, that change also made the return; that would exit
the function no longer being compiled when using OpenSSL 1.1.0+.
As consequence OpenVPN with OpenSSL 1.1.0+ would always set
secp384r1 as ecdh curve unless otherwise specified by ecdh

This patch restores the correct/previous behaviour.
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20200328040858.16505-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19630.html

Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/ssl_openssl.c

index 7f546e10cfe5573629dcbcf52eccadb41de026dc..d7bd6aa29c84a4e6c5afcc7ff3ff939a6d21c94e 100644 (file)
@@ -678,8 +678,11 @@ tls_ctx_load_ecdh_params(struct tls_root_ctx *ctx, const char *curve_name
         /* OpenSSL 1.0.2 and newer can automatically handle ECDH parameter
          * loading */
         SSL_CTX_set_ecdh_auto(ctx->ctx, 1);
-        return;
+
+        /* OpenSSL 1.1.0 and newer have always ecdh auto loading enabled,
+         * so do nothing */
 #endif
+        return;
 #else
         /* For older OpenSSL we have to extract the curve from key on our own */
         EC_KEY *eckey = NULL;