From 686f100f0d681941594922f4d2b914a37bb665d5 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Fri, 26 Sep 2025 11:45:32 -0700 Subject: [PATCH] Remove some additional LibreSSL checks --- src/digest.cc | 2 +- src/file_analysis/analyzer/x509/X509.cc | 2 +- src/file_analysis/analyzer/x509/X509.h | 30 ------------------- src/file_analysis/analyzer/x509/functions.bif | 2 +- 4 files changed, 3 insertions(+), 33 deletions(-) diff --git a/src/digest.cc b/src/digest.cc index 75b8bc0511..68c6747bc0 100644 --- a/src/digest.cc +++ b/src/digest.cc @@ -12,7 +12,7 @@ #include "zeek/Reporter.h" -#if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) || defined(LIBRESSL_VERSION_NUMBER) +#if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) #define EVP_MD_CTX_new EVP_MD_CTX_create #define EVP_MD_CTX_free EVP_MD_CTX_destroy #endif diff --git a/src/file_analysis/analyzer/x509/X509.cc b/src/file_analysis/analyzer/x509/X509.cc index f80856f3cc..0a62cdcf3e 100644 --- a/src/file_analysis/analyzer/x509/X509.cc +++ b/src/file_analysis/analyzer/x509/X509.cc @@ -349,7 +349,7 @@ void X509::ParseSAN(X509_EXTENSION* ext) { } auto len = ASN1_STRING_length(gen->d.ia5); -#if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) || defined(LIBRESSL_VERSION_NUMBER) +#if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) const char* name = (const char*)ASN1_STRING_data(gen->d.ia5); #else const char* name = (const char*)ASN1_STRING_get0_data(gen->d.ia5); diff --git a/src/file_analysis/analyzer/x509/X509.h b/src/file_analysis/analyzer/x509/X509.h index 7fffb6729a..c6d1a317f9 100644 --- a/src/file_analysis/analyzer/x509/X509.h +++ b/src/file_analysis/analyzer/x509/X509.h @@ -26,36 +26,6 @@ #define EVP_PKEY_get0_EC_KEY(p) ((p)->pkey.ec) #define EVP_PKEY_get0_RSA(p) ((p)->pkey.rsa) -#if ! defined(LIBRESSL_VERSION_NUMBER) || (LIBRESSL_VERSION_NUMBER < 0x2070000fL) - -#define OCSP_SINGLERESP_get0_id(s) (s)->certId - -static X509* X509_OBJECT_get0_X509(const X509_OBJECT* a) { - if ( a == nullptr || a->type != X509_LU_X509 ) - return nullptr; - return a->data.x509; -} - -static void DSA_get0_pqg(const DSA* d, const BIGNUM** p, const BIGNUM** q, const BIGNUM** g) { - if ( p != nullptr ) - *p = d->p; - if ( q != nullptr ) - *q = d->q; - if ( g != nullptr ) - *g = d->g; -} - -static void RSA_get0_key(const RSA* r, const BIGNUM** n, const BIGNUM** e, const BIGNUM** d) { - if ( n != nullptr ) - *n = r->n; - if ( e != nullptr ) - *e = r->e; - if ( d != nullptr ) - *d = r->d; -} - -#endif - #endif namespace zeek::file_analysis::detail { diff --git a/src/file_analysis/analyzer/x509/functions.bif b/src/file_analysis/analyzer/x509/functions.bif index b5b097f09c..a5a79d48db 100644 --- a/src/file_analysis/analyzer/x509/functions.bif +++ b/src/file_analysis/analyzer/x509/functions.bif @@ -1058,7 +1058,7 @@ function x509_check_cert_hostname%(cert_opaque: opaque of x509, hostname: string continue; std::size_t len = ASN1_STRING_length(gen->d.ia5); -#if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) || defined(LIBRESSL_VERSION_NUMBER) +#if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) auto* name = reinterpret_cast(ASN1_STRING_data(gen->d.ia5)); #else auto* name = reinterpret_cast(ASN1_STRING_get0_data(gen->d.ia5));