aboutsummaryrefslogtreecommitdiffstats
path: root/community/hermes/openssl-1.1.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-11-02 11:21:55 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-11-07 16:46:14 +0000
commitc73ebd0b30af62b42fa3860020a8c90f78aae3e5 (patch)
tree81056e56466f3fdef685db4bd8b0a596782ab0c6 /community/hermes/openssl-1.1.patch
parent0e6777bb846a0805f9dd57db627a82ca93d2aeee (diff)
downloadaports-c73ebd0b30af62b42fa3860020a8c90f78aae3e5.tar.bz2
aports-c73ebd0b30af62b42fa3860020a8c90f78aae3e5.tar.xz
community/hermes: rebuild against openssl 1.1
Diffstat (limited to 'community/hermes/openssl-1.1.patch')
-rw-r--r--community/hermes/openssl-1.1.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/community/hermes/openssl-1.1.patch b/community/hermes/openssl-1.1.patch
new file mode 100644
index 0000000000..85034a34fe
--- /dev/null
+++ b/community/hermes/openssl-1.1.patch
@@ -0,0 +1,34 @@
+diff --git a/src/hermes.cpp b/src/hermes.cpp
+index edfe833..35b4062 100644
+--- a/src/hermes.cpp
++++ b/src/hermes.cpp
+@@ -63,12 +63,14 @@ __thread unsigned long connection_id;
+ list<unsigned long> children;
+
+ #ifdef HAVE_SSL
+-pthread_mutex_t ssl_locks[CRYPTO_NUM_LOCKS]={PTHREAD_MUTEX_INITIALIZER};
++#define CRYPTO_NUM_LOCKS 100
++pthread_mutex_t *ssl_locks;
+
+ void ssl_locking_function(int mode,int n,const char *file,int line)
+ {
+- if(n>CRYPTO_NUM_LOCKS)
+- throw Exception(_("Error, "+Utils::inttostr(n)+" is bigger than CRYPTO_NUM_LOCKS("+Utils::inttostr(CRYPTO_NUM_LOCKS)+")"),__FILE__,__LINE__);
++ int num_locks = CRYPTO_num_locks();
++ if(n>num_locks)
++ throw Exception(_("Error, "+Utils::inttostr(n)+" is bigger than CRYPTO_NUM_LOCKS("+Utils::inttostr(num_locks)+")"),__FILE__,__LINE__);
+ if(mode&CRYPTO_LOCK)
+ pthread_mutex_lock(&ssl_locks[n]);
+ else
+@@ -94,6 +96,11 @@ main
+ */
+
+ #ifdef HAVE_SSL
++ int num_locks=CRYPTO_num_locks();
++ ssl_locks = (pthread_mutex_t *)calloc(num_locks, sizeof (*ssl_locks));
++ for (int i=0; i< num_locks; i++)
++ pthread_mutex_init(&ssl_locks[i], NULL);
++
+ CRYPTO_set_locking_callback(ssl_locking_function);
+ #ifndef WIN32 //getpid() returns different values for threads on windows, therefor this is not needed
+ CRYPTO_set_id_callback(pthread_self);