Gert Doering has submitted this change. ( https://gerrit.openvpn.net/c/openvpn/+/2214?usp=email )
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 CI builds fail: their SSL_CTX_set1_groups() takes a size_t length, but glistlen is an int. The buildbot LibreSSL builds pass because the headers also define SSL_CTX_set1_groups as a macro, and clang suppresses warnings in expansions of system header macros. CI includes the libraries with plain -I, so their headers aren't system headers and the warning fires. OpenSSL 1.1.1's macro passes the length 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]> Acked-by: Frank Lichtenheld <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2214 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg41565.html Signed-off-by: Gert Doering <[email protected]> --- M src/openvpn/openssl_compat.h M src/openvpn/ssl_openssl.c 2 files changed, 9 insertions(+), 1 deletion(-) 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: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I33123fe621512376410765031fc9ae68cdd91a6c Gerrit-Change-Number: 2214 Gerrit-PatchSet: 3 Gerrit-Owner: Răzvan Cojocaru <[email protected]> Gerrit-Reviewer: Arne Schwabe <[email protected]> Gerrit-Reviewer: Frank Lichtenheld <[email protected]> Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
