* g10.c (main): Add --no-textmode.
[gnupg.git] / g10 / parse-packet.c
index d270ece..7b50206 100644 (file)
@@ -752,12 +752,12 @@ dump_sig_subpkt( int hashed, int type, int critical,
                type, (unsigned)length );
     }
     
+    buffer++;
+    length--;
    
     printf("\t%s%ssubpkt %d len %u (", /*)*/
              critical ? "critical ":"",
              hashed ? "hashed ":"", type, (unsigned)length );
-    buffer++;
-    length--;
     if( length > buflen ) {
        printf("too short: buffer is only %u)\n", (unsigned)buflen );
        return;
@@ -823,8 +823,6 @@ dump_sig_subpkt( int hashed, int type, int critical,
            fputs("notation: ", stdout );
            if( length < 8 )
                p = "[too short]";
-           else if( !(*buffer & 0x80) )
-               p = "[not human readable]";
            else {
                const byte *s = buffer;
                size_t n1, n2;
@@ -837,7 +835,11 @@ dump_sig_subpkt( int hashed, int type, int critical,
                else {
                    print_string( stdout, s, n1, ')' );
                    putc( '=', stdout );
-                   print_string( stdout, s+n1, n2, ')' );
+
+                   if( *buffer & 0x80 )
+                     print_string( stdout, s+n1, n2, ')' );
+                   else
+                     p = "[not human readable]";
                }
            }
        }
@@ -1068,13 +1070,15 @@ enum_sig_subpkt( const subpktarea_t *pktbuf, sigsubpkttype_t reqtype,
            if( *critical ) {
                if( n-1 > buflen+1 )
                    goto too_short;
-               if( !can_handle_critical(buffer+1, n-1, type ) ) {
-                   log_info(_("subpacket of type %d has critical bit set\n"),
-                                                                       type);
+               if( !can_handle_critical(buffer+1, n-1, type ) )
+                 {
+                   if(opt.verbose)
+                     log_info(_("subpacket of type %d has "
+                                "critical bit set\n"),type);
                    if( start )
-                       *start = seq;
+                     *start = seq;
                    return NULL; /* this is an error */
-               }
+                 }
            }
        }
        else if( reqtype < 0 ) /* list packets */