aboutsummaryrefslogtreecommitdiffstats
path: root/g10/sign.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-06-13 09:24:09 +0000
committerWerner Koch <[email protected]>2016-06-13 09:24:09 +0000
commit61e7fd68c05ed185728e9da45f7a44a2323065ad (patch)
treeb15ce50d5fd51ea6833f0620e51df5ae8bbd7bc4 /g10/sign.c
parentgpg: Try Signer's User ID sub-packet with --auto-key-retrieve. (diff)
downloadgnupg-61e7fd68c05ed185728e9da45f7a44a2323065ad.tar.gz
gnupg-61e7fd68c05ed185728e9da45f7a44a2323065ad.zip
gpg: New option --disable-signer-uid, create Signer's UID sub-packet.
* g10/gpg.c (oDisableSignerUID): New. (opts): New option '--disable-signer-uid'. (main): Set option. * g10/options.h (opt): Add field flags.disable_signer_uid. * g10/sign.c: Include mbox-util.h. (mk_notation_policy_etc): Embed the signer's uid. * g10/mainproc.c (check_sig_and_print): Do not use WKD for auto key retrieval if --disable-signer-uid is used. -- Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/sign.c')
-rw-r--r--g10/sign.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/g10/sign.c b/g10/sign.c
index 833b6ef06..a4974be85 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -40,7 +40,7 @@
#include "pkglue.h"
#include "sysutils.h"
#include "call-agent.h"
-
+#include "mbox-util.h"
#ifdef HAVE_DOSISH_SYSTEM
#define LF "\r\n"
@@ -144,6 +144,20 @@ mk_notation_policy_etc (PKT_signature *sig,
p, strlen (p));
xfree (p);
}
+
+ /* Set signer's user id. */
+ if (IS_SIG (sig) && !opt.flags.disable_signer_uid)
+ {
+ char *mbox;
+
+ /* For now we use the uid which was used to locate the key. */
+ if (pksk->user_id && (mbox = mailbox_from_userid (pksk->user_id->name)))
+ {
+ if (DBG_LOOKUP)
+ log_debug ("setting Signer's UID to '%s'\n", mbox);
+ build_sig_subpkt (sig, SIGSUBPKT_SIGNERS_UID, mbox, strlen (mbox));
+ }
+ }
}