Skip to contentSkip to conversation

Disable external ec key support when building with libressl

PATCH In review [email protected]... 3 participants 3 messages Feb 21, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Disable external ec key support when building with libressl

From: Selva Nair <[email protected]...>

- This codepath uses some openssl-1.1 specific API and is enabled only for openssl 1.1 and higher versions. But, due to incompatible version numbering in libressl, it gets wrongly enabled with libressl versions that do not support the reqired API. As an easy workaround disable the feature when LIBRESSL_VERSION_NUMBER is defined.

---
Caution: Only partially compile tested on freebsd 11 + libressl 2.6.4 due to other conflicts with that version of libressl.

 src/openvpn/ssl_openssl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/openvpn/ssl_openssl.c +2 -2
index 56b12b7..d91458b 100644
@@ -1159,7 +1159,7 @@ err:
     return 0;
 }
 
-#if OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(OPENSSL_NO_EC)
+#if OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(OPENSSL_NO_EC) && !defined(LIBRESSL_VERSION_NUMBER)
 
 /* called when EC_KEY is destroyed */
 static void
@@ -1307,7 +1307,7 @@ tls_ctx_use_external_private_key(struct tls_root_ctx *ctx,
             goto err;
         }
     }
-#if OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(OPENSSL_NO_EC)
+#if OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(OPENSSL_NO_EC) && !defined(LIBRESSL_VERSION_NUMBER)
     else if (EVP_PKEY_id(pkey) == EVP_PKEY_EC)
     {
         if (!tls_ctx_use_external_ec_key(ctx, pkey))
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw

Am 21.02.18 um 17:46 schrieb [email protected]...:

Quoted 8 lines

From: Selva Nair <[email protected]...>

- This codepath uses some openssl-1.1 specific API and is enabled only for openssl 1.1 and higher versions. But, due to incompatible version numbering in libressl, it gets wrongly enabled with libressl versions that do not support the reqired API. As an easy workaround disable the feature when LIBRESSL_VERSION_NUMBER is defined.

I will reluctantly ACK this because LibreSSL will not fix their stuff.

Acked-by Arne Schwabe

I have not tested this to compile but the code looks good.

Arne

Acked-by on v1 1/1
#2 lore raw
In reply to [email protected]...

Tested on the OpenBSD 6.0 buildslave that was failing previously, and things are happy now (did not test "FreeBSD + LibreSSL", that's a different issue which we might want to fix, but since it's not the default SSL library there, it's not as annoying as OpenBSD breakage. FTR, OpenBSD 6.0 has LibreSSL 2.4.2, so that could explain the difference...).

Your patch has been applied to the master branch.

commit 028b501734b4a57dc53edb8b11a4b370f5b99e38

Author: Selva Nair
Date:   Wed Feb 21 11:46:02 2018 -0500
     Disable external ec key support when building with libressl

     Signed-off-by: Selva Nair <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg16510.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering