]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: use X509_ALGOR_get0 instead of reaching into X509_ALGOR
authorDavid Benjamin <davidben@google.com>
Thu, 5 Oct 2023 16:50:55 +0000 (12:50 -0400)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 6 Oct 2023 12:51:20 +0000 (14:51 +0200)
While the struct is still public in OpenSSL, there is a (somewhat
inconvenient) accessor. Use it to remain compatible if it becomes opaque
in the future.

Closes #12038

lib/vtls/openssl.c

index fcb7222399c17236088d9979832bbd4c260fb6e0..9f9c8d136a29bf29256f4bcdbdb19c1079d1c699 100644 (file)
@@ -466,7 +466,9 @@ CURLcode Curl_ossl_certchain(struct Curl_easy *data, SSL *ssl)
 
       X509_get0_signature(&psig, &sigalg, x);
       if(sigalg) {
-        i2a_ASN1_OBJECT(mem, sigalg->algorithm);
+        const ASN1_OBJECT *sigalgoid = NULL;
+        X509_ALGOR_get0(&sigalgoid, NULL, NULL, sigalg);
+        i2a_ASN1_OBJECT(mem, sigalgoid);
         push_certinfo("Signature Algorithm", i);
       }