From 356bb6c158d1a0b4617d22012111c1b2ea066d0eedfc03a5f405b2df981f59ac Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Wed, 6 Dec 2017 01:55:39 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/X11:Cinnamon:Factory/nemo-extensions?expand=0&rev=40 --- nemo-extensions.changes | 6 +++ nemo-extensions.spec | 5 +- nemo-gtkhash_openssl-1.1.patch | 92 ++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 nemo-gtkhash_openssl-1.1.patch diff --git a/nemo-extensions.changes b/nemo-extensions.changes index 2a50ab5..428e2b8 100644 --- a/nemo-extensions.changes +++ b/nemo-extensions.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Dec 5 10:45:09 UTC 2017 - cfarrell@suse.com + +- Add nemo-gtkhash_openssl-1.1.patch: Add basic OpenSSL 1.1+ + compatibility in Nemo-GtkHash. + ------------------------------------------------------------------- Sat Oct 28 19:57:36 UTC 2017 - sor.alexei@meowr.ru diff --git a/nemo-extensions.spec b/nemo-extensions.spec index 7ae1ec7..4b50dfc 100644 --- a/nemo-extensions.spec +++ b/nemo-extensions.spec @@ -34,6 +34,8 @@ Patch0: nemo-seahorse_no-nautilus-conflicts.patch Patch1: nemo-dropbox_no-dropbox-bin.patch # PATCH-FIX-OPENSUSE nemo-seahorse_gpg-2.2.patch sor.alexei@meowr.ru -- Add GPG 2.2 to accepted versions in nemo-seahorse. Patch2: nemo-seahorse_gpg-2.2.patch +# PATCH-FIX-OPENSUSE nemo-gtkhash_openssl-1.1.patch sor.alexei@meowr.ru -- Add basic OpenSSL 1.1+ compatibility in nemo-gtkhash. +Patch3: nemo-gtkhash_openssl-1.1.patch BuildRequires: gettext-runtime BuildRequires: gnome-common BuildRequires: intltool @@ -341,6 +343,7 @@ directory in Nemo. %patch0 %patch1 %patch2 +%patch3 # Remove spurious executable permission. chmod a-x nemo-audio-tab/COPYING.GPL3 nemo-emblems/COPYING.GPL3 @@ -369,7 +372,7 @@ pushd nemo-gtkhash --disable-gcrypt \ %endif %if 0%{?suse_version} > 1320 || (0%{?sle_version} >= 120100 && 0%{?is_opensuse}) - --enable-polarssl \ + --enable-mbedtls \ %endif --enable-nettle \ --enable-nss \ diff --git a/nemo-gtkhash_openssl-1.1.patch b/nemo-gtkhash_openssl-1.1.patch new file mode 100644 index 0000000..d0ff1b2 --- /dev/null +++ b/nemo-gtkhash_openssl-1.1.patch @@ -0,0 +1,92 @@ +--- nemo-gtkhash.orig/src/hash/hash-lib-crypto.c ++++ nemo-gtkhash/src/hash/hash-lib-crypto.c +@@ -34,7 +34,7 @@ + #define LIB_DATA ((struct hash_lib_crypto_s *)func->lib_data) + + struct hash_lib_crypto_s { +- EVP_MD_CTX ctx; ++ EVP_MD_CTX *ctx; + }; + + static const EVP_MD *gtkhash_hash_lib_crypto_get_md(const enum hash_func_e id) +@@ -44,8 +44,10 @@ static const EVP_MD *gtkhash_hash_lib_cr + return EVP_md4(); + case HASH_FUNC_MD5: + return EVP_md5(); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + case HASH_FUNC_SHA0: + return EVP_sha(); ++#endif + case HASH_FUNC_SHA1: + return EVP_sha1(); + case HASH_FUNC_RIPEMD160: +@@ -69,9 +71,13 @@ bool gtkhash_hash_lib_crypto_is_supporte + if (!(md = gtkhash_hash_lib_crypto_get_md(id))) + return false; + +- EVP_MD_CTX_init(&data.ctx); +- bool ret = (EVP_DigestInit_ex(&data.ctx, md, NULL) == 1); +- EVP_MD_CTX_cleanup(&data.ctx); ++ data.ctx = EVP_MD_CTX_create(); ++ bool ret = (EVP_DigestInit_ex(data.ctx, md, NULL) == 1); ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++ EVP_MD_CTX_destroy(data.ctx); ++#else ++ EVP_MD_CTX_cleanup(data.ctx); ++#endif + + return ret; + } +@@ -84,37 +90,45 @@ void gtkhash_hash_lib_crypto_start(struc + if (!(md = gtkhash_hash_lib_crypto_get_md(func->id))) + g_assert_not_reached(); + +- EVP_MD_CTX_init(&LIB_DATA->ctx); ++ LIB_DATA->ctx = EVP_MD_CTX_create(); + +- if (EVP_DigestInit_ex(&LIB_DATA->ctx, md, NULL) != 1) ++ if (EVP_DigestInit_ex(LIB_DATA->ctx, md, NULL) != 1) + g_assert_not_reached(); + } + + void gtkhash_hash_lib_crypto_update(struct hash_func_s *func, + const uint8_t *buffer, const size_t size) + { +- EVP_DigestUpdate(&LIB_DATA->ctx, buffer, size); ++ EVP_DigestUpdate(LIB_DATA->ctx, buffer, size); + } + + void gtkhash_hash_lib_crypto_stop(struct hash_func_s *func) + { +- EVP_MD_CTX_cleanup(&LIB_DATA->ctx); ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++ EVP_MD_CTX_destroy(LIB_DATA->ctx); ++#else ++ EVP_MD_CTX_cleanup(LIB_DATA->ctx); ++#endif + g_free(LIB_DATA); + } + + uint8_t *gtkhash_hash_lib_crypto_finish(struct hash_func_s *func, size_t *size) + { +- *size = EVP_MD_CTX_size(&LIB_DATA->ctx); ++ *size = EVP_MD_CTX_size(LIB_DATA->ctx); + g_assert(*size > 0); + + uint8_t *digest = g_malloc0(*size); + + unsigned int len; +- if (EVP_DigestFinal_ex(&LIB_DATA->ctx, digest, &len) != 1) ++ if (EVP_DigestFinal_ex(LIB_DATA->ctx, digest, &len) != 1) + g_assert_not_reached(); + g_assert(*size == len); + +- EVP_MD_CTX_cleanup(&LIB_DATA->ctx); ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++ EVP_MD_CTX_destroy(LIB_DATA->ctx); ++#else ++ EVP_MD_CTX_cleanup(LIB_DATA->ctx); ++#endif + g_free(LIB_DATA); + + return digest;