Fix the build with gnutls 3.4
Thanks to Nikos Mavrogiannopoulos for the patch!
This commit is contained in:
parent
d849c92252
commit
c28c931034
44
0001-Updated-cert-callback-to-gnutls3-API.patch
Normal file
44
0001-Updated-cert-callback-to-gnutls3-API.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From a7a046b0314142c7b2f6b26e632c5b00d65787cf Mon Sep 17 00:00:00 2001
|
||||
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
|
||||
Date: Wed, 26 Aug 2015 13:43:15 +0200
|
||||
Subject: [PATCH] Updated cert callback to gnutls3 API
|
||||
|
||||
---
|
||||
src/idevice.c | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/idevice.c b/src/idevice.c
|
||||
index ce27495..0cf6641 100644
|
||||
--- a/src/idevice.c
|
||||
+++ b/src/idevice.c
|
||||
@@ -626,7 +626,7 @@ static const char *ssl_error_to_string(int e)
|
||||
/**
|
||||
* Internally used gnutls callback function that gets called during handshake.
|
||||
*/
|
||||
-static int internal_cert_callback(gnutls_session_t session, const gnutls_datum_t * req_ca_rdn, int nreqs, const gnutls_pk_algorithm_t * sign_algos, int sign_algos_length, gnutls_retr_st * st)
|
||||
+static int internal_cert_callback(gnutls_session_t session, const gnutls_datum_t * req_ca_rdn, int nreqs, const gnutls_pk_algorithm_t * sign_algos, int sign_algos_length, gnutls_retr2_st * st)
|
||||
{
|
||||
int res = -1;
|
||||
gnutls_certificate_type_t type = gnutls_certificate_type_get(session);
|
||||
@@ -634,7 +634,8 @@ static int internal_cert_callback(gnutls_session_t session, const gnutls_datum_t
|
||||
ssl_data_t ssl_data = (ssl_data_t)gnutls_session_get_ptr(session);
|
||||
if (ssl_data && ssl_data->host_privkey && ssl_data->host_cert) {
|
||||
debug_info("Passing certificate");
|
||||
- st->type = type;
|
||||
+ st->cert_type = type;
|
||||
+ st->key_type = GNUTLS_PRIVKEY_X509;
|
||||
st->ncerts = 1;
|
||||
st->cert.x509 = &ssl_data->host_cert;
|
||||
st->key.x509 = ssl_data->host_privkey;
|
||||
@@ -743,7 +744,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_enable_ssl(idevice_conne
|
||||
debug_info("enabling SSL mode");
|
||||
errno = 0;
|
||||
gnutls_certificate_allocate_credentials(&ssl_data_loc->certificate);
|
||||
- gnutls_certificate_client_set_retrieve_function(ssl_data_loc->certificate, internal_cert_callback);
|
||||
+ gnutls_certificate_set_retrieve_function(ssl_data_loc->certificate, internal_cert_callback);
|
||||
gnutls_init(&ssl_data_loc->session, GNUTLS_CLIENT);
|
||||
gnutls_priority_set_direct(ssl_data_loc->session, "NONE:+VERS-SSL3.0:+ANON-DH:+RSA:+AES-128-CBC:+AES-256-CBC:+SHA1:+MD5:+COMP-NULL", NULL);
|
||||
gnutls_credentials_set(ssl_data_loc->session, GNUTLS_CRD_CERTIFICATE, ssl_data_loc->certificate);
|
||||
--
|
||||
2.4.3
|
||||
|
||||
@ -7,13 +7,15 @@
|
||||
|
||||
Name: libimobiledevice
|
||||
Version: 1.2.0
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
Summary: Library for connecting to mobile devices
|
||||
|
||||
Group: System Environment/Libraries
|
||||
License: LGPLv2+
|
||||
URL: http://www.libimobiledevice.org/
|
||||
Source0: http://www.libimobiledevice.org/downloads/%{name}-%{version}.tar.bz2
|
||||
# Fix the build with gnutls 3.4
|
||||
Patch0: 0001-Updated-cert-callback-to-gnutls3-API.patch
|
||||
|
||||
BuildRequires: glib2-devel
|
||||
BuildRequires: gnutls-devel
|
||||
@ -62,6 +64,7 @@ Python bindings for libimobiledevice.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
|
||||
# Fix dir permissions on html docs
|
||||
chmod +x docs/html
|
||||
@ -108,6 +111,9 @@ find %{buildroot} -type f -name "*.la" -delete
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed Aug 26 2015 Kalev Lember <klember@redhat.com> - 1.2.0-3
|
||||
- Fix the build with gnutls 3.4
|
||||
|
||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user