diff options
Diffstat (limited to 'g10')
-rw-r--r-- | g10/gpg.c | 5 | ||||
-rw-r--r-- | g10/keyedit.c | 9 | ||||
-rw-r--r-- | g10/options.h | 2 |
3 files changed, 12 insertions, 4 deletions
@@ -430,6 +430,7 @@ enum cmd_and_opt_values oUseOnlyOpenPGPCard, oIncludeKeyBlock, oNoIncludeKeyBlock, + oForceSignKey, oNoop }; @@ -838,6 +839,7 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_s (oWeakDigest, "weak-digest","@"), ARGPARSE_s_n (oUnwrap, "unwrap", "@"), ARGPARSE_s_n (oOnlySignTextIDs, "only-sign-text-ids", "@"), + ARGPARSE_s_n (oForceSignKey, "force-sign-key", "@"), /* Aliases. I constantly mistype these, and assume other people do as well. */ @@ -2674,6 +2676,9 @@ main (int argc, char **argv) case oAnswerYes: opt.answer_yes = 1; break; case oAnswerNo: opt.answer_no = 1; break; + + case oForceSignKey: opt.flags.force_sign_key = 1; break; + case oKeyring: append_to_strlist( &nrings, pargs.r.ret_str); break; case oPrimaryKeyring: sl = append_to_strlist (&nrings, pargs.r.ret_str); diff --git a/g10/keyedit.c b/g10/keyedit.c index ed81c4a03..ea3bcf2b8 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -751,10 +751,11 @@ sign_uids (ctrl_t ctrl, estream_t fp, _("\"%s\" was already signed by key %s\n"), user, keystr_from_pk (pk)); - if (opt.expert && !quick - && cpr_get_answer_is_yes ("sign_uid.dupe_okay", - _("Do you want to sign it " - "again anyway? (y/N) "))) + if (opt.flags.force_sign_key + || (opt.expert && !quick + && cpr_get_answer_is_yes ("sign_uid.dupe_okay", + _("Do you want to sign it " + "again anyway? (y/N) ")))) { /* Don't delete the old sig here since this is an --expert thing. */ diff --git a/g10/options.h b/g10/options.h index 3514a60dd..f5910f33d 100644 --- a/g10/options.h +++ b/g10/options.h @@ -241,6 +241,8 @@ struct /* Force the use of the OpenPGP card and do not allow the use of * another card. */ unsigned int use_only_openpgp_card:1; + /* Force signing keys even if a key signature already exists. */ + unsigned int force_sign_key:1; } flags; /* Linked list of ways to find a key if the key isn't on the local |