Skip to contentSkip to conversation

configure: disable engines if OPENSSL_NO_ENGINE is defined

PATCH Superseded [email protected]... 3 participants 9 messages Sep 3, 2023 – Sep 8, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: disable engines if OPENSSL_NO_ENGINE is defined

From: orbea <[email protected]...>

Starting with LibreSSL 3.8.1 the engines have been removed which causes the OpenVPN build to fail. This can be solved during configure by checking if OPENSSL_NO_ENGINE is defined in opensslconf.h.

---
 configure.ac | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
configure.ac +2 -1
index 2f65cbd5..b5a835dc 100644
@@ -926,11 +926,12 @@ if test "${with_crypto_library}" = "openssl"; then
 	    AC_COMPILE_IFELSE(
 				    [AC_LANG_PROGRAM(
 					    [[
+	    #include <openssl/opensslconf.h>
 	    #include <openssl/opensslv.h>
 					    ]],
 					    [[
 	    /*	     Version encoding: MNNFFPPS - see opensslv.h for details */
-	    #if OPENSSL_VERSION_NUMBER >= 0x30000000L
+	    #if OPENSSL_VERSION_NUMBER >= 0x30000000L || defined(OPENSSL_NO_ENGINE)
 	    #error Engine supported disabled by default in OpenSSL 3.0+
 	    #endif
 					    ]]
Signature · 1 line
2.41.0
#1 lore raw

Hi,

Quoted 15 lines · On 03/09/2023 16:29, [email protected]... wrote:

From: orbea <[email protected]...>

Starting with LibreSSL 3.8.1 the engines have been removed which causes the OpenVPN build to fail. This can be solved during configure by checking if OPENSSL_NO_ENGINE is defined in opensslconf.h.

---
  configure.ac | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
configure.ac +0 -0
index 2f65cbd5..b5a835dc 100644
@@ -926,11 +926,12 @@ if test "${with_crypto_library}" = "openssl"; then
  	    AC_COMPILE_IFELSE(

configure.ac if test "${with_crypto_library}" = "openssl"; then · line 935

Quoted 10 lines
configure.ac +2 -1
  				    [AC_LANG_PROGRAM(
  					    [[
+	    #include <openssl/opensslconf.h>
  	    #include <openssl/opensslv.h>
  					    ]],
  					    [[
  	    /*	     Version encoding: MNNFFPPS - see opensslv.h for details */
-	    #if OPENSSL_VERSION_NUMBER >= 0x30000000L
+	    #if OPENSSL_VERSION_NUMBER >= 0x30000000L || defined(OPENSSL_NO_ENGINE)
  	    #error Engine supported disabled by default in OpenSSL 3.0+

Maybe the message should be changed now? Or we could have an entirely different message for this case?

Cheers,

Quoted 2 lines
configure.ac +0 -0
  	    #endif
  					    ]]
Signature · 1 line
Antonio Quartulli
author
#2 lore raw
Quoted 34 lines · On Sun, 3 Sep 2023 16:47:31 +0200 Antonio Quartulli <[email protected]...> wrote:

Hi,

Quoted 25 lines · On 03/09/2023 16:29, [email protected]... wrote:

From: orbea <[email protected]...>

Starting with LibreSSL 3.8.1 the engines have been removed which causes the OpenVPN build to fail. This can be solved during configure by checking if OPENSSL_NO_ENGINE is defined in opensslconf.h. ---

  configure.ac | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
configure.ac +0 -0
index 2f65cbd5..b5a835dc 100644
@@ -926,11 +926,12 @@ if test "${with_crypto_library}" = "openssl";

then AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[

configure.ac +1 -0
+	    #include <openssl/opensslconf.h>
  	    #include <openssl/opensslv.h>
  					    ]],
  					    [[
  	    /*	     Version encoding: MNNFFPPS - see

opensslv.h for details */

configure.ac +1 -1
-	    #if OPENSSL_VERSION_NUMBER >= 0x30000000L
+	    #if OPENSSL_VERSION_NUMBER >= 0x30000000L ||
Quoted 2 lines

defined(OPENSSL_NO_ENGINE) #error Engine supported disabled by default in OpenSSL 3.0+

Maybe the message should be changed now? Or we could have an entirely different message for this case?

Quoted 5 lines

Cheers,

Quoted 2 lines
  	    #endif
  					    ]]  

Do you think it might be preferable to only check OPENSSL_NO_ENGINE? I see other code bases such as Tor only checking that define.

author
#3 lore raw
Quoted 43 lines · On Sun, 3 Sep 2023 09:17:21 -0700 orbea <[email protected]...> wrote:
Quoted 34 lines · On Sun, 3 Sep 2023 16:47:31 +0200 Antonio Quartulli <[email protected]...> wrote:

Hi,

Quoted 25 lines · On 03/09/2023 16:29, [email protected]... wrote:

From: orbea <[email protected]...>

Starting with LibreSSL 3.8.1 the engines have been removed which causes the OpenVPN build to fail. This can be solved during configure by checking if OPENSSL_NO_ENGINE is defined in opensslconf.h. ---

  configure.ac | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
configure.ac +0 -0
index 2f65cbd5..b5a835dc 100644
@@ -926,11 +926,12 @@ if test "${with_crypto_library}" =

"openssl"; then AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[

configure.ac +1 -0
+	    #include <openssl/opensslconf.h>
  	    #include <openssl/opensslv.h>
  					    ]],
  					    [[
  	    /*	     Version encoding: MNNFFPPS - see

opensslv.h for details */

configure.ac +1 -1
-	    #if OPENSSL_VERSION_NUMBER >= 0x30000000L
+	    #if OPENSSL_VERSION_NUMBER >= 0x30000000L ||
Quoted 2 lines

defined(OPENSSL_NO_ENGINE) #error Engine supported disabled by default in OpenSSL 3.0+

Maybe the message should be changed now? Or we could have an entirely different message for this case?

Quoted 5 lines

Cheers,

Quoted 2 lines
  	    #endif
  					    ]]    
Quoted 8 lines

Do you think it might be preferable to only check OPENSSL_NO_ENGINE? I see other code bases such as Tor only checking that define.

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Here is a patch that preserves the version check and adds a second check for OPENSSL_NO_ENGINE which seems to also be useful for BoringSSL.

#4 lore raw

Hi,

Quoted 3 lines · orbea

Here is a patch that preserves the version check and adds a second check for OPENSSL_NO_ENGINE which seems to also be useful for BoringSSL.

I prefer this version, but I'll let other chime in.
On top of that I think we may need a proper v2 PATCH having no extra body, as I am not sure your message can be properly parsed by git-am.

Cheers,

Quoted 35 lines

From d6700ec0f5af2522bb4eb136d3760f5b1445c9d1 Mon Sep 17 00:00:00 2001
From: orbea <[email protected]...>
Date: Sat, 2 Sep 2023 23:06:22 -0700
Subject: [PATCH] configure: disable engines if OPENSSL_NO_ENGINE is defined

Starting with LibreSSL 3.8.1 the engines have been removed which causes the OpenVPN build to fail. This can be solved during configure by checking if OPENSSL_NO_ENGINE is defined in opensslconf.h.

---
  configure.ac | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
configure.ac +7 -1
index 2f65cbd5..1adfb9d4 100644
@@ -927,11 +927,17 @@ if test "${with_crypto_library}" = "openssl"; then
  				    [AC_LANG_PROGRAM(
  					    [[
  	    #include <openssl/opensslv.h>
+	    #include <openssl/opensslconf.h>
  					    ]],
  					    [[
  	    /*	     Version encoding: MNNFFPPS - see opensslv.h for details */
  	    #if OPENSSL_VERSION_NUMBER >= 0x30000000L
-	    #error Engine supported disabled by default in OpenSSL 3.0+
+	    #error Engine support disabled by default in OpenSSL 3.0+
+	    #endif
+
+	    /*	     BoringSSL and LibreSSL >= 3.8.1 removed engine support */
+	    #ifdef OPENSSL_NO_ENGINE
+	    #error Engine support disabled by default in openssl/opensslconf.h
  	    #endif
  					    ]]
  				    )],
Signature · 1 line
Antonio Quartulli
#5 lore raw

Hi,

Quoted 7 lines · Antonio Quartulli
Quoted 2 lines · orbea

Here is a patch that preserves the version check and adds a second check for OPENSSL_NO_ENGINE which seems to also be useful for BoringSSL.

I prefer this version, but I'll let other chime in.
On top of that I think we may need a proper v2 PATCH having no extra body, as I am not sure your message can be properly parsed by git-am.

It should be fine, and if not, I'll massage it to make it go in.

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
author
#6 lore raw
Quoted 8 lines · On Sun, 3 Sep 2023 21:22:15 +0200 Gert Doering <[email protected]...> wrote:

Hi,

Quoted 5 lines · Antonio Quartulli
Quoted 3 lines · orbea

Here is a patch that preserves the version check and adds a second check for OPENSSL_NO_ENGINE which seems to also be useful for BoringSSL.

Quoted 8 lines
Quoted 4 lines

I prefer this version, but I'll let other chime in.
On top of that I think we may need a proper v2 PATCH having no extra body, as I am not sure your message can be properly parsed by git-am.

It should be fine, and if not, I'll massage it to make it go in.

gert

Thank you, the patch was generated with 'git format-patch' so I would think 'git am' can consume it, but please let me know if there is anything else I can change.

#7 lore raw

Hi,

Quoted 3 lines · orbea

Thank you, the patch was generated with 'git format-patch' so I would think 'git am' can consume it, but please let me know if there is anything else I can change.

For the sake of the archives (so, nothing to do for you now) - what we usually do is, for a v2 of the patch, to tag it as such, and use git-send-email to send it

  $ git-send-email -v2 --in-reply-to=$original-message-id -1

this will make it show up with a nice "[PATCH v2]" on the list, threaded to the original v1.

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#8 lore raw
In reply to orbea

Hi,

so the v2 patch itself is good, but...

Quoted 2 lines · orbea

From d6700ec0f5af2522bb4eb136d3760f5b1445c9d1 Mon Sep 17 00:00:00 2001
From: orbea <[email protected]...>

... it would be really preferred to have a real author name here, and a "Signed-off-by:" line (git commit -s), and...

Quoted 7 lines

Date: Sat, 2 Sep 2023 23:06:22 -0700
Subject: [PATCH] configure: disable engines if OPENSSL_NO_ENGINE is defined

Starting with LibreSSL 3.8.1 the engines have been removed which causes the OpenVPN build to fail. This can be solved during configure by checking if OPENSSL_NO_ENGINE is defined in opensslconf.h.
---

[..]

Review

Quoted 4 lines
(quoted diff) +3 -0
+	    /*	     BoringSSL and LibreSSL >= 3.8.1 removed engine support */
+	    #ifdef OPENSSL_NO_ENGINE
+	    #error Engine support disabled by default in openssl/opensslconf.h
 	    #endif

... I think the "by default" needs to go from this #error - it's disabled, period. "disabled by default" is the OpenSSL 3.0 thing...

(The code change itself looks reasonable, and passes our GHA build farm with various OSes and mbedTLS / OpenSSL 1.1 / OpenSSL 3.0)

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...