Attention is currently required from: Arne Schwabe.

Hello Arne Schwabe,

I'd like you to do a code review.
Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2214?usp=email

to review the following change.


Change subject: ssl_openssl: fix -Wsign-conversion in tls_ctx_set_tls_groups()
......................................................................

ssl_openssl: fix -Wsign-conversion in tls_ctx_set_tls_groups()

Since 7d46ff17 dropped the -Wsign-conversion pragma, LibreSSL and
AWS-LC builds fail: their SSL_CTX_set1_groups() takes a size_t length,
but glistlen is an int. OpenSSL 1.1.1's macro passes it to
SSL_CTX_ctrl() as a long, so add openssl_groups_len_t to pick the type
per library.

Change-Id: I33123fe621512376410765031fc9ae68cdd91a6c
Signed-off-by: Razvan Cojocaru <[email protected]>
---
M src/openvpn/openssl_compat.h
M src/openvpn/ssl_openssl.c
2 files changed, 9 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/14/2214/1

diff --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h
index 8309cee..ae182d2 100644
--- a/src/openvpn/openssl_compat.h
+++ b/src/openvpn/openssl_compat.h
@@ -61,6 +61,14 @@
 typedef uint64_t openssl_opt_t;
 #endif

+/* SSL_CTX_set1_groups() length: size_t in LibreSSL and AWS-LC, passed to
+ * SSL_CTX_ctrl() as long by OpenSSL 1.1.1's macro */
+#if defined(LIBRESSL_VERSION_NUMBER) || defined(OPENSSL_IS_AWSLC)
+typedef size_t openssl_groups_len_t;
+#else
+typedef long openssl_groups_len_t;
+#endif
+

 /* Functionality missing in LibreSSL before 3.5 */
 #if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x3050000fL
diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c
index 30ef383..b95de8e 100644
--- a/src/openvpn/ssl_openssl.c
+++ b/src/openvpn/ssl_openssl.c
@@ -535,7 +535,7 @@
     ALLOC_ARRAY_CLEAR_GC(glist, int, groups_count, &gc);

     /* Parse allowed ciphers, getting IDs */
-    int glistlen = 0;
+    openssl_groups_len_t glistlen = 0;
     char *tmp_groups = string_alloc(groups, &gc);

     const char *token;

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2214?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I33123fe621512376410765031fc9ae68cdd91a6c
Gerrit-Change-Number: 2214
Gerrit-PatchSet: 1
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to