Skip to content

Commit 82f6765

Browse files
schwabecron2
authored andcommitted
Use const specifices in extract_x509_field_ssl
The new OpenSSL 4.0 will return const objects from these objects, so make them const in our code as well. Change-Id: Ia43bb88d9ddf2e82c638011353a64c770f2c2c0a Signed-off-by: Arne Schwabe <arne@rfc2549.org> Acked-by: Frank Lichtenheld <frank@lichtenheld.com> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1588 Message-Id: <20260326110658.25741-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36291.html Signed-off-by: Gert Doering <gert@greenie.muc.de> (cherry picked from commit 3316a18)
1 parent 4577a0d commit 82f6765

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/openvpn/ssl_verify_openssl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@ extract_x509_field_ssl(X509_NAME *x509, const char *field_name, char *out, size_
195195
{
196196
int lastpos = -1;
197197
int tmp = -1;
198-
X509_NAME_ENTRY *x509ne = NULL;
199-
ASN1_STRING *asn1 = NULL;
200198
unsigned char *buf = NULL;
201199

202200
ASN1_OBJECT *field_name_obj = OBJ_txt2obj(field_name, 0);
@@ -222,13 +220,13 @@ extract_x509_field_ssl(X509_NAME *x509, const char *field_name, char *out, size_
222220
return FAILURE;
223221
}
224222

225-
x509ne = X509_NAME_get_entry(x509, lastpos);
223+
const X509_NAME_ENTRY *x509ne = X509_NAME_get_entry(x509, lastpos);
226224
if (!x509ne)
227225
{
228226
return FAILURE;
229227
}
230228

231-
asn1 = X509_NAME_ENTRY_get_data(x509ne);
229+
const ASN1_STRING *asn1 = X509_NAME_ENTRY_get_data(x509ne);
232230
if (!asn1)
233231
{
234232
return FAILURE;

0 commit comments

Comments
 (0)