From 3ea67a31096d57f23d31e25f6f8bb3d2fac439fb Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Fri, 12 Jul 2024 14:45:05 +0200 Subject: [PATCH] Use accessor to reach into X509_ALGOR Despite already having an accessor, X509_ALGOR wasn't made opaque during OpenSSL 1.1.0 development. It would be nice if this could be fixed at some point, so avoid reaching into that struct by using the accessor --- src/file_analysis/analyzer/x509/X509.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/file_analysis/analyzer/x509/X509.cc b/src/file_analysis/analyzer/x509/X509.cc index c32a00f2ba..aefdf2738c 100644 --- a/src/file_analysis/analyzer/x509/X509.cc +++ b/src/file_analysis/analyzer/x509/X509.cc @@ -161,8 +161,9 @@ RecordValPtr X509::ParseCertificate(X509Val* cert_val, file_analysis::File* f) { #if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) i2a_ASN1_OBJECT(bio, ssl_cert->sig_alg->algorithm); #else - const X509_ALGOR* sigalg = X509_get0_tbs_sigalg(ssl_cert); - i2a_ASN1_OBJECT(bio, sigalg->algorithm); + const ASN1_OBJECT* alg; + X509_ALGOR_get0(&alg, NULL, NULL, X509_get0_tbs_sigalg(ssl_cert)); + i2a_ASN1_OBJECT(bio, alg); #endif len = BIO_gets(bio, buf, sizeof(buf)); pX509Cert->Assign(13, make_intrusive(len, buf));