From 8cc8896445daca4d328539cb59820234e15f9efb Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 21 Sep 2011 16:22:26 +0100 Subject: [PATCH] Fix compilation against recent version of gnutls --- ...d-gnutls_-_set_priority-and-use-gnut.patch | 54 +++++++++++++++++++ libimobiledevice.spec | 9 +++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 0001-Remove-deprecated-gnutls_-_set_priority-and-use-gnut.patch diff --git a/0001-Remove-deprecated-gnutls_-_set_priority-and-use-gnut.patch b/0001-Remove-deprecated-gnutls_-_set_priority-and-use-gnut.patch new file mode 100644 index 0000000..b5c790a --- /dev/null +++ b/0001-Remove-deprecated-gnutls_-_set_priority-and-use-gnut.patch @@ -0,0 +1,54 @@ +From 6dccecddf012a0a404d121cc2c42ddce7c485fb7 Mon Sep 17 00:00:00 2001 +From: Martin Szulecki +Date: Sat, 30 Apr 2011 16:46:54 +0200 +Subject: [PATCH] Remove deprecated gnutls_*_set_priority() and use + gnutls_priority_set_direct() + +This change requires gnutls >= 2.2.0 for the latter to be available. +With deprecation starts with gnutls 2.12.0. +--- + configure.ac | 2 +- + src/idevice.c | 14 +------------- + 2 files changed, 2 insertions(+), 14 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 9390ccf..cdfaa36 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -29,7 +29,7 @@ AC_PROG_LIBTOOL + PKG_CHECK_MODULES(libusbmuxd, libusbmuxd >= 0.1.4) + PKG_CHECK_MODULES(libglib2, glib-2.0 >= 2.14.1) + PKG_CHECK_MODULES(libgthread2, gthread-2.0 >= 2.14.1) +-PKG_CHECK_MODULES(libgnutls, gnutls >= 1.6.3 ) ++PKG_CHECK_MODULES(libgnutls, gnutls >= 2.2.0) + PKG_CHECK_MODULES(libtasn1, libtasn1 >= 1.1) + PKG_CHECK_MODULES(libplist, libplist >= 0.15) + PKG_CHECK_MODULES(libplistmm, libplist++ >= 0.15) +diff --git a/src/idevice.c b/src/idevice.c +index 5a9d49b..3676b5c 100644 +--- a/src/idevice.c ++++ b/src/idevice.c +@@ -586,19 +586,7 @@ idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection) + gnutls_certificate_allocate_credentials(&ssl_data_loc->certificate); + gnutls_certificate_client_set_retrieve_function (ssl_data_loc->certificate, internal_cert_callback); + gnutls_init(&ssl_data_loc->session, GNUTLS_CLIENT); +- { +- int protocol_priority[16] = { GNUTLS_SSL3, 0 }; +- int kx_priority[16] = { GNUTLS_KX_ANON_DH, GNUTLS_KX_RSA, 0 }; +- int cipher_priority[16] = { GNUTLS_CIPHER_AES_128_CBC, GNUTLS_CIPHER_AES_256_CBC, 0 }; +- int mac_priority[16] = { GNUTLS_MAC_SHA1, GNUTLS_MAC_MD5, 0 }; +- int comp_priority[16] = { GNUTLS_COMP_NULL, 0 }; +- +- gnutls_cipher_set_priority(ssl_data_loc->session, cipher_priority); +- gnutls_compression_set_priority(ssl_data_loc->session, comp_priority); +- gnutls_kx_set_priority(ssl_data_loc->session, kx_priority); +- gnutls_protocol_set_priority(ssl_data_loc->session, protocol_priority); +- gnutls_mac_set_priority(ssl_data_loc->session, mac_priority); +- } ++ 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); + gnutls_session_set_ptr(ssl_data_loc->session, ssl_data_loc); + +-- +1.7.6.2 + diff --git a/libimobiledevice.spec b/libimobiledevice.spec index 5411568..b372bd8 100644 --- a/libimobiledevice.spec +++ b/libimobiledevice.spec @@ -2,7 +2,7 @@ Name: libimobiledevice Version: 1.1.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library for connecting to mobile devices Group: System Environment/Libraries @@ -23,6 +23,9 @@ BuildRequires: usbmuxd-devel Provides: libiphone = %{version} Obsoletes: libiphone < 0.9.7 +# http://cgit.sukimashita.com/libimobiledevice.git/commit/?id=6dccecddf012a0a404d121cc2c42ddce7c485fb7 +Patch0: 0001-Remove-deprecated-gnutls_-_set_priority-and-use-gnut.patch + %description libimobiledevice is a library for connecting to mobile devices including phones and music players @@ -51,6 +54,7 @@ Python bindings for libimobiledevice. %prep %setup -q +%patch0 -p1 -b .gnutls # Fix dir permissions on html docs chmod +x docs/html @@ -98,6 +102,9 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' %{python_sitearch}/imobiledevice/ %changelog +* Wed Sep 21 2011 Bastien Nocera 1.1.1-2 +- Fix compilation against recent version of gnutls + * Fri Apr 28 2011 Peter Robinson 1.1.1-1 - New 1.1.1 release