From: "cron2 (Code Review)" Date: Sun, 22 Mar 2026 12:03:17 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <011b4b199b043615c6ec6301a90f0479f1eb81f7-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="eOfHtxpX/CI="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Use openssl_err_t typedef to deal with difference between TLS libraries List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --eOfHtxpX/CI= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1578?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by flichtenheld Change subject: Use openssl_err_t typedef to deal with difference between T= LS libraries ...................................................................... Use openssl_err_t typedef to deal with difference between TLS libraries AWS-LC and OpenSSL disagree on the type of that errors are reported in. Instead of having a lot of glue code and casting back and forth, use a typedef to always use the right type. Change-Id: I4adbdf0c8b82fd7de309aa5f6f3b0c8157c5ffe7 Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1578 Message-Id: <20260322111131.8251-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36= 242.html Signed-off-by: Gert Doering --- M src/openvpn/crypto_openssl.c M src/openvpn/openssl_compat.h 2 files changed, 12 insertions(+), 3 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/78/1578/2 diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c index 19cb9a9..9900d06 100644 --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c @@ -229,7 +229,7 @@ void crypto_print_openssl_errors(const unsigned int flags) { - unsigned long err =3D 0; + openssl_err_t err =3D 0; int line, errflags; const char *file, *data, *func; diff --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h index ab011d3..8fdb39a 100644 --- a/src/openvpn/openssl_compat.h +++ b/src/openvpn/openssl_compat.h @@ -45,6 +45,15 @@ #include #include +/* Define the type of error. This is something that is less + * intrusive than casts everywhere */ +#if defined(OPENSSL_IS_AWSLC) +typedef uint32_t openssl_err_t; +#else +typedef unsigned long openssl_err_t; +#endif + + /* Functionality missing in 1.1.0 */ #if OPENSSL_VERSION_NUMBER < 0x10101000L && !defined(ENABLE_CRYPTO_WOLFSSL) #define SSL_CTX_set1_groups SSL_CTX_set1_curves @@ -157,12 +166,12 @@ /* OpenSSL 1.1.1 and lower use only const EVP_MD, nothing to free */ } -static inline unsigned long +static inline openssl_err_t ERR_get_error_all(const char **file, int *line, const char **func, const c= har **data, int *flags) { static const char *empty =3D ""; *func =3D empty; - unsigned long err =3D ERR_get_error_line_data(file, line, data, flags); + openssl_err_t err =3D ERR_get_error_line_data(file, line, data, flags); return err; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1578?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I4adbdf0c8b82fd7de309aa5f6f3b0c8157c5ffe7 Gerrit-Change-Number: 1578 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel --eOfHtxpX/CI= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #2 to the change originally created by plaisthos.<= /p>

Vi= ew Change

The following approvals got outdated and were removed: Code-Review+2 by flichtenheld

Use openssl_err_t typedef to=
 deal with difference between TLS libraries

AWS-LC and OpenSSL disag= ree on the type of that errors are reported in.

Instead of having a = lot of glue code and casting back and forth, use a
typedef to always use= the right type.

Change-Id: I4adbdf0c8b82fd7de309aa5f6f3b0c8157c5ffe= 7
Signed-off-by: Arne Schwabe <arne@...1227...>
Acked-by: Frank= Lichtenheld <frank@...2641...>
Gerrit URL: https://gerrit.openvpn= .net/c/openvpn/+/1578
Message-Id: <20260322111131.8251-1-gert@...1726...= ...>
URL: https://www.mail-archive.com/openvpn-devel@...1483...= e.net/msg36242.html
Signed-off-by: Gert Doering <gert@...1296...><= br>---
M src/openvpn/crypto_openssl.c
M src/openvpn/openssl_compat.h<= br>2 files changed, 12 insertions(+), 3 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/78/1578/2=
diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_ope=
nssl.c
index 19cb9a9..9900d06 100644
--- a/= src/openvpn/crypto_openssl.c
+++ b/src/openvpn/crypto_opens= sl.c
@@ -229,7 +229,7 @@
void
crypto_print_openssl_errors(const unsigned int flags)
= {
- unsigned long e= rr =3D 0;
+ openss= l_err_t err =3D 0;
int line, errflags;
const char *file, *data, *func;

dif= f --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h

index ab011d3..8fdb39a 100644
--- a/src/openvpn/= openssl_compat.h
+++ b/src/openvpn/openssl_compat.h<= br>@@ -45,6 +45,15 @@
#include <openssl/x509.h>= ;
#include <openssl/err.h>
<= br>+/* Define the type of error= . This is something that is less
+ * intrusive than casts everywhere */
+#if defined(OPENSSL_IS_AWSLC)
+typedef uint32_t openssl_err_t;

+#else
+typedef unsigned long openssl_err_t;=
+#endif
+
+
/* Functionality missing in 1.1.0= */
#if OPENSSL_VERSION_NUMBER < 0x10101000L &&= !defined(ENABLE_CRYPTO_WOLFSSL)
#define SSL_CTX_set1_grou= ps SSL_CTX_set1_curves
@@ -157,12 +166,12 @@
/* OpenSSL 1.1.1 and lower use only const EVP_MD, nothing to free */=
}

-static inline unsigned long
+static inline openssl_err_t
ERR_ge= t_error_all(const char **file, int *line, const char **func, const char **d= ata, int *flags)
{
static const char = *empty =3D "";
*func =3D empty;
- unsigned long err =3D ERR_get_= error_line_data(file, line, data, flags);
+ openssl_err_t err =3D ERR_get_error_line_data(fil= e, line, data, flags);
return err;
}<= /span>


To view, visit change 1578. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4adbdf0c8b82fd7de309aa5f6f3= b0c8157c5ffe7
Gerrit-Change-Number: 1578
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --eOfHtxpX/CI=--