re: fix compilation without deprecated OpenSSL APIs 556/head
authorRosen Penev <rosenp@gmail.com>
Wed, 5 Aug 2020 21:25:36 +0000 (14:25 -0700)
committerRosen Penev <rosenp@gmail.com>
Wed, 5 Aug 2020 21:31:20 +0000 (14:31 -0700)
Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/re/Makefile
libs/re/patches/010-openssl-deprecated.patch [new file with mode: 0644]

index 385d3ebe34e3eb484cc21eb4bc83e8b528e10a9c..ff5c7c1751d2de8aeb061e7fb2d21813002632a4 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=re
 PKG_VERSION:=0.6.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.creytiv.com/pub
diff --git a/libs/re/patches/010-openssl-deprecated.patch b/libs/re/patches/010-openssl-deprecated.patch
new file mode 100644 (file)
index 0000000..bff18b9
--- /dev/null
@@ -0,0 +1,54 @@
+--- a/src/main/openssl.c
++++ b/src/main/openssl.c
+@@ -103,6 +103,7 @@ static void dynlock_destroy_handler(struct CRYPTO_dynlock_value *l,
+ #endif
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ #ifdef SIGPIPE
+ static void sigpipe_handler(int x)
+ {
+@@ -110,10 +111,11 @@ static void sigpipe_handler(int x)
+       (void)signal(SIGPIPE, sigpipe_handler);
+ }
+ #endif
+-
++#endif
+ int openssl_init(void)
+ {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ #if defined (HAVE_PTHREAD) && (OPENSSL_VERSION_NUMBER < 0x10100000L)
+       int err, i;
+@@ -151,6 +153,7 @@ int openssl_init(void)
+       SSL_library_init();
+       SSL_load_error_strings();
++#endif
+       return 0;
+ }
+@@ -158,7 +161,9 @@ int openssl_init(void)
+ void openssl_close(void)
+ {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+       ERR_free_strings();
++#endif
+ #if defined (HAVE_PTHREAD) && (OPENSSL_VERSION_NUMBER < 0x10100000L)
+       lockv = mem_deref(lockv);
+ #endif
+--- a/src/tls/openssl/tls.c
++++ b/src/tls/openssl/tls.c
+@@ -291,8 +291,8 @@ int tls_set_selfsigned(struct tls *tls, const char *cn)
+           !X509_set_subject_name(cert, subj))
+               goto out;
+-      if (!X509_gmtime_adj(X509_get_notBefore(cert), -3600*24*365) ||
+-          !X509_gmtime_adj(X509_get_notAfter(cert),   3600*24*365*10))
++      if (!X509_gmtime_adj(X509_getm_notBefore(cert), -3600*24*365) ||
++          !X509_gmtime_adj(X509_getm_notAfter(cert),   3600*24*365*10))
+               goto out;
+       if (!X509_set_pubkey(cert, key))