Improve OpenBSD support

This commit is contained in:
David Uhden Collado 2025-10-13 22:33:57 +02:00
parent d10a7fe8e5
commit 80840b761e
No known key found for this signature in database
GPG key ID: 1A47E8A7D51FB3DA
8 changed files with 149 additions and 22 deletions

View file

@ -14,12 +14,12 @@
#include <boost/algorithm/string.hpp>
#include <openssl/ssl.h>
#include <openssl/err.h>
#if (OPENSSL_VERSION_NUMBER >= 0x030000000) // since 3.0.0
#include "Crypto.h"
#if I2PD_OPENSSL_GE_3 // since 3.0.0
#include <openssl/core_names.h>
#endif
#include <zlib.h>
#include "Crypto.h"
#include "I2PEndian.h"
#include "Reseed.h"
#include "FS.h"
@ -485,7 +485,7 @@ namespace data
// extract RSA key (we need n only, e = 65537)
EVP_PKEY * pubKey = X509_get_pubkey (cert);
const BIGNUM * n = nullptr;
#if (OPENSSL_VERSION_NUMBER >= 0x030000000) // since 3.0.0
#if I2PD_OPENSSL_GE_3 // since 3.0.0
BIGNUM * n1 = BN_new ();
if (EVP_PKEY_get_bn_param (pubKey, OSSL_PKEY_PARAM_RSA_N, &n1) > 0)
n = n1;
@ -505,7 +505,7 @@ namespace data
}
else
LogPrint (eLogError, "Reseed: Can't extract RSA key from ", filename);
#if (OPENSSL_VERSION_NUMBER >= 0x030000000) // since 3.0.0
#if I2PD_OPENSSL_GE_3 // since 3.0.0
BN_free (n1);
#endif
}