databases/freetds: Fix build with libressl 3.5

Approved by:		bofh (maintainer), tcberner (mentor)
Differential Revision:	https://reviews.freebsd.org/D37052
This commit is contained in:
Felix Palmen 2022-10-17 13:45:38 +02:00
parent b68905f365
commit 59e28f1603
2 changed files with 17 additions and 29 deletions

View File

@ -1,14 +0,0 @@
--- src/tds/sec_negotiate_openssl.h.orig 2017-02-15 09:00:01 UTC
+++ src/tds/sec_negotiate_openssl.h
@@ -37,6 +37,11 @@
#error HAVE_OPENSSL not defines, this file should not be included
#endif
+#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL
+#undef OPENSSL_VERSION_NUMBER
+#define OPENSSL_VERSION_NUMBER 0x1000107fL
+#endif
+
static inline const BIGNUM*
rsa_get_n(const RSA *rsa)
{

View File

@ -11,19 +11,21 @@
#include <freetds/tds.h>
#include <freetds/utils/string.h>
#include <freetds/tls.h>
@@ -74,6 +78,15 @@
#define SSL_PUSH_ARGS gnutls_transport_ptr_t ptr, const void *data, size_t len
#define SSL_PTR ptr
#else
+
+#ifdef LIBRESSL_VERSION_NUMBER
+#if LIBRESSL_VERSION_NUMBER < 0x2070000FL
+static pthread_mutex_t *openssllocks;
+#undef OPENSSL_VERSION_NUMBER
+#define OPENSSL_VERSION_NUMBER 0x1000107fL
+#endif
+#define TLS_ST_OK SSL_ST_OK
+#endif
@@ -600,7 +604,7 @@ tds_ssl_free(BIO *a)
return 1;
}
/* some compatibility layer */
#if !HAVE_BIO_GET_DATA
-#if OPENSSL_VERSION_NUMBER < 0x1010000FL || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x1010000FL
static BIO_METHOD tds_method_login[1] = {
{
BIO_TYPE_MEM,
@@ -664,7 +668,7 @@ tds_deinit_openssl_methods(void)
# endif
#endif
-#if OPENSSL_VERSION_NUMBER < 0x1010000FL || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x1010000FL
static tds_mutex *openssl_locks;
static void