From: "cron2 (Code Review)" Date: Mon, 19 Jan 2026 17:06:56 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., matthias.andree@...68..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <6cbc9897ca18366995708019da89a417ff6fea86-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="KVUjO4qRASY="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos , mandree Cc: openvpn-devel --KVUjO4qRASY= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#5) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1445?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+1 by mandree, Code-Review+2 by cron2 Change subject: ssl_verify_openssl: Avoid conversion warning in x509_verify= _cert_ku ...................................................................... ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku Just use the correct types. v2: - Change type of expected_len argument to size_t Change-Id: Ia6c3f0395bd6cd67064fe77420d9df2b66763049 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1445 Message-Id: <20260119122058.14865-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 322.html Signed-off-by: Gert Doering --- M src/openvpn/ssl_verify_backend.h M src/openvpn/ssl_verify_mbedtls.c M src/openvpn/ssl_verify_openssl.c 3 files changed, 5 insertions(+), 14 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/1445/5 diff --git a/src/openvpn/ssl_verify_backend.h b/src/openvpn/ssl_verify_back= end.h index 0a2de03..9272cae 100644 --- a/src/openvpn/ssl_verify_backend.h +++ b/src/openvpn/ssl_verify_backend.h @@ -240,7 +240,7 @@ * if key usage is not enabled, or the values do not = match. */ result_t x509_verify_cert_ku(openvpn_x509_cert_t *x509, const unsigned *co= nst expected_ku, - int expected_len); + size_t expected_len); /* * Verify X.509 extended key usage extension field. diff --git a/src/openvpn/ssl_verify_mbedtls.c b/src/openvpn/ssl_verify_mbed= tls.c index 80396f8..9d89a1d 100644 --- a/src/openvpn/ssl_verify_mbedtls.c +++ b/src/openvpn/ssl_verify_mbedtls.c @@ -486,7 +486,7 @@ } result_t -x509_verify_cert_ku(mbedtls_x509_crt *cert, const unsigned *const expected= _ku, int expected_len) +x509_verify_cert_ku(mbedtls_x509_crt *cert, const unsigned int *const expe= cted_ku, size_t expected_len) { msg(D_HANDSHAKE, "Validating certificate key usage"); diff --git a/src/openvpn/ssl_verify_openssl.c b/src/openvpn/ssl_verify_open= ssl.c index 4f6573d..60d5756 100644 --- a/src/openvpn/ssl_verify_openssl.c +++ b/src/openvpn/ssl_verify_openssl.c @@ -670,13 +670,8 @@ return FAILURE; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - result_t -x509_verify_cert_ku(X509 *x509, const unsigned *const expected_ku, int exp= ected_len) +x509_verify_cert_ku(X509 *x509, const unsigned int *const expected_ku, siz= e_t expected_len) { ASN1_BIT_STRING *ku =3D X509_get_ext_d2i(x509, NID_key_usage, NULL, NU= LL); @@ -693,8 +688,8 @@ return SUCCESS; } - unsigned nku =3D 0; - for (size_t i =3D 0; i < 8; i++) + unsigned int nku =3D 0; + for (int i =3D 0; i < 8; i++) { if (ASN1_BIT_STRING_get_bit(ku, i)) { @@ -734,10 +729,6 @@ return fFound; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - result_t x509_verify_cert_eku(X509 *x509, const char *const expected_oid) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1445?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: Ia6c3f0395bd6cd67064fe77420d9df2b66763049 Gerrit-Change-Number: 1445 Gerrit-PatchSet: 5 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: mandree Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --KVUjO4qRASY= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #5 to the change originally created by flichtenhel= d.

View Change

The following approvals got outdated and were remove= d: Code-Review+1 by mandree, Code-Review+2 by cron2

ssl_verif=
y_openssl: Avoid conversion warning in x509_verify_cert_ku

Just use = the correct types.

v2:
- Change type of expected_len argument to= size_t

Change-Id: Ia6c3f0395bd6cd67064fe77420d9df2b66763049
Sign= ed-off-by: Frank Lichtenheld <frank@...2641...>
Acked-by: Gert Doe= ring <gert@...1296...>
Gerrit URL: https://gerrit.openvpn.net/c/op= envpn/+/1445
Message-Id: <20260119122058.14865-1-gert@...1296...><= br>URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/ms= g35322.html
Signed-off-by: Gert Doering <gert@...1296...>
---M src/openvpn/ssl_verify_backend.h
M src/openvpn/ssl_verify_mbedtls.c<= br>M src/openvpn/ssl_verify_openssl.c
3 files changed, 5 insertions(+), = 14 deletions(-)

git pull ssh://gerrit.openvpn.ne=
t:29418/openvpn refs/changes/45/1445/5
diff --git a/src/openvpn/ssl=
_verify_backend.h b/src/openvpn/ssl_verify_backend.h
index = 0a2de03..9272cae 100644
--- a/src/openvpn/ssl_verify_backen= d.h
+++ b/src/openvpn/ssl_verify_backend.h
= @@ -240,7 +240,7 @@
* if key usage i= s not enabled, or the values do not match.
*/
<= span> result_t x509_verify_cert_ku(openvpn_x509_cert_t *x509, const unsigne= d *const expected_ku,
-= int expected_len);
+ size_t expected_le= n);

/*
* Verify X.509 = extended key usage extension field.
diff --git a/src/openvp= n/ssl_verify_mbedtls.c b/src/openvpn/ssl_verify_mbedtls.c
i= ndex 80396f8..9d89a1d 100644
--- a/src/openvpn/ssl_verify_m= bedtls.c
+++ b/src/openvpn/ssl_verify_mbedtls.c
<= span>@@ -486,7 +486,7 @@
}

result_t
-x509_veri= fy_cert_ku(mbedtls_x509_crt *cert, const unsigned *const expected_ku, int e= xpected_len)
+x509_ve= rify_cert_ku(mbedtls_x509_crt *cert, const unsigned int *const expected_ku,= size_t expected_len)
{
msg(D_HANDSHA= KE, "Validating certificate key usage");
=
diff --git a/src/openvpn/ssl_verify_openssl.c b/src/openvpn/ssl_v= erify_openssl.c
index 4f6573d..60d5756 100644
--- a/src/openvpn/ssl_verify_openssl.c
+++ b/src/openvpn= /ssl_verify_openssl.c
@@ -670,13 +670,8 @@
= return FAILURE;
}

-#if defined(__GNUC__) || defined(__clan= g__)
-#pragma GCC diagn= ostic push
-#pragma GCC= diagnostic ignored "-Wconversion"
-#endif
-
result_t
-x509_verify_cert_ku(X509 *x509, const unsigned *const expected= _ku, int expected_len)
- unsigned nku =3D 0;
- for (size_t i =3D 0; i < 8; i++)+ unsigned int nku =3D 0;
+ for (int i =3D 0;= i < 8; i++)
{
if (ASN1_BI= T_STRING_get_bit(ku, i))
{
@@ -734= ,10 +729,6 @@
return fFound;
}=

-#if define= d(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
result_t
x509_verify_cert_eku(X509 *x5= 09, const char *const expected_oid)
{

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c3f0395bd6cd67064fe77420d= 9df2b66763049
Gerrit-Change-Number: 1445
Gerrit-PatchSet: 5
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: mandree <matthias.andree@...220...= ..68...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --KVUjO4qRASY=--