From: "cron2 (Code Review)" Date: Thu, 26 Mar 2026 14:06:53 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="qRAJcMuIaTU="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: ssl_verify_openssl: use official ASN1_STRING_ API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --qRAJcMuIaTU= 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= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1584?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by plaisthos Change subject: ssl_verify_openssl: use official ASN1_STRING_ API ...................................................................... ssl_verify_openssl: use official ASN1_STRING_ API ASN1_STRING are now opaque types in OpenSSL 4.x =E2=80=94 the internal data= and length fields are no longer directly accessible. Use the accessor API instead. Accessors have been available since OpenSSL 1.1.0 The ASN1_STRING_length accessor is already in use, but not consistently applied. Standardise on using ASN1_STRING_length and ASN1_STRING_get0_data which allows for successful build of OpenSSL 4.x Change-Id: I8adffc3152b5b502a820a8ae0f901717e4831f81 Signed-off-by: Rudi Heitbaum Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1584 Message-Id: <20260323121908.730-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36= 254.html Signed-off-by: Gert Doering --- M src/openvpn/ssl_verify_openssl.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/84/1584/2 diff --git a/src/openvpn/ssl_verify_openssl.c b/src/openvpn/ssl_verify_open= ssl.c index 46401cd..d96879b 100644 --- a/src/openvpn/ssl_verify_openssl.c +++ b/src/openvpn/ssl_verify_openssl.c @@ -259,7 +259,7 @@ { ASN1_INTEGER *asn1_i =3D X509_get_serialNumber(peer_cert); struct gc_arena gc =3D gc_new(); - char *serial =3D format_hex_ex(asn1_i->data, asn1_i->length, 0, 1 = | FHE_CAPS, NULL, &gc); + char *serial =3D format_hex_ex(ASN1_STRING_get0_data(asn1_i), ASN1= _STRING_length(asn1_i), 0, 1 | FHE_CAPS, NULL, &gc); if (!serial || cn_len <=3D strlen(serial) + 2) { @@ -313,7 +313,7 @@ { const ASN1_INTEGER *asn1_i =3D X509_get_serialNumber(cert); - return format_hex_ex(asn1_i->data, asn1_i->length, 0, 1, ":", gc); + return format_hex_ex(ASN1_STRING_get0_data(asn1_i), ASN1_STRING_length= (asn1_i), 0, 1, ":", gc); } result_t @@ -626,7 +626,7 @@ { ASN1_BIT_STRING *ns; ns =3D X509_get_ext_d2i(peer_cert, NID_netscape_cert_type, NUL= L, NULL); - result =3D (ns && ns->length > 0 && (ns->data[0] & NS_SSL_CLIE= NT)) ? SUCCESS : FAILURE; + result =3D (ns && ASN1_STRING_length(ns) > 0 && (ASN1_STRING_g= et0_data(ns)[0] & NS_SSL_CLIENT)) ? SUCCESS : FAILURE; if (result =3D=3D SUCCESS) { msg(M_WARN, "X509: Certificate is a client certificate yet= it's purpose " @@ -654,7 +654,7 @@ { ASN1_BIT_STRING *ns; ns =3D X509_get_ext_d2i(peer_cert, NID_netscape_cert_type, NUL= L, NULL); - result =3D (ns && ns->length > 0 && (ns->data[0] & NS_SSL_SERV= ER)) ? SUCCESS : FAILURE; + result =3D (ns && ASN1_STRING_length(ns) > 0 && (ASN1_STRING_g= et0_data(ns)[0] & NS_SSL_SERVER)) ? SUCCESS : FAILURE; if (result =3D=3D SUCCESS) { msg(M_WARN, "X509: Certificate is a server certificate yet= it's purpose " -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1584?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: I8adffc3152b5b502a820a8ae0f901717e4831f81 Gerrit-Change-Number: 1584 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --qRAJcMuIaTU= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

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

View Change

The following approvals got outdated and were remove= d: Code-Review+2 by plaisthos

ssl_verify_openssl: use officia=
l ASN1_STRING_ API

ASN1_STRING are now opaque types in OpenSSL 4.x = =E2=80=94 the internal data and
length fields are no longer directly acc= essible. Use the accessor API
instead. Accessors have been available sin= ce OpenSSL 1.1.0

The ASN1_STRING_length accessor is already in use, = but not consistently
applied. Standardise on using ASN1_STRING_length an= d ASN1_STRING_get0_data
which allows for successful build of OpenSSL 4.x=

Change-Id: I8adffc3152b5b502a820a8ae0f901717e4831f81
Signed-off-= by: Rudi Heitbaum <rudi@...2993...>
Acked-by: Arne Schwabe <arn= e-openvpn@...1227...>
Gerrit URL: https://gerrit.openvpn.net/c/openvp= n/+/1584
Message-Id: <20260323121908.730-1-gert@...1296...>
URL= : https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36254= .html
Signed-off-by: Gert Doering <gert@...1296...>
---
M sr= c/openvpn/ssl_verify_openssl.c
1 file changed, 4 insertions(+), 4 deleti= ons(-)

git pull ssh://gerrit.openvpn.net:29418/o=
penvpn refs/changes/84/1584/2
diff --git a/src/openvpn/ssl_verify_o=
penssl.c b/src/openvpn/ssl_verify_openssl.c
index 46401cd..= d96879b 100644
--- a/src/openvpn/ssl_verify_openssl.c
+++ b/src/openvpn/ssl_verify_openssl.c
@@ -259,7= +259,7 @@
{
ASN1_INTEGER *as= n1_i =3D X509_get_serialNumber(peer_cert);
struct = gc_arena gc =3D gc_new();
- char *serial =3D format_hex_ex(asn1_i->data, asn1_i->leng= th, 0, 1 | FHE_CAPS, NULL, &gc);
+ char *serial =3D format_hex_ex(ASN1_STRING_get0_da= ta(asn1_i), ASN1_STRING_length(asn1_i), 0, 1 | FHE_CAPS, NULL, &gc);

if (!serial || cn_len <=3D strl= en(serial) + 2)
{
@@ -313,7 +313,7= @@
{
const ASN1_INTEGER *asn1_i =3D = X509_get_serialNumber(cert);

- return format_hex_ex(asn1_i->data, asn1_i-&= gt;length, 0, 1, ":", gc);
+ return format_hex_ex(ASN1_STRING_get0_data(asn1_i), AS= N1_STRING_length(asn1_i), 0, 1, ":", gc);
}

result_t
@@ -626,7 +626,7 @@=
{
ASN1_BIT_STRING *n= s;
ns =3D X509_get_ext_d2i(peer_cert, NID_nets= cape_cert_type, NULL, NULL);
- result =3D (ns && ns->length > 0 &&= ; (ns->data[0] & NS_SSL_CLIENT)) ? SUCCESS : FAILURE;
+ result =3D (ns &&a= mp; ASN1_STRING_length(ns) > 0 && (ASN1_STRING_get0_data(ns)[0] = & NS_SSL_CLIENT)) ? SUCCESS : FAILURE;

if = (result =3D=3D SUCCESS)
{
= msg(M_WARN, "X509: Certificate is a client certificate ye= t it's purpose "
@@ -654,7 +654,7 @@
{

ASN1_BIT_STRING *ns;
<= span> ns =3D X509_get_ext_d2i(peer_cert, NID_netscape_cert_type= , NULL, NULL);

- = result =3D (ns && ns->length > 0 && (ns->data= [0] & NS_SSL_SERVER)) ? SUCCESS : FAILURE;
+ result =3D (ns && ASN1_STRIN= G_length(ns) > 0 && (ASN1_STRING_get0_data(ns)[0] & NS_SSL_S= ERVER)) ? SUCCESS : FAILURE;
if (result =3D=3D= SUCCESS)
{
m= sg(M_WARN, "X509: Certificate is a server certificate yet it's pur= pose "

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8adffc3152b5b502a820a8ae0f9= 01717e4831f81
Gerrit-Change-Number: 1584
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --qRAJcMuIaTU=--