libmesode: Update from 0.9.1 to 0.9.2

This commit is contained in:
Fredrik Fornwall 2018-09-22 04:35:03 +02:00
parent 9dad6ef82a
commit e185a1bcb7
2 changed files with 3 additions and 50 deletions

View File

@ -1,10 +1,9 @@
TERMUX_PKG_HOMEPAGE=https://github.com/boothj5/libmesode
TERMUX_PKG_DESCRIPTION="libmesode is a minimal XMPP library written in C. Fork of libstrophe for use with Profanity XMPP Client. Provides extra TLS functionality such as manual SSL certificate verfication"
TERMUX_PKG_VERSION=0.9.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_DESCRIPTION="Minimal XMPP library written for use with Profanity XMPP client"
TERMUX_PKG_VERSION=0.9.2
TERMUX_PKG_MAINTAINER="Oliver Schmidhauser @Neo-Oli"
TERMUX_PKG_SRCURL=https://github.com/boothj5/libmesode/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=e693ea1577f0d9e6e58dd8ada9825c359784a225620cbc2fde7295369d295245
TERMUX_PKG_SHA256=79bdf92e287d8891a8eb89d84a8b1bb1c3f61ded322630f583ec1d1c00d99123
TERMUX_PKG_DEPENDS="openssl,libexpat"
TERMUX_PKG_BUILD_IN_SRC=yes

View File

@ -1,46 +0,0 @@
From 5ab52edb943985fc3943b33d9a6be1b23045a052 Mon Sep 17 00:00:00 2001
From: Jelle van der Waa <jelle@vdwaa.nl>
Date: Wed, 15 Mar 2017 20:25:53 +0100
Subject: [PATCH] Fix build with OpenSSL 1.1.x
OpenSSL 1.1.x made many structs opaque and helpers are required to access
members of struct. TX509_PUBKEY_get0_param returns 1 for succes and 0 on
failure, this has not been handled yet by this patch.
---
src/tls_openssl.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/tls_openssl.c b/src/tls_openssl.c
index 3118adc..89e2643 100644
--- a/src/tls_openssl.c
+++ b/src/tls_openssl.c
@@ -168,7 +168,15 @@ static struct _tlscert_t *_x509_to_tlscert(xmpp_ctx_t *ctx, X509 *cert)
}
tlscert->keyalg = NULL;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
int alg_nid = OBJ_obj2nid(cert->cert_info->key->algor->algorithm);
+#else
+ X509_PUBKEY *pubkey = X509_get_X509_PUBKEY(cert);
+ ASN1_OBJECT *ppkalg;
+ // FIXME: handle 0 on error.
+ X509_PUBKEY_get0_param(&ppkalg, NULL, NULL, NULL, NULL);
+ int alg_nid = OBJ_obj2nid(ppkalg);
+#endif
if (alg_nid != NID_undef) {
const char* keyalg = OBJ_nid2ln(alg_nid);
if (keyalg) {
@@ -177,7 +185,13 @@ static struct _tlscert_t *_x509_to_tlscert(xmpp_ctx_t *ctx, X509 *cert)
}
tlscert->sigalg = NULL;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
alg_nid = OBJ_obj2nid(cert->sig_alg->algorithm);
+#else
+ const X509_ALGOR *palg;
+ X509_get0_signature(NULL, &palg, cert);
+ alg_nid = OBJ_obj2nid(palg->algorithm);
+#endif
if (alg_nid != NID_undef) {
const char* sigalg = OBJ_nid2ln(alg_nid);
if (sigalg) {