gpg: Print more info with "check selfsig".
authorWerner Koch <wk@gnupg.org>
Thu, 1 Oct 2015 15:57:39 +0000 (17:57 +0200)
committerWerner Koch <wk@gnupg.org>
Thu, 1 Oct 2015 15:57:39 +0000 (17:57 +0200)
* g10/keyedit.c (print_and_check_one_sig): Print more Some sigsub
packets.

g10/keyedit.c

index 8d87a01..143c748 100644 (file)
@@ -46,6 +46,7 @@
 #include "i18n.h"
 #include "keyserver-internal.h"
 #include "call-agent.h"
+#include "host2net.h"
 
 static void show_prefs (PKT_user_id * uid, PKT_signature * selfsig,
                        int verbose);
@@ -287,6 +288,22 @@ print_and_check_one_sig (KBNODE keyblock, KBNODE node,
       if (sig->flags.pref_ks
           && ((opt.list_options & LIST_SHOW_KEYSERVER_URLS) || extended))
        show_keyserver_url (sig, 3, 0);
+
+      if (extended)
+        {
+          PKT_public_key *pk = keyblock->pkt->pkt.public_key;
+          const unsigned char *s;
+          u32 expire;
+
+          s = parse_sig_subpkt (sig->hashed, SIGSUBPKT_PRIMARY_UID, NULL);
+          if (s && *s)
+            tty_printf ("             [primary]\n");
+
+          s = parse_sig_subpkt (sig->hashed, SIGSUBPKT_KEY_EXPIRE, NULL);
+          if (s && buf32_to_u32 (s))
+            tty_printf ("             [expires: %s]\n",
+                        isotimestamp (pk->timestamp + buf32_to_u32 (s)));
+        }
     }
 
   return (sigrc == '!');