summaryrefslogtreecommitdiffstats
path: root/g10/keygen.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2021-03-15 10:47:19 +0100
committerWerner Koch <wk@gnupg.org>2021-03-15 10:47:19 +0100
commit1523b5f76f6e600c4f2d153b49a807ff2dc8d268 (patch)
tree34f7fc39bb8b95264b8ead7c4060cab2697b64a6 /g10/keygen.c
parentw32: Silence a compiler warning in dirmngr.c (diff)
downloadgnupg2-1523b5f76f6e600c4f2d153b49a807ff2dc8d268.tar.xz
gnupg2-1523b5f76f6e600c4f2d153b49a807ff2dc8d268.zip
gpg: New option --no-auto-trust-new-key.Beta-2.3.0-beta1655
* g10/gpg.c (oNoAutoTrustNewKey): New. (opts): Add --no-auto-trust-new-key. (main): Set it. * g10/options.h (opt): Add flags.no_auto_trust_new_key. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/keygen.c')
-rw-r--r--g10/keygen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/g10/keygen.c b/g10/keygen.c
index 01eec57ac..bde0f3217 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -5568,9 +5568,10 @@ do_generate_keypair (ctrl_t ctrl, struct para_data_s *para,
keyid_from_pk (pk, pk->main_keyid);
register_trusted_keyid (pk->main_keyid);
- update_ownertrust (ctrl, pk,
- ((get_ownertrust (ctrl, pk) & ~TRUST_MASK)
- | TRUST_ULTIMATE ));
+ if (!opt.flags.no_auto_trust_new_key)
+ update_ownertrust (ctrl, pk,
+ ((get_ownertrust (ctrl, pk) & ~TRUST_MASK)
+ | TRUST_ULTIMATE ));
gen_standard_revoke (ctrl, pk, cache_nonce);