Armored Header Problem

Aric Cyr acyr at undergrad.math.uwaterloo.ca
Fri Nov 19 02:06:55 CET 1999


I am now to this mailing list, however I noticed that when using Pine and
exporting ascii-armored encrypted messages to a text file a whitespace
line can be created immediately following the "Version:" header.  If the
whitepsace line, which seems to terminate the header from the message, is
not composed of simply a CR or CRLF, then an "invalid header" is
generated.  Is this the correct behavior?  I would think that any line
containing only whitespace would be sufficient to terminate the header.
There is a simple work-around to this as given in the following patch
(against gnupg-1.0.0):

--- armor.c	Mon Jul 12 05:17:54 1999
+++ armor2.c	Fri Nov 19 01:52:07 1999
@@ -314,6 +314,9 @@
     if( *line == '\n' || ( len && (*line == '\r' && line[1]=='\n') ) )
 	return 0; /* empty line */
     len = trim_trailing_ws( line, len );
+    if( len == 0 )
+	return 0; /* whitespace only = empty line */
+
     p = strchr( line, ':');
     if( !p || !p[1] ) {
 	log_error(_("invalid armor header: "));


Does the OpenPGP or PGP standard state that the line following the header
should be EXACTLY a CR or CRLF only??

Thanks.

Aric Cyr
4A Computer Science
University of Waterloo
PGP Public Key at http://www.cryogen.com/acyr/pubkey.html



More information about the Gnupg-devel mailing list