diff options
author | Werner Koch <[email protected]> | 2019-05-03 08:53:34 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-05-03 08:54:31 +0000 |
commit | bd6ecbb8f8e92fe4a7fed40fcf470eb83bda0927 (patch) | |
tree | 8f046a8ef73cc469a3d2464ac6687ceb02448f6e | |
parent | tools: Some changes to the ccidmon.c debug helper. (diff) | |
download | gnupg-bd6ecbb8f8e92fe4a7fed40fcf470eb83bda0927.tar.gz gnupg-bd6ecbb8f8e92fe4a7fed40fcf470eb83bda0927.zip |
gpg: Use just the addrspec from the Signer's UID.
* g10/parse-packet.c (parse_signature): Take only rthe addrspec from a
Signer's UID subpacket.
--
This is to address a problem in the currentr OpenKeychain which put
the entire UID into the subpacket. For example our Tofu code can only
use the addrspec and not the entire UID.
Reported-by: Wiktor Kwapisiewicz <[email protected]>
Signed-off-by: Werner Koch <[email protected]>
-rw-r--r-- | g10/parse-packet.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c index 5b4b1c900..f67edc547 100644 --- a/g10/parse-packet.c +++ b/g10/parse-packet.c @@ -35,6 +35,7 @@ #include "main.h" #include "../common/i18n.h" #include "../common/host2net.h" +#include "../common/mbox-util.h" /* Maximum length of packets to avoid excessive memory allocation. */ @@ -2118,12 +2119,20 @@ parse_signature (IOBUF inp, int pkttype, unsigned long pktlen, p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_SIGNERS_UID, &len); if (p && len) { + char *mbox; + sig->signers_uid = try_make_printable_string (p, len, 0); if (!sig->signers_uid) { rc = gpg_error_from_syserror (); goto leave; } + mbox = mailbox_from_userid (sig->signers_uid, 0); + if (mbox) + { + xfree (sig->signers_uid); + sig->signers_uid = mbox; + } } p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_NOTATION, NULL); |