From 3e6fbcef2f1d815807357ee2851a4e4a9db7894f Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Fri, 24 Aug 2018 02:34:07 +0200 Subject: [PATCH] openssl 1.1.1 preparation patches --- packages/erlang/lib-crypto-c_src-crypto.c.patch | 13 +++++++++++++ .../lib-crypto-c_src-otp_test_engine.c.patch | 13 +++++++++++++ packages/httping/mssl.c.patch | 13 +++++++++++++ packages/ldns/keys.c.patch | 12 ++++++++++++ packages/libmosquitto/lib-net_mosq.c.patch | 14 ++++++++++++++ packages/tor/src-common-crypto_openssl_mgt.h.patch | 13 +++++++++++++ packages/wget/src-openssl.c.patch | 13 +++++++++++++ 7 files changed, 91 insertions(+) create mode 100644 packages/erlang/lib-crypto-c_src-crypto.c.patch create mode 100644 packages/erlang/lib-crypto-c_src-otp_test_engine.c.patch create mode 100644 packages/httping/mssl.c.patch create mode 100644 packages/ldns/keys.c.patch create mode 100644 packages/libmosquitto/lib-net_mosq.c.patch create mode 100644 packages/tor/src-common-crypto_openssl_mgt.h.patch create mode 100644 packages/wget/src-openssl.c.patch diff --git a/packages/erlang/lib-crypto-c_src-crypto.c.patch b/packages/erlang/lib-crypto-c_src-crypto.c.patch new file mode 100644 index 000000000..9815f0405 --- /dev/null +++ b/packages/erlang/lib-crypto-c_src-crypto.c.patch @@ -0,0 +1,13 @@ +diff -u -r ../otp-OTP-21.0.5/lib/crypto/c_src/crypto.c ./lib/crypto/c_src/crypto.c +--- ../otp-OTP-21.0.5/lib/crypto/c_src/crypto.c 2018-08-10 17:02:51.000000000 +0000 ++++ ./lib/crypto/c_src/crypto.c 2018-08-23 22:08:35.654582842 +0000 +@@ -193,7 +193,8 @@ + #endif + + #if OPENSSL_VERSION_NUMBER >= PACKED_OPENSSL_VERSION(0,9,8,'h') \ +- && defined(HAVE_EC) ++ && defined(HAVE_EC) \ ++ && !defined(OPENSSL_NO_ENGINE) + /* If OPENSSL_NO_EC is set, there will be an error in ec.h included from engine.h + So if EC is disabled, you can't use Engine either.... + */ diff --git a/packages/erlang/lib-crypto-c_src-otp_test_engine.c.patch b/packages/erlang/lib-crypto-c_src-otp_test_engine.c.patch new file mode 100644 index 000000000..53ee50429 --- /dev/null +++ b/packages/erlang/lib-crypto-c_src-otp_test_engine.c.patch @@ -0,0 +1,13 @@ +diff -u -r ../otp-OTP-21.0.5/lib/crypto/c_src/otp_test_engine.c ./lib/crypto/c_src/otp_test_engine.c +--- ../otp-OTP-21.0.5/lib/crypto/c_src/otp_test_engine.c 2018-08-10 17:02:51.000000000 +0000 ++++ ./lib/crypto/c_src/otp_test_engine.c 2018-08-23 22:15:50.757486039 +0000 +@@ -41,7 +41,8 @@ + #if OPENSSL_VERSION_NUMBER >= PACKED_OPENSSL_VERSION(0,9,8,'o') \ + && !defined(OPENSSL_NO_EC) \ + && !defined(OPENSSL_NO_ECDH) \ +- && !defined(OPENSSL_NO_ECDSA) ++ && !defined(OPENSSL_NO_ECDSA) \ ++ && !defined(OPENSSL_NO_ENGINE) + # define HAVE_EC + #endif + diff --git a/packages/httping/mssl.c.patch b/packages/httping/mssl.c.patch new file mode 100644 index 000000000..7bc79000c --- /dev/null +++ b/packages/httping/mssl.c.patch @@ -0,0 +1,13 @@ +diff -u -r ../httping-2.5/mssl.c ./mssl.c +--- ../httping-2.5/mssl.c 2016-09-12 07:45:50.000000000 +0000 ++++ ./mssl.c 2018-08-23 19:38:43.467717597 +0000 +@@ -35,7 +35,9 @@ + ERR_free_strings(); + + ERR_remove_state(0); ++#ifndef OPENSSL_NO_ENGINE + ENGINE_cleanup(); ++#endif + CONF_modules_free(); + EVP_cleanup(); + CRYPTO_cleanup_all_ex_data(); diff --git a/packages/ldns/keys.c.patch b/packages/ldns/keys.c.patch new file mode 100644 index 000000000..57bca9db3 --- /dev/null +++ b/packages/ldns/keys.c.patch @@ -0,0 +1,12 @@ +diff -u -r ../ldns-1.7.0/keys.c ./keys.c +--- ../ldns-1.7.0/keys.c 2016-12-20 10:48:22.000000000 +0000 ++++ ./keys.c 2018-08-23 17:05:00.759800098 +0000 +@@ -107,7 +107,7 @@ + + k = ldns_key_new(); + if(!k) return LDNS_STATUS_MEM_ERR; +-#ifndef S_SPLINT_S ++#if !defined(S_SPLINT_S) && !defined(OPENSSL_NO_ENGINE) + k->_key.key = ENGINE_load_private_key(e, key_id, UI_OpenSSL(), NULL); + if(!k->_key.key) { + ldns_key_free(k); diff --git a/packages/libmosquitto/lib-net_mosq.c.patch b/packages/libmosquitto/lib-net_mosq.c.patch new file mode 100644 index 000000000..96e94ae13 --- /dev/null +++ b/packages/libmosquitto/lib-net_mosq.c.patch @@ -0,0 +1,14 @@ +diff -u -r ../mosquitto-1.5.1/lib/net_mosq.c ./lib/net_mosq.c +--- ../mosquitto-1.5.1/lib/net_mosq.c 2018-08-16 16:05:26.000000000 +0000 ++++ ./lib/net_mosq.c 2018-08-23 17:45:34.544680239 +0000 +@@ -103,7 +103,9 @@ + #if OPENSSL_VERSION_NUMBER < 0x10100000L + ERR_remove_state(0); + #endif +- ENGINE_cleanup(); ++ #ifndef OPENSSL_NO_ENGINE ++ ENGINE_cleanup(); ++ #endif + CONF_modules_unload(1); + ERR_free_strings(); + EVP_cleanup(); diff --git a/packages/tor/src-common-crypto_openssl_mgt.h.patch b/packages/tor/src-common-crypto_openssl_mgt.h.patch new file mode 100644 index 000000000..c03a87153 --- /dev/null +++ b/packages/tor/src-common-crypto_openssl_mgt.h.patch @@ -0,0 +1,13 @@ +diff -u -r ../tor-0.3.3.9/src/common/crypto_openssl_mgt.h ./src/common/crypto_openssl_mgt.h +--- ../tor-0.3.3.9/src/common/crypto_openssl_mgt.h 2018-07-13 18:25:23.000000000 +0000 ++++ ./src/common/crypto_openssl_mgt.h 2018-08-23 22:30:55.658879513 +0000 +@@ -50,8 +50,7 @@ + #define OPENSSL_V_SERIES(a,b,c) \ + OPENSSL_VER((a),(b),(c),0,0) + +-#ifdef ANDROID +-/* Android's OpenSSL seems to have removed all of its Engine support. */ ++#ifdef OPENSSL_NO_ENGINE + #define DISABLE_ENGINES + #endif + diff --git a/packages/wget/src-openssl.c.patch b/packages/wget/src-openssl.c.patch new file mode 100644 index 000000000..2152c9604 --- /dev/null +++ b/packages/wget/src-openssl.c.patch @@ -0,0 +1,13 @@ +diff -u -r ../wget-1.19.5/src/openssl.c ./src/openssl.c +--- ../wget-1.19.5/src/openssl.c 2018-05-05 20:49:06.000000000 +0000 ++++ ./src/openssl.c 2018-08-23 22:35:58.863327970 +0000 +@@ -193,7 +193,9 @@ + + #if OPENSSL_VERSION_NUMBER >= 0x00907000 + OPENSSL_load_builtin_modules(); ++# ifndef OPENSSL_NO_ENGINE + ENGINE_load_builtin_engines(); ++# endif + CONF_modules_load_file(NULL, NULL, + CONF_MFLAGS_DEFAULT_SECTION|CONF_MFLAGS_IGNORE_MISSING_FILE); + #endif