[svn] GnuPG - r4130 - in branches/GNUPG-1-9-BRANCH: . include jnlib

svn author wk cvs at cvs.gnupg.org
Fri Apr 28 16:32:14 CEST 2006


Author: wk
Date: 2006-04-28 16:32:13 +0200 (Fri, 28 Apr 2006)
New Revision: 4130

Modified:
   branches/GNUPG-1-9-BRANCH/TODO
   branches/GNUPG-1-9-BRANCH/include/ChangeLog
   branches/GNUPG-1-9-BRANCH/include/cipher.h
   branches/GNUPG-1-9-BRANCH/jnlib/ChangeLog
   branches/GNUPG-1-9-BRANCH/jnlib/stringhelp.c
Log:
Fix for sanitize string.  Added SHA224


Modified: branches/GNUPG-1-9-BRANCH/TODO
===================================================================
--- branches/GNUPG-1-9-BRANCH/TODO	2006-04-28 14:31:29 UTC (rev 4129)
+++ branches/GNUPG-1-9-BRANCH/TODO	2006-04-28 14:32:13 UTC (rev 4130)
@@ -106,3 +106,8 @@
 
 * gpg/
 ** issue a NO_SECKEY xxxx if a -u key was not found.
+** Replace DIGEST_ALGO_SHA224
+   We can't do that right now because it is only defined by newer
+   versions of libgcrypt.  Changes this if we require libgcrypt 1.3
+   anyway.
+

Modified: branches/GNUPG-1-9-BRANCH/include/ChangeLog
===================================================================
--- branches/GNUPG-1-9-BRANCH/include/ChangeLog	2006-04-28 14:31:29 UTC (rev 4129)
+++ branches/GNUPG-1-9-BRANCH/include/ChangeLog	2006-04-28 14:32:13 UTC (rev 4130)
@@ -1,3 +1,7 @@
+2006-04-28  Werner Koch  <wk at g10code.com>
+
+	* cipher.h (DIGEST_ALGO_SHA224): Define it.
+
 2006-04-18  Werner Koch  <wk at g10code.com>
 
 	* keyserver.h, i18n.h, http.h, cipher.h: Updated to gpg 1.4.3.

Modified: branches/GNUPG-1-9-BRANCH/include/cipher.h
===================================================================
--- branches/GNUPG-1-9-BRANCH/include/cipher.h	2006-04-28 14:31:29 UTC (rev 4129)
+++ branches/GNUPG-1-9-BRANCH/include/cipher.h	2006-04-28 14:32:13 UTC (rev 4130)
@@ -68,6 +68,9 @@
 #define DIGEST_ALGO_SHA256    /*  8 */ GCRY_MD_SHA256
 #define DIGEST_ALGO_SHA384    /*  9 */ GCRY_MD_SHA384
 #define DIGEST_ALGO_SHA512    /* 10 */ GCRY_MD_SHA512
+/* SHA224 is as of now only defined in the libgcrypt SVN; thus we
+   can't use that macro.  */
+#define DIGEST_ALGO_SHA224    /* 11 */ 11 /* GCRY_MD_SHA224 */
 
 #define COMPRESS_ALGO_NONE 0
 #define COMPRESS_ALGO_ZIP  1

Modified: branches/GNUPG-1-9-BRANCH/jnlib/ChangeLog
===================================================================
--- branches/GNUPG-1-9-BRANCH/jnlib/ChangeLog	2006-04-28 14:31:29 UTC (rev 4129)
+++ branches/GNUPG-1-9-BRANCH/jnlib/ChangeLog	2006-04-28 14:32:13 UTC (rev 4130)
@@ -1,3 +1,10 @@
+2006-04-28  Werner Koch  <wk at g10code.com>
+
+	* stringhelp.c (print_sanitized_buffer): Fix bug where the count
+	got wrong for the \xNN representation.
+	(sanitize_buffer): Fix bug where some control characters lose part
+	of their \xNN representation.
+
 2006-04-20  Werner Koch  <wk at g10code.com>
 
 	* stringhelp.c (make_basename): New arg INPUTPATH for future

Modified: branches/GNUPG-1-9-BRANCH/jnlib/stringhelp.c
===================================================================
--- branches/GNUPG-1-9-BRANCH/jnlib/stringhelp.c	2006-04-28 14:31:29 UTC (rev 4129)
+++ branches/GNUPG-1-9-BRANCH/jnlib/stringhelp.c	2006-04-28 14:32:13 UTC (rev 4130)
@@ -1,6 +1,6 @@
 /* stringhelp.c -  standard string helper functions
- * Copyright (C) 1998, 1999, 2000, 2001, 2003,
- *               2004, 2005  Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+ *               2006  Free Software Foundation, Inc.
  *
  * This file is part of GnuPG.
  *
@@ -367,7 +367,7 @@
           else
             {
               fprintf (fp, "x%02x", *p);
-              count += 2;
+              count += 3;
             }
 	}
       else
@@ -428,7 +428,7 @@
   const unsigned char *save_p;
   char *buffer, *d;
 
-  /* first count length */
+  /* First count length. */
   for (save_n = n, save_p = p, buflen=1 ; n; n--, p++ ) 
     {
       if ( *p < 0x20 || *p == 0x7f || *p == delim  || (delim && *p=='\\'))
@@ -437,14 +437,14 @@
                || *p=='\v' || *p=='\b' || !*p )
             buflen += 2;
           else
-            buflen += 4;
+            buflen += 5;
 	}
       else
         buflen++;
     }
   p = save_p;
   n = save_n;
-  /* and now make the string */
+  /* And now make the string */
   d = buffer = jnlib_xmalloc( buflen );
   for ( ; n; n--, p++ )
     {
@@ -464,7 +464,7 @@
           *d++ = '0';
         else {
           sprintf(d, "x%02x", *p );
-          d += 2;
+          d += 3;
         }
       }
       else




More information about the Gnupg-commits mailing list