]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Use const specifices in extract_x509_field_ssl
authorArne Schwabe <arne@rfc2549.org>
Thu, 26 Mar 2026 11:06:52 +0000 (12:06 +0100)
committerGert Doering <gert@greenie.muc.de>
Thu, 26 Mar 2026 14:17:35 +0000 (15:17 +0100)
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 3316a18ebe6669d5e31b17ab0356a533b846d1bc)

src/openvpn/ssl_verify_openssl.c

index d96879bdb32525e02bb633d2df63af1f1519adbc..08946cdce0d885b314d2d6149923ce39deda01fe 100644 (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;