* armor.c (radix64_read): No armor CRC is legal according to the spec (the
authorDavid Shaw <dshaw@jabberwocky.com>
Thu, 5 Aug 2004 20:18:44 +0000 (20:18 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Thu, 5 Aug 2004 20:18:44 +0000 (20:18 +0000)
CRC is a MAY).

g10/ChangeLog
g10/armor.c

index 0bbf97c..ab2c386 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-05  David Shaw  <dshaw@jabberwocky.com>
+
+       * armor.c (radix64_read): No armor CRC is legal according to the
+       spec (the CRC is a MAY).
+
 2004-07-28  David Shaw  <dshaw@jabberwocky.com>
 
        * misc.c (argsplit): Properly split quoted args from the keyword
 2004-07-28  David Shaw  <dshaw@jabberwocky.com>
 
        * misc.c (argsplit): Properly split quoted args from the keyword
index 5e17322..5cd798d 100644 (file)
@@ -771,7 +771,11 @@ radix64_read( armor_filter_context_t *afx, IOBUF a, size_t *retn,
            if( c == -1 ) {
                log_info(_("premature eof (in CRC)\n"));
                rc = invalid_crc();
            if( c == -1 ) {
                log_info(_("premature eof (in CRC)\n"));
                rc = invalid_crc();
-                           }
+           }
+           else if( idx == 0 ) {
+               /* No CRC at all is legal ("MAY") */
+               rc=0;
+           }
            else if( idx != 4 ) {
                log_info(_("malformed CRC\n"));
                rc = invalid_crc();
            else if( idx != 4 ) {
                log_info(_("malformed CRC\n"));
                rc = invalid_crc();