Commit f94c1b1a authored by Leo's avatar Leo Committed by Sören Tempel

main/bitlbee: switch to gnutls

Fixes #6062
parent ab9db009
......@@ -2,31 +2,28 @@
# Maintainer: Kiyoshi Aman <kiyoshi.aman@gmail.com>
pkgname=bitlbee
pkgver=3.5.1
pkgrel=6
pkgrel=7
pkgdesc="An IRC to other chat networks gateway"
url="https://www.bitlbee.org/"
arch="all"
license="GPL-2.0"
makedepends="python3 glib-dev openssl-dev libotr-dev"
license="GPL-2.0-or-later"
makedepends="python3 glib-dev gnutls-dev libotr-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-otr $pkgname-openrc"
source="http://get.bitlbee.org/src/$pkgname-$pkgver.tar.gz
openssl-1.1.patch
$pkgname.initd
$pkgname.confd
"
builddir="$srcdir/$pkgname-$pkgver"
build() {
cd "$builddir"
PYTHON=python3 \
./configure \
--build=$CBUILD \
--host=$CHOST \
--ssl=openssl \
--otr=plugin \
--prefix=/usr \
--etcdir=/etc/bitlbee
--etcdir=/etc/bitlbee \
--ssl=gnutls # https://bugs.bitlbee.org/ticket/886
make
}
......@@ -41,12 +38,12 @@ package() {
mkdir -p "$pkgdir"/var/lib/bitlbee
chown nobody:nobody "$pkgdir"/var/lib/bitlbee
}
otr() {
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/bitlbee "$subpkgdir"/usr/lib
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/bitlbee "$subpkgdir"/usr/lib
}
sha512sums="4eb3b0d3a92910c8dd789cd23338cc6296bf40212c5244fcb27a88ede10e86424ea59c78e719841863701a7fdd8c61819f2775f7b58833e287d9110e49d036f3 bitlbee-3.5.1.tar.gz
30361a2e5c9b6f08da521b9a802ff9ac74127434774eb5e68f051b545fd4bbaadb46cc76bab97d7e3139ea27db622fc7d889ce61c3464fedaff8775fa3e29444 openssl-1.1.patch
300c3445b9be6dac41bbd6d3a3ef5b871668743d4ea68dd779962d7af941cdaac61cb7c61e7ab2610bffac6dd9accc7ef9590593aef45e6930e2f49abaf9bf40 bitlbee.initd
d86e85eecafe080d331034cfc0b1f38d8e5582772d1e1d7175d14b396e1ce3dfd1b94e8ee97ef54b85181b3eacf39bacd378a1da5014515ed909554708907991 bitlbee.confd"
From 5c163e5063e01dfe94f73b2a3729c475cdd75467 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
Date: Thu, 24 May 2018 23:15:12 -0300
Subject: [PATCH] Openssl 1.1 support
This adds openssl 1.1.0 support.
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
---
lib/ssl_openssl.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/lib/ssl_openssl.c b/lib/ssl_openssl.c
index 2f668da2..16e05a94 100644
--- a/lib/ssl_openssl.c
+++ b/lib/ssl_openssl.c
@@ -64,11 +64,17 @@ void ssl_init(void)
{
const SSL_METHOD *meth;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_library_init();
meth = SSLv23_client_method();
ssl_ctx = SSL_CTX_new(meth);
SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
+#else
+ meth = TLS_client_method();
+ ssl_ctx = SSL_CTX_new(meth);
+ SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION);
+#endif
initialized = TRUE;
}
@@ -300,20 +306,20 @@ size_t ssl_des3_encrypt(const unsigned char *key, size_t key_len, const unsigned
const unsigned char *iv, unsigned char **res)
{
int output_length = 0;
- EVP_CIPHER_CTX ctx;
+ EVP_CIPHER_CTX *ctx;
*res = g_new0(unsigned char, 72);
/* Don't set key or IV because we will modify the parameters */
- EVP_CIPHER_CTX_init(&ctx);
- EVP_CipherInit_ex(&ctx, EVP_des_ede3_cbc(), NULL, NULL, NULL, 1);
- EVP_CIPHER_CTX_set_key_length(&ctx, key_len);
- EVP_CIPHER_CTX_set_padding(&ctx, 0);
+ ctx = EVP_CIPHER_CTX_new();
+ EVP_CipherInit_ex(ctx, EVP_des_ede3_cbc(), NULL, NULL, NULL, 1);
+ EVP_CIPHER_CTX_set_key_length(ctx, key_len);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
/* We finished modifying parameters so now we can set key and IV */
- EVP_CipherInit_ex(&ctx, NULL, NULL, key, iv, 1);
- EVP_CipherUpdate(&ctx, *res, &output_length, input, input_len);
- EVP_CipherFinal_ex(&ctx, *res, &output_length);
- EVP_CIPHER_CTX_cleanup(&ctx);
+ EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, 1);
+ EVP_CipherUpdate(ctx, *res, &output_length, input, input_len);
+ EVP_CipherFinal_ex(ctx, *res, &output_length);
+ EVP_CIPHER_CTX_free(ctx);
//EVP_cleanup();
return output_length;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment