commit transmission for openSUSE:Factory
Hello community, here is the log from the commit of package transmission for openSUSE:Factory checked in at 2017-08-29 11:39:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/transmission (Old) and /work/SRC/openSUSE:Factory/.transmission.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "transmission" Tue Aug 29 11:39:48 2017 rev:81 rq:518579 version:2.92 Changes: -------- --- /work/SRC/openSUSE:Factory/transmission/transmission.changes 2017-08-18 15:00:28.523338816 +0200 +++ /work/SRC/openSUSE:Factory/.transmission.new/transmission.changes 2017-08-29 11:39:51.224070723 +0200 @@ -1,0 +2,8 @@ +Wed Aug 23 15:20:59 UTC 2017 - vcizek@suse.com + +- Backport support for OpenSSL 1.1 + + Added patches: + 0001-transmission-build-against-openssl-1.1.0.patch. + 0002-Fix-coding-style-and-building-with-TR_LIGHTWEIGHT.patch. + +------------------------------------------------------------------- New: ---- 0001-transmission-build-against-openssl-1.1.0.patch 0002-Fix-coding-style-and-building-with-TR_LIGHTWEIGHT.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ transmission.spec ++++++ --- /var/tmp/diff_new_pack.AtZYaO/_old 2017-08-29 11:39:52.895835843 +0200 +++ /var/tmp/diff_new_pack.AtZYaO/_new 2017-08-29 11:39:52.907834158 +0200 @@ -33,6 +33,10 @@ # PATCH-FIX-UPSTREAM transmission-systemd.patch dimstar@opensuse.org -- Fix build with systemd 232, patch taken from git Patch1: transmission-systemd.patch # Patch0 touches autotool files +# PATCH-FIX-UPSTREAM support for OpenSSL 1.1 +Patch2: 0001-transmission-build-against-openssl-1.1.0.patch +# PATCH-FIX-UPSTREAM support for OpenSSL 1.1 +Patch3: 0002-Fix-coding-style-and-building-with-TR_LIGHTWEIGHT.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: intltool @@ -139,6 +143,8 @@ %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 cp %{S:3} . %build ++++++ 0001-transmission-build-against-openssl-1.1.0.patch ++++++
From f91cf5ad8c677b61ceb0bf5877b87f9e93256dd7 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Date: Mon, 5 Sep 2016 21:49:07 +0000 Subject: [PATCH 1/2] transmission: build against openssl 1.1.0
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> --- libtransmission/crypto-utils-openssl.c | 73 ++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 4 deletions(-) Index: transmission-2.92/libtransmission/crypto-utils-openssl.c =================================================================== --- transmission-2.92.orig/libtransmission/crypto-utils-openssl.c 2017-08-23 17:19:36.662263022 +0200 +++ transmission-2.92/libtransmission/crypto-utils-openssl.c 2017-08-23 17:19:37.742280664 +0200 @@ -230,6 +230,61 @@ tr_rc4_process (tr_rc4_ctx_t handle, **** ***/ +#if OPENSSL_VERSION_NUMBER < 0x10100000 +static inline int +DH_set0_pqg (DH * dh, + BIGNUM * p, + BIGNUM * q, + BIGNUM * g) +{ + /* If the fields p and g in d are NULL, the corresponding input + * parameters MUST be non-NULL. q may remain NULL. + */ + if ((dh->p == NULL && p == NULL) + || (dh->g == NULL && g == NULL)) + return 0; + + if (p != NULL) { + BN_free (dh->p); + dh->p = p; + } + if (q != NULL) { + BN_free (dh->q); + dh->q = q; + } + if (g != NULL) { + BN_free (dh->g); + dh->g = g; + } + + if (q != NULL) { + dh->length = BN_num_bits (q); + } + + return 1; +} + +static inline int +DH_set_length (DH * dh, + long length) +{ + dh->length = length; + return 1; +} + +static inline void +DH_get0_key(const DH * dh, + const BIGNUM ** pub_key, + const BIGNUM ** priv_key) +{ + if (pub_key != NULL) + *pub_key = dh->pub_key; + if (priv_key != NULL) + *priv_key = dh->priv_key; +} + +#endif + tr_dh_ctx_t tr_dh_new (const uint8_t * prime_num, size_t prime_num_length, @@ -237,13 +292,19 @@ tr_dh_new (const uint8_t * prime_num, size_t generator_num_length) { DH * handle = DH_new (); + BIGNUM * p, * g; assert (prime_num != NULL); assert (generator_num != NULL); + p = BN_bin2bn (prime_num, prime_num_length, NULL); + g = BN_bin2bn (generator_num, generator_num_length, NULL); - if (!check_pointer (handle->p = BN_bin2bn (prime_num, prime_num_length, NULL)) || - !check_pointer (handle->g = BN_bin2bn (generator_num, generator_num_length, NULL))) + if (!check_pointer (p) || + !check_pointer (g) || + !DH_set0_pqg (handle, p, NULL, g)) { + BN_free (p); + BN_free (g); DH_free (handle); handle = NULL; } @@ -268,16 +329,20 @@ tr_dh_make_key (tr_dh_ctx_t raw_handle { DH * handle = raw_handle; int dh_size, my_public_key_length; + const BIGNUM * hand_pub_key; assert (handle != NULL); assert (public_key != NULL); - handle->length = private_key_length * 8; + + DH_set_length(handle, private_key_length * 8); if (!check_result (DH_generate_key (handle))) return false; - my_public_key_length = BN_bn2bin (handle->pub_key, public_key); + DH_get0_key (handle, &hand_pub_key, NULL); + + my_public_key_length = BN_bn2bin (hand_pub_key, public_key); dh_size = DH_size (handle); tr_dh_align_key (public_key, my_public_key_length, dh_size); ++++++ 0002-Fix-coding-style-and-building-with-TR_LIGHTWEIGHT.patch ++++++
From 8c8386a7f3f482a9c917f51d28e0042e55f56b3e Mon Sep 17 00:00:00 2001 From: Mike Gelfand <mikedld@mikedld.com> Date: Wed, 7 Sep 2016 01:09:04 +0300 Subject: [PATCH 2/2] Fix coding style and building with !TR_LIGHTWEIGHT
--- libtransmission/crypto-utils-openssl.c | 60 +++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 27 deletions(-) Index: transmission-2.92/libtransmission/crypto-utils-openssl.c =================================================================== --- transmission-2.92.orig/libtransmission/crypto-utils-openssl.c 2017-08-23 17:19:37.742280664 +0200 +++ transmission-2.92/libtransmission/crypto-utils-openssl.c 2017-08-23 17:19:39.810314446 +0200 @@ -15,6 +15,7 @@ #include <assert.h> #include <openssl/bn.h> +#include <openssl/crypto.h> #include <openssl/dh.h> #include <openssl/err.h> #include <openssl/evp.h> @@ -49,7 +50,12 @@ log_openssl_error (const char * file, static bool strings_loaded = false; if (!strings_loaded) { +#if OPENSSL_VERSION_NUMBER < 0x10100000 ERR_load_crypto_strings (); +#else + OPENSSL_init_crypto (OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL); +#endif + strings_loaded = true; } #endif @@ -231,6 +237,7 @@ tr_rc4_process (tr_rc4_ctx_t handle, ***/ #if OPENSSL_VERSION_NUMBER < 0x10100000 + static inline int DH_set0_pqg (DH * dh, BIGNUM * p, @@ -238,28 +245,29 @@ DH_set0_pqg (DH * dh, BIGNUM * g) { /* If the fields p and g in d are NULL, the corresponding input - * parameters MUST be non-NULL. q may remain NULL. + * parameters MUST be non-NULL. q may remain NULL. */ - if ((dh->p == NULL && p == NULL) - || (dh->g == NULL && g == NULL)) + if ((dh->p == NULL && p == NULL) || (dh->g == NULL && g == NULL)) return 0; - if (p != NULL) { - BN_free (dh->p); - dh->p = p; - } - if (q != NULL) { - BN_free (dh->q); - dh->q = q; - } - if (g != NULL) { - BN_free (dh->g); - dh->g = g; - } + if (p != NULL) + { + BN_free (dh->p); + dh->p = p; + } + if (q != NULL) + { + BN_free (dh->q); + dh->q = q; + } + if (g != NULL) + { + BN_free (dh->g); + dh->g = g; + } - if (q != NULL) { + if (q != NULL) dh->length = BN_num_bits (q); - } return 1; } @@ -268,8 +276,8 @@ static inline int DH_set_length (DH * dh, long length) { - dh->length = length; - return 1; + dh->length = length; + return 1; } static inline void @@ -296,12 +304,11 @@ tr_dh_new (const uint8_t * prime_num, assert (prime_num != NULL); assert (generator_num != NULL); + p = BN_bin2bn (prime_num, prime_num_length, NULL); g = BN_bin2bn (generator_num, generator_num_length, NULL); - if (!check_pointer (p) || - !check_pointer (g) || - !DH_set0_pqg (handle, p, NULL, g)) + if (!check_pointer (p) || !check_pointer (g) || !DH_set0_pqg (handle, p, NULL, g)) { BN_free (p); BN_free (g); @@ -329,20 +336,19 @@ tr_dh_make_key (tr_dh_ctx_t raw_handle { DH * handle = raw_handle; int dh_size, my_public_key_length; - const BIGNUM * hand_pub_key; + const BIGNUM * my_public_key; assert (handle != NULL); assert (public_key != NULL); - DH_set_length(handle, private_key_length * 8); if (!check_result (DH_generate_key (handle))) return false; - DH_get0_key (handle, &hand_pub_key, NULL); + DH_get0_key (handle, &my_public_key, NULL); - my_public_key_length = BN_bn2bin (hand_pub_key, public_key); + my_public_key_length = BN_bn2bin (my_public_key, public_key); dh_size = DH_size (handle); tr_dh_align_key (public_key, my_public_key_length, dh_size);
participants (1)
-
root@hilbert.suse.de