aboutsummaryrefslogtreecommitdiffstats
path: root/g10/parse-packet.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-06-13 08:40:34 +0000
committerWerner Koch <[email protected]>2016-06-13 08:40:34 +0000
commit08c82b1b55d28ffd09b859205b7686bcefae5011 (patch)
treedbdd0375fa3102066139e0a6eeb5410cb624ff10 /g10/parse-packet.c
parentgpg,indent: Re-indent and chnage var names in sign.c (diff)
downloadgnupg-08c82b1b55d28ffd09b859205b7686bcefae5011.tar.gz
gnupg-08c82b1b55d28ffd09b859205b7686bcefae5011.zip
gpg: Try Signer's User ID sub-packet with --auto-key-retrieve.
* g10/packet.h (PKT_signature): Add field 'signers_uid'. * g10/parse-packet.c (parse_signature): Set this field. * g10/free-packet.c (free_seckey_enc): Free field. (copy_signature): Copy field. * g10/mainproc.c (akl_has_wkd_method): New. (check_sig_and_print): Extend NEWSIG status. If WKD is enabled try to locate a missing key via the signature's Signer's User ID sub-packet. Do this right before trying a keyserver lookup. -- Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/parse-packet.c')
-rw-r--r--g10/parse-packet.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index c77e409e5..c30abcbe3 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -1915,6 +1915,20 @@ parse_signature (IOBUF inp, int pkttype, unsigned long pktlen,
if (p)
sig->flags.pref_ks = 1;
+ p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_SIGNERS_UID, &len);
+ if (p && len)
+ {
+ sig->signers_uid = xtrymalloc (len+1);
+ if (!sig->signers_uid)
+ {
+ rc = gpg_error_from_syserror ();
+ goto leave;
+ }
+ /* Note that we don't care about binary zeroes in the value. */
+ memcpy (sig->signers_uid, p, len);
+ sig->signers_uid[len] = 0;
+ }
+
p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_NOTATION, NULL);
if (p)
sig->flags.notation = 1;