diff options
author | Neal H. Walfield <[email protected]> | 2016-02-16 14:47:30 +0000 |
---|---|---|
committer | Neal H. Walfield <[email protected]> | 2016-02-16 14:47:30 +0000 |
commit | bff529a3ce936a5154bcd4f00abf83a2df3e758f (patch) | |
tree | 85b8b0d5521693f7d28996567309bf0e4719e720 /g10/gpg.c | |
parent | gpg: Make ASCII armor decoding more robust to encoding errors. (diff) | |
download | gnupg-neal/issue2236.tar.gz gnupg-neal/issue2236.zip |
gpg: Reorder signatures, if appropriate.neal/issue2236
XXX
--
Signed-off-by: Neal H. Walfield <[email protected]>
GnuPG-bug-id: 2236
Diffstat (limited to 'g10/gpg.c')
-rw-r--r-- | g10/gpg.c | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -165,6 +165,7 @@ enum cmd_and_opt_values aPasswd, aServer, aTOFUPolicy, + aCheckKey, oTextmode, oNoTextmode, @@ -487,6 +488,7 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_c (aServer, "server", N_("run in server mode")), ARGPARSE_c (aTOFUPolicy, "tofu-policy", N_("|VALUE|set the TOFU policy for a key")), + ARGPARSE_c (aCheckKey, "check-key", N_("Check a key")), ARGPARSE_group (301, N_("@\nOptions:\n ")), @@ -2464,6 +2466,10 @@ main (int argc, char **argv) set_cmd (&cmd, pargs.r_opt); break; + case aCheckKey: + set_cmd (&cmd, pargs.r_opt); + break; + case oArmor: opt.armor = 1; opt.no_armor=0; break; case oOutput: opt.outfile = pargs.r.ret_str; break; case oMaxOutput: opt.max_output = pargs.r.ret_ulong; break; @@ -4589,6 +4595,31 @@ main (int argc, char **argv) #endif /*USE_TOFU*/ break; + case aCheckKey: + { + int i; + + if (argc < 1) + wrong_args ("--check-key KEYID..."); + + for (i = 0; i < argc; i ++) + { + kbnode_t kb; + + rc = get_pubkey_byname (ctrl, NULL, NULL, argv[i], &kb, + NULL, 1, 1); + if (rc) + { + log_error (_("looking up key '%s': %s\n"), + argv[i], gpg_strerror (rc)); + g10_exit (1); + } + + keyblock_check_sigs (kb, 0); + } + } + break; + case aListPackets: opt.list_packets=2; default: |