Browse Source

syslog-ng: fix openssl callbacks to not require backward compatibility

The functions for registering callbacks for threads has changed
in OpenSSL 1.0.0.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
lilik-openwrt-22.03
Philip Prindeville 8 years ago
parent
commit
f3a8766954
2 changed files with 36 additions and 1 deletions
  1. +1
    -1
      admin/syslog-ng/Makefile
  2. +35
    -0
      admin/syslog-ng/patches/100-use-1.0.2k-threadids.patch

+ 1
- 1
admin/syslog-ng/Makefile View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=syslog-ng PKG_NAME:=syslog-ng
PKG_VERSION:=3.9.1 PKG_VERSION:=3.9.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>


+ 35
- 0
admin/syslog-ng/patches/100-use-1.0.2k-threadids.patch View File

@ -0,0 +1,35 @@
--- a/lib/crypto.c 2016-12-21 07:57:44.000000000 -0700
+++ b/lib/crypto.c 2017-03-24 13:19:34.188259018 -0600
@@ -51,11 +51,20 @@
}
}
+#if OPENSSL_VERSION_NUMBER < 0x10000000
static unsigned long
ssl_thread_id(void)
{
return (unsigned long) get_thread_id();
}
+
+#else
+static void
+ssl_thread_id2(CRYPTO_THREADID *id)
+{
+ CRYPTO_THREADID_set_numeric(id, get_thread_id());
+}
+#endif
static void
crypto_init_threading(void)
@@ -68,7 +76,11 @@
{
g_static_mutex_init(&ssl_locks[i]);
}
+#if OPENSSL_VERSION_NUMBER < 0x10000000
CRYPTO_set_id_callback(ssl_thread_id);
+#else
+ CRYPTO_THREADID_set_callback(ssl_thread_id2);
+#endif
CRYPTO_set_locking_callback(ssl_locking_callback);
}

Loading…
Cancel
Save