* options.h, g10.c (main), mainproc.c (check_sig_and_print): Add
authorDavid Shaw <dshaw@jabberwocky.com>
Tue, 30 Sep 2003 21:16:36 +0000 (21:16 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Tue, 30 Sep 2003 21:16:36 +0000 (21:16 +0000)
--verify-option show-unusable-uids.

g10/ChangeLog
g10/g10.c
g10/mainproc.c
g10/options.h

index 4e752c0..a6e00c6 100644 (file)
@@ -1,5 +1,8 @@
 2003-09-30  David Shaw  <dshaw@jabberwocky.com>
 
+       * options.h, g10.c (main), mainproc.c (check_sig_and_print): Add
+       --verify-option show-unusable-uids.
+
        * gpgv.c (check_trustdb_stale): Stub.
 
        * trustdb.c (get_validity): Move the up-to-date check to
index f50bbe8..35ce3e0 100644 (file)
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -1829,6 +1829,7 @@ main( int argc, char **argv )
                  {"show-keyserver-url",VERIFY_SHOW_KEYSERVER},
                  {"show-validity",VERIFY_SHOW_VALIDITY},
                  {"show-long-keyid",VERIFY_SHOW_LONG_KEYID},
+                 {"show-unusable-uids",VERIFY_SHOW_UNUSABLE_UIDS},
                  {NULL,0}
                };
 
index f92181e..e6522f1 100644 (file)
@@ -1345,7 +1345,7 @@ check_sig_and_print( CTX c, KBNODE node )
                 continue;
            if ( !un->pkt->pkt.user_id->is_primary )
                continue;
-           /* We want the textual user ID here */
+           /* We want the textual primary user ID here */
            if ( un->pkt->pkt.user_id->attrib_data )
                continue;
 
@@ -1417,10 +1417,10 @@ check_sig_and_print( CTX c, KBNODE node )
             for( un=keyblock; un; un = un->next ) {
                 if( un->pkt->pkttype != PKT_USER_ID )
                     continue;
-                if ( un->pkt->pkt.user_id->is_revoked )
-                    continue;
-                if ( un->pkt->pkt.user_id->is_expired )
-                    continue;
+                if((un->pkt->pkt.user_id->is_revoked
+                   || un->pkt->pkt.user_id->is_expired)
+                  && !(opt.verify_options&VERIFY_SHOW_UNUSABLE_UIDS))
+                 continue;
                /* Only skip textual primaries */
                 if ( un->pkt->pkt.user_id->is_primary &&
                     !un->pkt->pkt.user_id->attrib_data )
@@ -1440,10 +1440,18 @@ check_sig_and_print( CTX c, KBNODE node )
                                                  un->pkt->pkt.user_id->len );
 
                if(opt.verify_options&VERIFY_SHOW_VALIDITY)
-                 fprintf(log_stream(),"\" [%s]\n",
-                         trust_value_to_string(get_validity(pk,
-                                                            un->pkt->
-                                                            pkt.user_id)));
+                 {
+                   const char *valid;
+                   if(un->pkt->pkt.user_id->is_revoked)
+                     valid=_("revoked");
+                   else if(un->pkt->pkt.user_id->is_expired)
+                     valid=_("expired");
+                   else
+                     valid=trust_value_to_string(get_validity(pk,
+                                                              un->pkt->
+                                                              pkt.user_id));
+                   fprintf(log_stream(),"\" [%s]\n",valid);
+                 }
                else
                  fputs("\"\n", log_stream() );
             }
index c4fd89d..64a803c 100644 (file)
@@ -247,11 +247,12 @@ struct {
 #define LIST_SHOW_KEYRING       (1<<7)
 #define LIST_SHOW_SIG_EXPIRE    (1<<8)
 
-#define VERIFY_SHOW_PHOTOS     (1<<0)
-#define VERIFY_SHOW_POLICY     (1<<1)
-#define VERIFY_SHOW_NOTATION   (1<<2)
-#define VERIFY_SHOW_KEYSERVER  (1<<3)
-#define VERIFY_SHOW_VALIDITY   (1<<4)
-#define VERIFY_SHOW_LONG_KEYID (1<<5)
+#define VERIFY_SHOW_PHOTOS        (1<<0)
+#define VERIFY_SHOW_POLICY        (1<<1)
+#define VERIFY_SHOW_NOTATION      (1<<2)
+#define VERIFY_SHOW_KEYSERVER     (1<<3)
+#define VERIFY_SHOW_VALIDITY      (1<<4)
+#define VERIFY_SHOW_LONG_KEYID    (1<<5)
+#define VERIFY_SHOW_UNUSABLE_UIDS (1<<6)
 
 #endif /*G10_OPTIONS_H*/