gnupg/g10 (ChangeLog armor.c g10.c)

cvs user dshaw cvs at cvs.gnupg.org
Thu Jan 6 05:38:07 CET 2005


    Date: Thursday, January 6, 2005 @ 05:44:38
  Author: dshaw
    Path: /cvs/gnupg/gnupg/g10

Modified: ChangeLog armor.c g10.c

* g10.c (main): Typo.

* armor.c (is_armor_header): Allow CR and LF (not just actual spaces) in
an armor header line (-----BEGIN etc).  This is needed due to CRLF issues
on win32.  As before, --openpgp makes it strict.


-----------+
 ChangeLog |    9 +++++++++
 armor.c   |   25 ++++++++++++++++---------
 g10.c     |    4 ++--
 3 files changed, 27 insertions(+), 11 deletions(-)


Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.676 gnupg/g10/ChangeLog:1.677
--- gnupg/g10/ChangeLog:1.676	Mon Jan  3 16:15:34 2005
+++ gnupg/g10/ChangeLog	Thu Jan  6 05:44:38 2005
@@ -1,3 +1,12 @@
+2005-01-05  David Shaw  <dshaw at jabberwocky.com>
+
+	* g10.c (main): Typo.
+
+	* armor.c (is_armor_header): Allow CR and LF (not just actual
+	spaces) in an armor header line (-----BEGIN etc).  This is needed
+	due to CRLF issues on win32.  As before, --openpgp makes it
+	strict.
+
 2005-01-03  David Shaw  <dshaw at jabberwocky.com>
 
 	* Makefile.am: Use @LIBUSB@ instead of @LIBUSB_LIBS@
Index: gnupg/g10/armor.c
diff -u gnupg/g10/armor.c:1.77 gnupg/g10/armor.c:1.78
--- gnupg/g10/armor.c:1.77	Thu Oct 14 22:13:16 2004
+++ gnupg/g10/armor.c	Thu Jan  6 05:44:38 2005
@@ -291,17 +291,24 @@
     save_p = p;
     p += 5;
 
-    /* Some mail programs on Windows seem to add spaces to the end of
-       the line.  This becomes strict if --openpgp is set. */
-
-    if(!RFC2440)
-      while(*p==' ')
+    /* Some Windows environments seem to add whitespace to the end of
+       the line, so we strip it here.  This becomes strict if
+       --rfc2440 is set since 2440 reads "The header lines, therefore,
+       MUST start at the beginning of a line, and MUST NOT have text
+       following them on the same line."  It is unclear whether "text"
+       refers to all text or just non-whitespace text. */
+
+    if(RFC2440)
+      {
+	if( *p == '\r' )
+	  p++;
+	if( *p == '\n' )
+	  p++;
+      }
+    else
+      while(*p==' ' || *p=='\r' || *p=='\n')
 	p++;
 
-    if( *p == '\r' )
-	p++;
-    if( *p == '\n' )
-	p++;
     if( *p )
 	return -1; /* garbage after dashes */
     save_c = *save_p; *save_p = 0;
Index: gnupg/g10/g10.c
diff -u gnupg/g10/g10.c:1.295 gnupg/g10/g10.c:1.296
--- gnupg/g10/g10.c:1.295	Mon Dec 20 06:19:09 2004
+++ gnupg/g10/g10.c	Thu Jan  6 05:44:38 2005
@@ -2607,8 +2607,8 @@
 
     if(require_secmem && !got_secmem)
       {
-	log_info(_("will not run with insecure memory due to %s"),
-		 "--require-secmem\n");
+	log_info(_("will not run with insecure memory due to %s\n"),
+		 "--require-secmem");
 	g10_exit(2);
       }
 




More information about the Gnupg-commits mailing list