aboutsummaryrefslogtreecommitdiffstats
path: root/g10/mainproc.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-08-10 17:51:54 +0000
committerWerner Koch <[email protected]>2016-08-10 17:53:53 +0000
commited5c1b0b8a4790c4fb36a3129387f7c2ef5db302 (patch)
treea6bf5425ab66a0d20467a7dfa4e09b1e44fc1cc4 /g10/mainproc.c
parentcommon: New function try_make_printable_string. (diff)
downloadgnupg-ed5c1b0b8a4790c4fb36a3129387f7c2ef5db302.tar.gz
gnupg-ed5c1b0b8a4790c4fb36a3129387f7c2ef5db302.zip
gpg: Print the signer's UID during verification.
* g10/parse-packet.c (parse_signature): Sanitize the value stored in SIGNERS_UID. * g10/mainproc.c (issuer_fpr_string): New. (check_sig_and_print): Print the signers' UID. Print the issuer fingerprint in --rfc4880bis mode. -- Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/mainproc.c')
-rw-r--r--g10/mainproc.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c
index e50e212ee..3d3f88b40 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -1552,6 +1552,21 @@ akl_has_wkd_method (void)
}
+/* Return the ISSUER fingerprint string in human readbale format if
+ * available. Caller must release the string. */
+static char *
+issuer_fpr_string (PKT_signature *sig)
+{
+ const byte *p;
+ size_t n;
+
+ p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_ISSUER_FPR, &n);
+ if (p && n == 21 && p[0] == 4)
+ return bin2hex (p+1, n-1, NULL);
+ return NULL;
+}
+
+
static void
print_good_bad_signature (int statno, const char *keyid_str, kbnode_t un,
PKT_signature *sig, int rc)
@@ -1589,6 +1604,7 @@ check_sig_and_print (CTX c, kbnode_t node)
int is_expkey = 0;
int is_revkey = 0;
char pkstrbuf[PUBKEY_STRING_SIZE];
+ char *issuer_fpr;
*pkstrbuf = 0;
@@ -1715,17 +1731,29 @@ check_sig_and_print (CTX c, kbnode_t node)
write_status_text (STATUS_NEWSIG, NULL);
astr = openpgp_pk_algo_name ( sig->pubkey_algo );
- if (keystrlen () > 8)
+ if (opt.flags.rfc4880bis && (issuer_fpr = issuer_fpr_string (sig)))
+ {
+ log_info (_("Signature made %s\n"), asctimestamp(sig->timestamp));
+ log_info (_(" using %s key %s\n"),
+ astr? astr: "?", issuer_fpr);
+
+ xfree (issuer_fpr);
+ }
+ else if (!keystrlen () || keystrlen () > 8)
{
log_info (_("Signature made %s\n"), asctimestamp(sig->timestamp));
log_info (_(" using %s key %s\n"),
astr? astr: "?", keystr(sig->keyid));
}
- else
+ else /* Legacy format. */
log_info (_("Signature made %s using %s key ID %s\n"),
asctimestamp(sig->timestamp), astr? astr: "?",
keystr(sig->keyid));
+ /* In verbose mode print the signers UID. */
+ if (sig->signers_uid)
+ log_info (_(" issuer \"%s\"\n"), sig->signers_uid);
+
rc = do_check_sig (c, node, NULL, &is_expkey, &is_revkey );
/* If the key isn't found, check for a preferred keyserver. */