rpms/libaacs/devel libaacs-0.7.0-libgcrypt_1.6_support.patch, NONE, 1.1 libaacs.spec, 1.13, 1.14

Xavier Bachelot xavierb at rpmfusion.org
Sat Apr 26 16:52:49 CEST 2014


Author: xavierb

Update of /cvs/free/rpms/libaacs/devel
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv10656

Modified Files:
	libaacs.spec 
Added Files:
	libaacs-0.7.0-libgcrypt_1.6_support.patch 
Log Message:
- Add patch for libgcrypt 1.6 support.
- Tweak the Release: tag to accomodate rpmdev-bumpspec.
- Modernize specfile.


libaacs-0.7.0-libgcrypt_1.6_support.patch:
 ChangeLog            |    2 ++
 src/libaacs/crypto.c |   21 ++++++++++++++++-----
 2 files changed, 18 insertions(+), 5 deletions(-)

--- NEW FILE libaacs-0.7.0-libgcrypt_1.6_support.patch ---
>From cbc200ffc454b142f5def611cac607997f7983e5 Mon Sep 17 00:00:00 2001
From: Janusz Dziemidowicz <rraptorr at nails.eu.org>
Date: Wed, 25 Dec 2013 20:20:34 +0100
Subject: [PATCH] Support gcrypt 1.6.0

There seems to be a slight change in S-expressions (fortunately
backward compatible). There is also additional flag needed in rather
strange place (data section instead of key section), most probably a
bug in gcrypt.

Decrypting a 350MB file with gcrypt 1.5 takes around 4 seconds on Core
Quad Q9450 2.66GHz while with gcrypt 1.6 around 2.8s (the processor
does not support AES-NI).
---
 ChangeLog            |    2 ++
 src/libaacs/crypto.c |   20 ++++++++++++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5c2a9ad..4f0c8c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+ - Add support for gcrypt 1.6.0.
+
 2013-12-18: Version 0.7.0
  - Add aacs_get_device_binding_id() and aacs_get_device_nonce().
  - Add aacs_get_mk().
diff --git a/src/libaacs/crypto.c b/src/libaacs/crypto.c
index f1b54f8..0738f31 100644
--- a/src/libaacs/crypto.c
+++ b/src/libaacs/crypto.c
@@ -127,6 +127,9 @@ int crypto_init()
         if (!gcry_check_version(GCRYPT_VERSION)) {
             crypto_init_check = 0;
         }
+        if(GCRYPT_DEBUG) {
+            gcry_control(GCRYCTL_SET_DEBUG_FLAGS, 3);
+        }
     }
 
     return crypto_init_check;
@@ -297,14 +300,14 @@ static gcry_error_t _aacs_sexp_key(gcry_sexp_t *p_sexp_key,
     char *strfmt = str_printf(
       "(%s"
       "(ecdsa"
-      "(p #"AACS_EC_p"#)"
-      "(a #"AACS_EC_a"#)"
-      "(b #"AACS_EC_b"#)"
+      "(p #00"AACS_EC_p"#)"
+      "(a #00"AACS_EC_a"#)"
+      "(b #00"AACS_EC_b"#)"
       "(g #04"
           AACS_EC_G_x
           AACS_EC_G_y
           "#)"
-      "(n #"AACS_EC_n"#)"
+      "(n #00"AACS_EC_n"#)"
       "(q #%s#)"
       "%s))",
       mpi_d ? "private-key" : "public-key",
@@ -352,7 +355,16 @@ static gcry_error_t _aacs_sexp_sha1(gcry_sexp_t *p_sexp_data,
     GCRY_VERIFY("gcry_sexp_build",
                 gcry_sexp_build(p_sexp_data, NULL,
                                 "(data"
+#if defined(GCRYPT_VERSION_NUMBER) && GCRYPT_VERSION_NUMBER >= 0x010600
+                                /*
+                                 * For some reason gcrypt 1.6.0
+                                 * requires 'param' flag here and not
+                                 * in key, probably a bug.
+                                 */
+                                "  (flags raw param)"
+#else
                                 "  (flags raw)"
+#endif
                                 "  (value %m))",
                                 mpi_md
                                 ));
-- 
1.7.10.4



Index: libaacs.spec
===================================================================
RCS file: /cvs/free/rpms/libaacs/devel/libaacs.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- libaacs.spec	26 Apr 2014 13:54:01 -0000	1.13
+++ libaacs.spec	26 Apr 2014 14:52:49 -0000	1.14
@@ -1,20 +1,16 @@
-%global snapshot 0
+#global snapshot 1
 %global tarball_date 20111105
 %global git_hash 876f45a3f727eb6f06cdb2b0128f857226346e59
 %global git_short %(echo '%{git_hash}' | cut -c -13)
 
 Name:           libaacs
 Version:        0.7.0
-%if %{snapshot}
-Release:        0.5.%{tarball_date}git%{git_short}%{?dist}
-%else
-Release:        3%{?dist}
-%endif
+Release:        4%{?snapshot:.%{tarball_date}git%{git_short}}%{?dist}
 Summary:        Open implementation of AACS specification
 Group:          System Environment/Libraries
 License:        LGPLv2+
 URL:            http://www.videolan.org/developers/libaacs.html
-%if %{snapshot}
+%if 0%{?snapshot}
 # Use the commands below to generate a tarball.
 # git clone git://git.videolan.org/libaacs.git
 # cd libaacs
@@ -23,9 +19,10 @@
 %else
 Source0:        ftp://ftp.videolan.org/pub/videolan/%{name}/%{version}/%{name}-%{version}.tar.bz2
 %endif
-BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+# http://git.videolan.org/gitweb.cgi/libaacs.git/?p=libaacs.git;a=patch;h=cbc200ffc454b142f5def611cac607997f7983e5
+Patch0:         libaacs-0.7.0-libgcrypt_1.6_support.patch
 
-%if %{snapshot}
+%if 0%{?snapshot}
 BuildRequires:  autoconf
 BuildRequires:  automake
 BuildRequires:  libtool
@@ -60,16 +57,17 @@
 
 
 %prep
-%if %{snapshot}
+%if 0%{?snapshot}
 %setup -q -n %{name}
 %else
 %setup -q
 %endif
+%patch0 -p1 -b .libgcrypt-1.6
 sed -i -e 's/\r//' KEYDB.cfg
 
 
 %build
-%if %{snapshot}
+%if 0%{?snapshot}
 autoreconf -vif
 %endif
 %configure --disable-static
@@ -79,37 +77,34 @@
 
 
 %install
-rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
 find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
 
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
 
 
 %files
-%defattr(-,root,root,-)
 %doc COPYING KEYDB.cfg ChangeLog README.txt
 %{_libdir}/*.so.*
 
 %files utils
-%defattr(-,root,root,-)
 %{_bindir}/aacs_info
 
 %files devel
-%defattr(-,root,root,-)
 %{_includedir}/*
 %{_libdir}/*.so
 %{_libdir}/pkgconfig/libaacs.pc
 
 
 %changelog
+* Sat Apr 26 2014 Xavier Bachelot <xavier at bachelot.org> 0.7.0-4
+- Add patch for libgcrypt 1.6 support.
+- Tweak the Release: tag to accomodate rpmdev-bumpspec.
+- Modernize specfile.
+
 * Sat Apr 26 2014 Nicolas Chauvet <kwizart at gmail.com> - 0.7.0-3
 - Rebuilt for libgcrypt
 


More information about the rpmfusion-commits mailing list