libimobiledevice update
This commit is contained in:
@@ -0,0 +1,51 @@
|
|||||||
|
From 2a5868411c57e25802d2f16fd6b77601f10d0b72 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
|
||||||
|
Date: Fri, 29 Apr 2016 22:58:34 +0200
|
||||||
|
Subject: [PATCH] Updated gnutls certificate callback to new API (backwards
|
||||||
|
compatible)
|
||||||
|
|
||||||
|
---
|
||||||
|
src/idevice.c | 13 +++++++++++++
|
||||||
|
1 file changed, 13 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/idevice.c b/src/idevice.c
|
||||||
|
index 5912aeb..f2de6a3 100644
|
||||||
|
--- a/src/idevice.c
|
||||||
|
+++ b/src/idevice.c
|
||||||
|
@@ -642,7 +642,11 @@ static const char *ssl_error_to_string(int e)
|
||||||
|
/**
|
||||||
|
* Internally used gnutls callback function that gets called during handshake.
|
||||||
|
*/
|
||||||
|
+#if GNUTLS_VERSION_NUMBER >= 0x020b07
|
||||||
|
+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)
|
||||||
|
+#else
|
||||||
|
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)
|
||||||
|
+#endif
|
||||||
|
{
|
||||||
|
int res = -1;
|
||||||
|
gnutls_certificate_type_t type = gnutls_certificate_type_get(session);
|
||||||
|
@@ -650,7 +654,12 @@ 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");
|
||||||
|
+#if GNUTLS_VERSION_NUMBER >= 0x020b07
|
||||||
|
+ st->cert_type = type;
|
||||||
|
+ st->key_type = GNUTLS_PRIVKEY_X509;
|
||||||
|
+#else
|
||||||
|
st->type = type;
|
||||||
|
+#endif
|
||||||
|
st->ncerts = 1;
|
||||||
|
st->cert.x509 = &ssl_data->host_cert;
|
||||||
|
st->key.x509 = ssl_data->host_privkey;
|
||||||
|
@@ -759,7 +768,11 @@ 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);
|
||||||
|
+#if GNUTLS_VERSION_NUMBER >= 0x020b07
|
||||||
|
+ gnutls_certificate_set_retrieve_function(ssl_data_loc->certificate, internal_cert_callback);
|
||||||
|
+#else
|
||||||
|
gnutls_certificate_client_set_retrieve_function(ssl_data_loc->certificate, internal_cert_callback);
|
||||||
|
+#endif
|
||||||
|
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);
|
||||||
@@ -14,14 +14,17 @@
|
|||||||
<IsA>app:console</IsA>
|
<IsA>app:console</IsA>
|
||||||
<Summary>Library for connecting to mobile devices</Summary>
|
<Summary>Library for connecting to mobile devices</Summary>
|
||||||
<Description>libimobiledevice is a library for connecting to mobile devices including phones and music players</Description>
|
<Description>libimobiledevice is a library for connecting to mobile devices including phones and music players</Description>
|
||||||
<Archive sha1sum="ac47ba39e7f8d8cb9379756773ece30458b93c80" type="tarbz2">http://www.libimobiledevice.org/downloads/libimobiledevice-1.1.7.tar.bz2</Archive>
|
<Archive sha1sum="a8e3f21180b1d6df754d04a4080a29cf6891e701" type="tarbz2">http://www.libimobiledevice.org/downloads/libimobiledevice-1.2.0.tar.bz2</Archive>
|
||||||
<BuildDependencies>
|
<BuildDependencies>
|
||||||
<Dependency>gnutls-devel</Dependency>
|
<Dependency>gnutls-devel</Dependency>
|
||||||
<Dependency>usbmuxd-devel</Dependency>
|
<Dependency>usbmuxd-devel</Dependency>
|
||||||
<Dependency>libplist-devel</Dependency>
|
<Dependency>libplist-devel</Dependency>
|
||||||
<Dependency>libtasn1-devel</Dependency>
|
<Dependency>libtasn1-devel</Dependency>
|
||||||
<Dependency>libgcrypt-devel</Dependency>
|
<Dependency>libgcrypt-devel</Dependency>
|
||||||
</BuildDependencies>
|
</BuildDependencies>
|
||||||
|
<Patches>
|
||||||
|
<Patch>gnutls-3.4.patch</Patch>
|
||||||
|
</Patches>
|
||||||
</Source>
|
</Source>
|
||||||
|
|
||||||
<Package>
|
<Package>
|
||||||
@@ -59,6 +62,13 @@
|
|||||||
</Package>
|
</Package>
|
||||||
|
|
||||||
<History>
|
<History>
|
||||||
|
<Update release="3">
|
||||||
|
<Date>2017-03-01</Date>
|
||||||
|
<Version>1.2.0</Version>
|
||||||
|
<Comment>Version bump.</Comment>
|
||||||
|
<Name>Ertuğrul Erata</Name>
|
||||||
|
<Email>ertugrulerata@gmail.com</Email>
|
||||||
|
</Update>
|
||||||
<Update release="2">
|
<Update release="2">
|
||||||
<Date>2016-06-09</Date>
|
<Date>2016-06-09</Date>
|
||||||
<Version>1.1.7</Version>
|
<Version>1.1.7</Version>
|
||||||
|
|||||||
Reference in New Issue
Block a user