Accepting request 548077 from network

- Add libmesode-0.9.1-openssl-1.1.patch:
  Fix build with openssl 1.1.
  Taken from commits:
  * 5ab52edb943985fc3943b33d9a6be1b23045a052
  * b91872cf7e7ed4d2443ab5c622f4cdb395d64dbe

OBS-URL: https://build.opensuse.org/request/show/548077
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libmesode?expand=0&rev=2
This commit is contained in:
Dominique Leuenberger 2017-12-05 00:30:28 +00:00 committed by Git OBS Bridge
parent 25fc123e23
commit 7a67d1570d
3 changed files with 117 additions and 2 deletions

View File

@ -0,0 +1,104 @@
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) {
From b91872cf7e7ed4d2443ab5c622f4cdb395d64dbe Mon Sep 17 00:00:00 2001
From: James Booth <boothj5@gmail.com>
Date: Fri, 24 Mar 2017 00:21:21 +0000
Subject: [PATCH] Fix getting SSL public key algorithm
---
src/tls_openssl.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/tls_openssl.c b/src/tls_openssl.c
index 6c93a4f..94e4c2b 100644
--- a/src/tls_openssl.c
+++ b/src/tls_openssl.c
@@ -169,15 +169,17 @@ 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);
+ 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);
+ X509_PUBKEY *pubkey = X509_get_X509_PUBKEY(cert);
+ ASN1_OBJECT *ppkalg = NULL;
+ int alg_nid = NID_undef;
+ res = X509_PUBKEY_get0_param(&ppkalg, NULL, NULL, NULL, pubkey);
+ if (res) {
+ alg_nid = OBJ_obj2nid(ppkalg);
+ }
#endif
- if (alg_nid != NID_undef) {
+ if (alg_nid != NID_undef) {
const char* keyalg = OBJ_nid2ln(alg_nid);
if (keyalg) {
tlscert->keyalg = xmpp_strdup(ctx, keyalg);
@@ -186,13 +188,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);
+ 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);
+ const X509_ALGOR *palg;
+ X509_get0_signature(NULL, &palg, cert);
+ alg_nid = OBJ_obj2nid(palg->algorithm);
#endif
- if (alg_nid != NID_undef) {
+ if (alg_nid != NID_undef) {
const char* sigalg = OBJ_nid2ln(alg_nid);
if (sigalg) {
tlscert->sigalg = xmpp_strdup(ctx, sigalg);

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Dec 4 12:53:40 UTC 2017 - mvetter@suse.com
- Add libmesode-0.9.1-openssl-1.1.patch:
Fix build with openssl 1.1.
Taken from commits:
* 5ab52edb943985fc3943b33d9a6be1b23045a052
* b91872cf7e7ed4d2443ab5c622f4cdb395d64dbe
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Nov 6 18:38:39 UTC 2016 - jengelh@inai.de Sun Nov 6 18:38:39 UTC 2016 - jengelh@inai.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package libmesode # spec file for package libmesode
# #
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -25,15 +25,16 @@ License: GPL-3.0+ or MIT
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Url: https://github.com/boothj5/libmesode Url: https://github.com/boothj5/libmesode
Source0: https://github.com/boothj5/%{name}/archive/%{version}.tar.gz Source0: https://github.com/boothj5/%{name}/archive/%{version}.tar.gz
Patch0: libmesode-0.9.1-openssl-1.1.patch
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
BuildRequires: gcc BuildRequires: gcc
BuildRequires: libexpat-devel >= 2.0.0
BuildRequires: libopenssl-devel BuildRequires: libopenssl-devel
BuildRequires: libtool BuildRequires: libtool
BuildRequires: libxml2-devel BuildRequires: libxml2-devel
BuildRequires: make BuildRequires: make
BuildRequires: pkg-config BuildRequires: pkg-config
BuildRequires: libexpat-devel >= 2.0.0
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
@ -62,6 +63,7 @@ implement real-time games, notification systems, and search engines.
%prep %prep
%setup -q %setup -q
%patch0 -p1
%build %build
mkdir m4 mkdir m4