[Gpg4win-commits] r1323 - in trunk: . patches patches/gnupg2-2.0.14

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jan 26 14:57:31 CET 2010


Author: werner
Date: 2010-01-26 14:57:30 +0100 (Tue, 26 Jan 2010)
New Revision: 1323

Added:
   trunk/patches/gnupg2-2.0.14/
   trunk/patches/gnupg2-2.0.14/01-encode-s2k.patch
Modified:
   trunk/ChangeLog
   trunk/Makefile.am
Log:
Fix gpgsm/gpg-agent bug introduced in 2.0.14.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-01-25 14:18:54 UTC (rev 1322)
+++ trunk/ChangeLog	2010-01-26 13:57:30 UTC (rev 1323)
@@ -1,3 +1,8 @@
+2010-01-26  Werner Koch  <wk at g10code.com>
+
+	* patches/gnupg2-2.0.14/01-encode-s2k.patch: New.
+	* Makefile.am (EXTRA_DIST): Add it.
+
 2010-01-25  Werner Koch  <wk at g10code.com>
 
 	* patches/gpgme-1.2.0/03-w32-socket.patch: Fix patch.

Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	2010-01-25 14:18:54 UTC (rev 1322)
+++ trunk/Makefile.am	2010-01-26 13:57:30 UTC (rev 1323)
@@ -56,6 +56,7 @@
 	patches/gnupg2-2.0.12/09-sm-keylist.patch \
 	patches/gnupg2-2.0.12/10-inv-sgnr.patch \
 	patches/gnupg2-2.0.12/11-photoid-sk.patch \
+	patches/gnupg2-2.0.14/01-encode-s2k.patch \
 	patches/dirmngr-1.0.3/01-ldaphttp.patch \
 	patches/gpgol-0.9.91/01-gpgme.patch \
         patches/gpa-0.9.0/01-title-prop.patch \

Added: trunk/patches/gnupg2-2.0.14/01-encode-s2k.patch
===================================================================
--- trunk/patches/gnupg2-2.0.14/01-encode-s2k.patch	2010-01-25 14:18:54 UTC (rev 1322)
+++ trunk/patches/gnupg2-2.0.14/01-encode-s2k.patch	2010-01-26 13:57:30 UTC (rev 1323)
@@ -0,0 +1,52 @@
+#! /bin/sh
+patch -p0 -f $* < $0
+exit $?
+
+agent/
+2010-01-26  Werner Koch  <wk at g10code.com>
+
+	* protect.c (do_encryption): Encode the s2kcount and no not use a
+	static value of 96.
+
+--- agent/protect.c	(revision 5231)
++++ agent/protect.c	(working copy)
+@@ -360,19 +360,25 @@
+        
+      in canoncical format of course.  We use asprintf and %n modifier
+      and dummy values as placeholders.  */
+-  p = xtryasprintf
+-    ("(9:protected%d:%s((4:sha18:%n_8bytes_2:96)%d:%n%*s)%d:%n%*s)",
+-     (int)strlen (modestr), modestr,
+-     &saltpos, 
+-     blklen, &ivpos, blklen, "",
+-     enclen, &encpos, enclen, "");
+-  if (!p)
+-    {
+-      gpg_error_t tmperr = out_of_core ();
+-      xfree (iv);
+-      xfree (outbuf);
+-      return tmperr;
+-    }
++  {
++    char countbuf[35];
++
++    snprintf (countbuf, sizeof countbuf, "%lu", get_standard_s2k_count ());
++    p = xtryasprintf
++      ("(9:protected%d:%s((4:sha18:%n_8bytes_%u:%s)%d:%n%*s)%d:%n%*s)",
++       (int)strlen (modestr), modestr,
++       &saltpos, 
++       (unsigned int)strlen (countbuf), countbuf,
++       blklen, &ivpos, blklen, "",
++       enclen, &encpos, enclen, "");
++    if (!p)
++      {
++        gpg_error_t tmperr = out_of_core ();
++        xfree (iv);
++        xfree (outbuf);
++        return tmperr;
++      }
++  }
+   *resultlen = strlen (p);
+   *result = (unsigned char*)p;
+   memcpy (p+saltpos, iv+2*blklen, 8);
+


Property changes on: trunk/patches/gnupg2-2.0.14/01-encode-s2k.patch
___________________________________________________________________
Name: svn:executable
   + *



More information about the Gpg4win-commits mailing list