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 3316a18ebe)
This commit is contained in:
Arne Schwabe 2026-03-26 12:06:52 +01:00 committed by Gert Doering
parent 4577a0dc21
commit 82f676574d

View file

@ -195,8 +195,6 @@ extract_x509_field_ssl(X509_NAME *x509, const char *field_name, char *out, size_
{
int lastpos = -1;
int tmp = -1;
X509_NAME_ENTRY *x509ne = NULL;
ASN1_STRING *asn1 = NULL;
unsigned char *buf = NULL;
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_
return FAILURE;
}
x509ne = X509_NAME_get_entry(x509, lastpos);
const X509_NAME_ENTRY *x509ne = X509_NAME_get_entry(x509, lastpos);
if (!x509ne)
{
return FAILURE;
}
asn1 = X509_NAME_ENTRY_get_data(x509ne);
const ASN1_STRING *asn1 = X509_NAME_ENTRY_get_data(x509ne);
if (!asn1)
{
return FAILURE;