Remove some additional LibreSSL checks

This commit is contained in:
Tim Wojtulewicz 2025-09-26 11:45:32 -07:00
parent 6af1459f5e
commit 686f100f0d
4 changed files with 3 additions and 33 deletions

View file

@ -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

View file

@ -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);

View file

@ -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 {

View file

@ -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<const char*>(ASN1_STRING_data(gen->d.ia5));
#else
auto* name = reinterpret_cast<const char*>(ASN1_STRING_get0_data(gen->d.ia5));