diff options
| author | Werner Koch <[email protected]> | 2025-04-29 16:35:29 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2025-04-29 16:35:29 +0000 |
| commit | d90b290f976bcf0db7cb2bb673b2a9d14449bf0b (patch) | |
| tree | 565bb5d5540d13aa2156db28861670fc29f5da1f /g10/gpg.c | |
| parent | gpg: Make the internal sign_uids function easier to read. (diff) | |
| download | gnupg-d90b290f976bcf0db7cb2bb673b2a9d14449bf0b.tar.gz gnupg-d90b290f976bcf0db7cb2bb673b2a9d14449bf0b.zip | |
gpg: New command --quick-tsign-key.
* g10/gpg.c (aQuickTSignKey): New.
(opts): Add new command.
(main): Parse args for it.
* g10/keyedit.c: Include mbox-util.h.
(parse_trustsig_string): New.
(sign_uids): Add arg trustsig for use in quick mode.
(keyedit_quick_sign): Also add arg trustsig and print a diagnostic on
error.
Diffstat (limited to 'g10/gpg.c')
| -rw-r--r-- | g10/gpg.c | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -130,6 +130,7 @@ enum cmd_and_opt_values aLSignKey, aQuickSignKey, aQuickLSignKey, + aQuickTSignKey, aQuickRevSig, aQuickAddUid, aQuickAddKey, @@ -529,6 +530,8 @@ static gpgrt_opt_t opts[] = { N_("quickly sign a key")), ARGPARSE_c (aQuickLSignKey, "quick-lsign-key", N_("quickly sign a key locally")), + ARGPARSE_c (aQuickTSignKey, "quick-tsign-key", + N_("quickly sign a key with a trust signature")), ARGPARSE_c (aQuickRevSig, "quick-revoke-sig" , N_("quickly revoke a key signature")), ARGPARSE_c (aSignKey, "sign-key" ,N_("sign a key")), @@ -2734,6 +2737,7 @@ main (int argc, char **argv) case aSign: case aQuickSignKey: case aQuickLSignKey: + case aQuickTSignKey: case aQuickRevSig: case aSignKey: case aLSignKey: @@ -4715,7 +4719,25 @@ main (int argc, char **argv) sl = NULL; for( ; argc; argc--, argv++) append_to_strlist2 (&sl, *argv, utf8_strings); - keyedit_quick_sign (ctrl, fpr, sl, locusr, (cmd == aQuickLSignKey)); + keyedit_quick_sign (ctrl, fpr, sl, locusr, + NULL, (cmd == aQuickLSignKey)); + free_strlist (sl); + } + break; + + case aQuickTSignKey: + { + const char *fpr, *tsig; + + if (argc < 2) + wrong_args ("--quick-tsign-key fingerprint" + " depth,[m|f][,domain] [userids]"); + fpr = *argv++; argc--; + tsig = *argv++; argc--; + sl = NULL; + for( ; argc; argc--, argv++) + append_to_strlist2 (&sl, *argv, utf8_strings); + keyedit_quick_sign (ctrl, fpr, sl, locusr, tsig, 0); free_strlist (sl); } break; |
