rpms/libbdplus/devel libbdplus-0.1.0-libgcrypt_1.6_support.patch, NONE, 1.1 libbdplus.spec, 1.2, 1.3

Xavier Bachelot xavierb at rpmfusion.org
Sat Apr 26 17:02:00 CEST 2014


Author: xavierb

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

Modified Files:
	libbdplus.spec 
Added Files:
	libbdplus-0.1.0-libgcrypt_1.6_support.patch 
Log Message:
Add patch for libgcrypt 1.6 support

libbdplus-0.1.0-libgcrypt_1.6_support.patch:
 trap.c |   50 +++++++++++++++++++++++++++++---------------------
 1 file changed, 29 insertions(+), 21 deletions(-)

--- NEW FILE libbdplus-0.1.0-libgcrypt_1.6_support.patch ---
>From a47d4a95762d960653599d83281d4ede92663b99 Mon Sep 17 00:00:00 2001
From: Janusz Dziemidowicz <rraptorr at nails.eu.org>
Date: Thu, 30 Jan 2014 11:31:17 +0200
Subject: [PATCH] Gcrypt 1.6 support

Similar changes as required by libaacs. Works fine with both gcrypt
1.5.x and 1.6.x.
---
 src/libbdplus/bdsvm/trap.c |   49 ++++++++++++++++++++++++++------------------
 1 file changed, 29 insertions(+), 20 deletions(-)

diff --git a/src/libbdplus/bdsvm/trap.c b/src/libbdplus/bdsvm/trap.c
index 213c2a4..d97f920 100644
--- a/src/libbdplus/bdsvm/trap.c
+++ b/src/libbdplus/bdsvm/trap.c
@@ -436,7 +436,16 @@ uint32_t TRAP_PrivateKey(bdplus_config_t *config, uint32_t keyID, uint8_t *dst,
     /* Build an s-expression for the hash */
     gcry_sexp_build(&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_hash
                     );
@@ -472,35 +481,35 @@ uint32_t TRAP_PrivateKey(bdplus_config_t *config, uint32_t keyID, uint8_t *dst,
       strfmt_key = (char*)malloc(
         sizeof("(private-key") +
         sizeof("(ecdsa") +
-        sizeof("(p #") + sizeof(CA_q) + sizeof("#)") +
-        sizeof("(a #") + sizeof(CA_a) + sizeof("#)") +
-        sizeof("(b #") + sizeof(CA_b) + sizeof("#)") +
+        sizeof("(p #00") + sizeof(CA_q) + sizeof("#)") +
+        sizeof("(a #00") + sizeof(CA_a) + sizeof("#)") +
+        sizeof("(b #00") + sizeof(CA_b) + sizeof("#)") +
         sizeof("(g #04") +
             sizeof(CA_x_G) +
             sizeof(CA_y_G) +
             sizeof("#)") +
-        sizeof("(n #") + sizeof(CA_n) + sizeof("#)") +
+        sizeof("(n #00") + sizeof(CA_n) + sizeof("#)") +
         sizeof("(q #04") +
             strlen(CA_x_Q0) +
             strlen(CA_y_Q0) +
             sizeof("#)") +
-        sizeof("(d #") + strlen(CA_d0) + sizeof("#)))") + 1);
+        sizeof("(d #00") + strlen(CA_d0) + sizeof("#)))") + 1);
       sprintf(strfmt_key,
         "(private-key"
         "(ecdsa"
-        "(p #%s#)"
-        "(a #%s#)"
-        "(b #%s#)"
+        "(p #00%s#)"
+        "(a #00%s#)"
+        "(b #00%s#)"
         "(g #04"
             "%s"
             "%s"
             "#)"
-        "(n #%s#)"
+        "(n #00%s#)"
         "(q #04"
             "%s"
             "%s"
             "#)"
-        "(d #%s#)))",
+        "(d #00%s#)))",
         CA_q,
         CA_a,
         CA_b,
@@ -517,35 +526,35 @@ uint32_t TRAP_PrivateKey(bdplus_config_t *config, uint32_t keyID, uint8_t *dst,
       strfmt_key = (char*)malloc(
         sizeof("(private-key") +
         sizeof("(ecdsa") +
-        sizeof("(p #") + sizeof(CA_q) + sizeof("#)") +
-        sizeof("(a #") + sizeof(CA_a) + sizeof("#)") +
-        sizeof("(b #") + sizeof(CA_b) + sizeof("#)") +
+        sizeof("(p #00") + sizeof(CA_q) + sizeof("#)") +
+        sizeof("(a #00") + sizeof(CA_a) + sizeof("#)") +
+        sizeof("(b #00") + sizeof(CA_b) + sizeof("#)") +
         sizeof("(g #04") +
             sizeof(CA_x_G) +
             sizeof(CA_y_G) +
             sizeof("#)") +
-        sizeof("(n #") + sizeof(CA_n) + sizeof("#)") +
+        sizeof("(n #00") + sizeof(CA_n) + sizeof("#)") +
         sizeof("(q #04") +
             strlen(CA_x_Q1) +
             strlen(CA_y_Q1) +
             sizeof("#)") +
-        sizeof("(d #") + strlen(CA_d1) + sizeof("#)))") + 1);
+        sizeof("(d #00") + strlen(CA_d1) + sizeof("#)))") + 1);
       sprintf(strfmt_key,
         "(private-key"
         "(ecdsa"
-        "(p #%s#)"
-        "(a #%s#)"
-        "(b #%s#)"
+        "(p #00%s#)"
+        "(a #00%s#)"
+        "(b #00%s#)"
         "(g #04"
             "%s"
             "%s"
             "#)"
-        "(n #%s#)"
+        "(n #00%s#)"
         "(q #04"
             "%s"
             "%s"
             "#)"
-        "(d #%s#)))",
+        "(d #00%s#)))",
         CA_q,
         CA_a,
         CA_b,
-- 
1.7.10.4



Index: libbdplus.spec
===================================================================
RCS file: /cvs/free/rpms/libbdplus/devel/libbdplus.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- libbdplus.spec	26 Apr 2014 13:50:04 -0000	1.2
+++ libbdplus.spec	26 Apr 2014 15:02:00 -0000	1.3
@@ -1,10 +1,12 @@
 Name:           libbdplus
 Version:        0.1.0
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Open implementation of BD+ protocol
 License:        LGPLv2+
 URL:            http://www.videolan.org/developers/libbdplus.html
 Source0:        ftp://ftp.videolan.org/pub/videolan/%{name}/%{version}/%{name}-%{version}.tar.bz2
+# http://git.videolan.org/gitweb.cgi/libbdplus.git/?p=libbdplus.git;a=patch;h=a47d4a95762d960653599d83281d4ede92663b99
+Patch0:         libbdplus-0.1.0-libgcrypt_1.6_support.patch
 
 BuildRequires:  libgcrypt-devel
 BuildRequires:  libaacs-devel >= 0.7.0
@@ -27,6 +29,7 @@
 
 %prep
 %setup -q
+%patch0 -p1 -b .libgcrypt-1.6
 
 
 %build
@@ -55,6 +58,9 @@
 
 
 %changelog
+* Sat Apr 26 2014 Xavier Bachelot <xavier at bachelot.org> - 0.1.0-4
+- Add patch for libgcrypt 1.6 support.
+
 * Sat Apr 26 2014 Nicolas Chauvet <kwizart at gmail.com> - 0.1.0-3
 - Rebuilt for libgcrypt
 


More information about the rpmfusion-commits mailing list