!2 update to 1.3.0

Merge pull request !2 from 靳智敏/master
This commit is contained in:
openeuler-ci-bot 2020-08-11 09:42:12 +08:00 committed by Gitee
commit d7be0f19db
6 changed files with 12 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

Binary file not shown.

Binary file not shown.

View File

@ -1,17 +1,12 @@
Name: libimobiledevice
Version: 1.2.0
Release: 18
Version: 1.3.0
Release: 1
Summary: A library and tools to communicate with mobile devices
License: LGPLv2+
URL: http://www.libimobiledevice.org/
Source0: http://www.libimobiledevice.org/downloads/%{name}-%{version}.tar.bz2
Source0: http://github.com/libimobiledevice/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2
#Patch0 comes from fedora
Patch0: 344409e1d1ad917d377b256214c5411dda82e6b0...5a85432719fb3d18027d528f87d2a44b76fd3e12.patch
Patch1: 0001-userpref-GnuTLS-Fix-3.6.0-SHA1-compatibility.patch
Patch2: 0002-userpref-GnuTLS-Use-valid-serial-for-3.6.0.patch
BuildRequires: autoconf automake glib2-devel gnutls-devel git-core libusbmuxd-devel libusbx-devel
BuildRequires: autoconf automake glib2-devel gnutls-devel git-core libusbmuxd-devel libusbx-devel libimobiledevice
BuildRequires: libgcrypt-devel libplist-devel libtool libtasn1-devel libxml2-devel readline-devel swig
Obsoletes: libimobiledevice-utils
Provides: libimobiledevice-utils
@ -49,6 +44,8 @@ sed -i -e 's/^hardcode_libdir_flag_spec=.*/hardcode_libdir_flag_spec=""/g' \
%make_install
mv COPYING.LESSER COPYING
%delete_la_and_a
cp -a %{_libdir}/libimobiledevice.so.6 $RPM_BUILD_ROOT%{_libdir}
cp -a %{_libdir}/libimobiledevice.so.6.0.0 $RPM_BUILD_ROOT%{_libdir}
%post -p /sbin/ldconfig
@ -56,19 +53,23 @@ mv COPYING.LESSER COPYING
%files
%doc COPYING
%{_libdir}/libimobiledevice-1.0.so.6*
%{_libdir}/libimobiledevice.so.6*
%{_bindir}/idevice*
%files devel
%doc docs/html/
%{_libdir}/libimobiledevice.so
%{_libdir}/libimobiledevice-1.0.so
%{_libdir}/pkgconfig/libimobiledevice-1.0.pc
%{_includedir}/libimobiledevice/
%files help
%doc %{_datadir}/man/man1/idevice*
%doc AUTHORS README
%doc AUTHORS README.md
%changelog
* Thu Aug 6 2020 zhanzhimin <zhanzhimin@huawei.com> - 1.3.0-1
- Update to 1.3.0
* Thu Sep 19 2019 Yiru Wang <wangyiru1@huawei.com> - 1.2.0-18
- Pakcage init