aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprspkt <prspkt@protonmail.com>2019-07-19 21:57:00 +0300
committerprspkt <prspkt@protonmail.com>2019-07-19 22:22:34 +0300
commitb68cfb10451ed207bb4379a16acce214f89eed10 (patch)
tree7344faa6cf5f6ea691d32d9f0cd79f90ec551786
parentd965a7d7960953233e2dc9cf880a55387caa6f9c (diff)
downloadaports-b68cfb10451ed207bb4379a16acce214f89eed10.tar.gz
aports-b68cfb10451ed207bb4379a16acce214f89eed10.tar.bz2
aports-b68cfb10451ed207bb4379a16acce214f89eed10.tar.xz
community/libtorrent: clarify license, modernize
* Modernize and remove OpenSSL patch. The diffie hellman implementation has been fixed upstream.
-rw-r--r--community/libtorrent/0001-Fix-the-DH-parameters-generation-with-OpenSSL-1.1.patch58
-rw-r--r--community/libtorrent/APKBUILD15
2 files changed, 4 insertions, 69 deletions
diff --git a/community/libtorrent/0001-Fix-the-DH-parameters-generation-with-OpenSSL-1.1.patch b/community/libtorrent/0001-Fix-the-DH-parameters-generation-with-OpenSSL-1.1.patch
deleted file mode 100644
index cf4f52efff..0000000000
--- a/community/libtorrent/0001-Fix-the-DH-parameters-generation-with-OpenSSL-1.1.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 472dd5d7a868130b94212d4a9ec5b6167d36fc71 Mon Sep 17 00:00:00 2001
-From: Peter Pentchev <roam@ringlet.net>
-Date: Mon, 28 Nov 2016 00:17:40 +0200
-Subject: [PATCH] Fix the DH parameters generation with OpenSSL 1.1.
-
-The DH structure is now opaque, so the parameters must be stored there
-through an accessor function.
----
- src/utils/diffie_hellman.cc | 19 ++++++++++++++-----
- 1 file changed, 14 insertions(+), 5 deletions(-)
-
-diff --git a/src/utils/diffie_hellman.cc b/src/utils/diffie_hellman.cc
-index aa653d45..701ec90c 100644
---- a/src/utils/diffie_hellman.cc
-+++ b/src/utils/diffie_hellman.cc
-@@ -55,8 +55,11 @@ DiffieHellman::DiffieHellman(const unsigned char *prime, int primeLength,
-
- #ifdef USE_OPENSSL
- m_dh = DH_new();
-- m_dh->p = BN_bin2bn(prime, primeLength, NULL);
-- m_dh->g = BN_bin2bn(generator, generatorLength, NULL);
-+ BIGNUM * const dh_p = BN_bin2bn(prime, primeLength, NULL);
-+ BIGNUM * const dh_g = BN_bin2bn(generator, generatorLength, NULL);
-+ if (dh_p == NULL || dh_g == NULL ||
-+ !DH_set0_pqg(m_dh, dh_p, NULL, dh_g))
-+ throw internal_error("Could not generate Diffie-Hellman parameters");
-
- DH_generate_key(m_dh);
- #else
-@@ -74,7 +77,11 @@ DiffieHellman::~DiffieHellman() {
- bool
- DiffieHellman::is_valid() const {
- #ifdef USE_OPENSSL
-- return m_dh != NULL && m_dh->pub_key != NULL;
-+ if (m_dh == NULL)
-+ return false;
-+ const BIGNUM *pub_key;
-+ DH_get0_key(m_dh, &pub_key, NULL);
-+ return pub_key != NULL;
- #else
- return false;
- #endif
-@@ -103,8 +110,10 @@ DiffieHellman::store_pub_key(unsigned char* dest, unsigned int length) {
- #ifdef USE_OPENSSL
- std::memset(dest, 0, length);
-
-- if ((int)length >= BN_num_bytes(m_dh->pub_key))
-- BN_bn2bin(m_dh->pub_key, dest + length - BN_num_bytes(m_dh->pub_key));
-+ const BIGNUM *pub_key;
-+ DH_get0_key(m_dh, &pub_key, NULL);
-+ if ((int)length >= BN_num_bytes(pub_key))
-+ BN_bn2bin(pub_key, dest + length - BN_num_bytes(pub_key));
- #endif
- }
-
---
-2.11.0
-
diff --git a/community/libtorrent/APKBUILD b/community/libtorrent/APKBUILD
index dba4e93b4b..ceaa128d02 100644
--- a/community/libtorrent/APKBUILD
+++ b/community/libtorrent/APKBUILD
@@ -1,28 +1,23 @@
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
-
pkgname=libtorrent
pkgver=0.13.8
pkgrel=0
pkgdesc="BitTorrent library written in C++"
-url="http://rakshasa.github.io/rtorrent/"
+url="https://rakshasa.github.io/rtorrent"
arch="all"
-license="GPL"
+license="GPL-2.0-or-later"
makedepends="zlib-dev libsigc++-dev openssl-dev automake autoconf libtool linux-headers"
subpackages="$pkgname-dev"
-source="http://rtorrent.net/downloads/$pkgname-$pkgver.tar.gz
- 0001-Fix-the-DH-parameters-generation-with-OpenSSL-1.1.patch"
-builddir="$srcdir/$pkgname-$pkgver"
+source="https://rtorrent.net/downloads/$pkgname-$pkgver.tar.gz"
prepare() {
default_prepare
- cd "$builddir"
./autogen.sh
}
build() {
- cd "$builddir"
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -33,9 +28,7 @@ build() {
}
package() {
- cd "$builddir"
make DESTDIR="$pkgdir" install
}
-sha512sums="417177df5b27cd8c6a6317063b0846da2690de4633836466728605c2edad2de407d29d321cc481b8d1352dd0ff6dd89f4566a830424a8cf986f2fddb04704da4 libtorrent-0.13.8.tar.gz
-3cb44b4965149a9c70a9390104d5918dcb69671aa5d9ee3efa2f1c32b36f84619261a3b474c9651d040b60fe29ecbc42ba494ed7267443db0e865ebf9a2f79ce 0001-Fix-the-DH-parameters-generation-with-OpenSSL-1.1.patch"
+sha512sums="417177df5b27cd8c6a6317063b0846da2690de4633836466728605c2edad2de407d29d321cc481b8d1352dd0ff6dd89f4566a830424a8cf986f2fddb04704da4 libtorrent-0.13.8.tar.gz"