+ libimobiledevice-1.2.1-0.1

Add support for newer devices
This is a snapshot of the in-development 1.2.1 version
This commit is contained in:
Bastien Nocera 2019-11-25 12:49:35 +01:00
parent 8242092781
commit f6ac6945e9
5 changed files with 15710 additions and 5416 deletions

View File

@ -1,47 +0,0 @@
From 0994996671d98b67d576ebe4a7b1314a61411066 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Fri, 15 Sep 2017 16:00:09 +0200
Subject: [PATCH 1/2] userpref: [GnuTLS] Fix 3.6.0 SHA1 compatibility
Verification will fail if a special flag is not passed. Use
gnutls_x509_crt_sign2() instead of gnutls_x509_crt_sign() to make
sure that passing this flag works in 3.6.0 and stays working with
3.6.1.
---
common/userpref.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/common/userpref.c b/common/userpref.c
index 3ae503a..f496fee 100644
--- a/common/userpref.c
+++ b/common/userpref.c
@@ -603,7 +603,7 @@ userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_da
gnutls_x509_crt_set_ca_status(root_cert, 1);
gnutls_x509_crt_set_activation_time(root_cert, time(NULL));
gnutls_x509_crt_set_expiration_time(root_cert, time(NULL) + (60 * 60 * 24 * 365 * 10));
- gnutls_x509_crt_sign(root_cert, root_cert, root_privkey);
+ gnutls_x509_crt_sign2(root_cert, root_cert, root_privkey, GNUTLS_DIG_SHA1, 0);
gnutls_x509_crt_set_key(host_cert, host_privkey);
gnutls_x509_crt_set_serial(host_cert, "\x00", 1);
@@ -612,7 +612,7 @@ userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_da
gnutls_x509_crt_set_key_usage(host_cert, GNUTLS_KEY_KEY_ENCIPHERMENT | GNUTLS_KEY_DIGITAL_SIGNATURE);
gnutls_x509_crt_set_activation_time(host_cert, time(NULL));
gnutls_x509_crt_set_expiration_time(host_cert, time(NULL) + (60 * 60 * 24 * 365 * 10));
- gnutls_x509_crt_sign(host_cert, root_cert, root_privkey);
+ gnutls_x509_crt_sign2(host_cert, root_cert, root_privkey, GNUTLS_DIG_SHA1, 0);
/* export to PEM format */
size_t root_key_export_size = 0;
@@ -720,7 +720,7 @@ userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_da
}
gnutls_x509_crt_set_key_usage(dev_cert, GNUTLS_KEY_DIGITAL_SIGNATURE | GNUTLS_KEY_KEY_ENCIPHERMENT);
- gnutls_error = gnutls_x509_crt_sign(dev_cert, root_cert, root_privkey);
+ gnutls_error = gnutls_x509_crt_sign2(dev_cert, root_cert, root_privkey, GNUTLS_DIG_SHA1, 0);
if (GNUTLS_E_SUCCESS == gnutls_error) {
/* if everything went well, export in PEM format */
size_t export_size = 0;
--
2.14.1

View File

@ -1,45 +0,0 @@
From 3c1ca82ba31945de4e673525afb4774189011ce4 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Fri, 15 Sep 2017 16:02:42 +0200
Subject: [PATCH 2/2] userpref: [GnuTLS] Use valid serial for >= 3.6.0
Another change in 3.6.0 is that a serial of '\0' is not valid anymore.
Bump it to one.
---
common/userpref.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/common/userpref.c b/common/userpref.c
index f496fee..be745cb 100644
--- a/common/userpref.c
+++ b/common/userpref.c
@@ -598,7 +598,7 @@ userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_da
/* generate certificates */
gnutls_x509_crt_set_key(root_cert, root_privkey);
- gnutls_x509_crt_set_serial(root_cert, "\x00", 1);
+ gnutls_x509_crt_set_serial(root_cert, "\x01", 1);
gnutls_x509_crt_set_version(root_cert, 3);
gnutls_x509_crt_set_ca_status(root_cert, 1);
gnutls_x509_crt_set_activation_time(root_cert, time(NULL));
@@ -606,7 +606,7 @@ userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_da
gnutls_x509_crt_sign2(root_cert, root_cert, root_privkey, GNUTLS_DIG_SHA1, 0);
gnutls_x509_crt_set_key(host_cert, host_privkey);
- gnutls_x509_crt_set_serial(host_cert, "\x00", 1);
+ gnutls_x509_crt_set_serial(host_cert, "\x01", 1);
gnutls_x509_crt_set_version(host_cert, 3);
gnutls_x509_crt_set_ca_status(host_cert, 0);
gnutls_x509_crt_set_key_usage(host_cert, GNUTLS_KEY_KEY_ENCIPHERMENT | GNUTLS_KEY_DIGITAL_SIGNATURE);
@@ -703,7 +703,7 @@ userpref_error_t pair_record_generate_keys_and_certs(plist_t pair_record, key_da
if (GNUTLS_E_SUCCESS == gnutls_error) {
/* now generate device certificate */
gnutls_x509_crt_set_key(dev_cert, fake_privkey);
- gnutls_x509_crt_set_serial(dev_cert, "\x00", 1);
+ gnutls_x509_crt_set_serial(dev_cert, "\x01", 1);
gnutls_x509_crt_set_version(dev_cert, 3);
gnutls_x509_crt_set_ca_status(dev_cert, 0);
gnutls_x509_crt_set_activation_time(dev_cert, time(NULL));
--
2.14.1

View File

@ -1,18 +1,18 @@
Name: libimobiledevice
Version: 1.2.0
Release: 19%{?dist}
Version: 1.2.1
Release: 0.1%{?dist}
Summary: Library for connecting to mobile devices
License: LGPLv2+
URL: http://www.libimobiledevice.org/
Source0: http://www.libimobiledevice.org/downloads/%{name}-%{version}.tar.bz2
Source0: http://www.libimobiledevice.org/downloads/%{name}-1.2.0.tar.bz2
# Upstream patches, generated with:
# git format-patch --stdout 344409e1d1ad917d377b256214c5411dda82e6b0...5a85432719fb3d18027d528f87d2a44b76fd3e12
# b5a70e9aaf538dad0aba0b800b122955e8ac494b was manually removed
Patch0: 344409e1d1ad917d377b256214c5411dda82e6b0...5a85432719fb3d18027d528f87d2a44b76fd3e12.patch
# GNUTLS 3.6.0 bug fixes
Patch1: 0001-userpref-GnuTLS-Fix-3.6.0-SHA1-compatibility.patch
Patch2: 0002-userpref-GnuTLS-Use-valid-serial-for-3.6.0.patch
# git format-patch --stdout 344409e1d1ad917d377b256214c5411dda82e6b0...9b857fc42cdc4921e1e3f190c5ea907774e04758
# b5a70e9aaf538dad0aba0b800b122955e8ac494b
# 26373b334889f5ae2e2737ff447eb25b1700fa2f
# 97f8ac9e9ad9ee73ca635a26831bfe950a5d673b
# were manually removed
Patch0: a7568f456d10f1aff61534e3216201a857865247...9b857fc42cdc4921e1e3f190c5ea907774e04758.patch
BuildRequires: glib2-devel
BuildRequires: gnutls-devel
@ -46,7 +46,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
Utilites for use with libimobiledevice.
%prep
%autosetup -S git
%autosetup -S git_am -n %{name}-1.2.0
# Fix dir permissions on html docs
chmod +x docs/html
@ -72,7 +72,7 @@ find %{buildroot} -type f -name "*.la" -delete
%files
%{!?_licensedir:%global license %%doc}
%license COPYING.LESSER
%doc AUTHORS README
%doc AUTHORS README.md
%{_libdir}/libimobiledevice.so.6*
%files utils
@ -86,6 +86,11 @@ find %{buildroot} -type f -name "*.la" -delete
%{_includedir}/libimobiledevice/
%changelog
* Mon Nov 25 2019 Bastien Nocera <bnocera@redhat.com> - 1.2.1-0.1
+ libimobiledevice-1.2.1-0.1
- Add support for newer devices
- This is a snapshot of the in-development 1.2.1 version
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild