aboutsummaryrefslogtreecommitdiffstats
path: root/g10/trustdb.c
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-03-02 13:35:09 +0000
committerJustus Winter <[email protected]>2017-03-02 13:50:23 +0000
commit4735ab96aa5577d40ba7b3f72d863057198cc6a7 (patch)
tree86aaf8c2a2a6b87cd5798ee3d7f0ae832b31ef7d /g10/trustdb.c
parentagent: Improve error message for the KEYTOCARD command. (diff)
downloadgnupg-4735ab96aa5577d40ba7b3f72d863057198cc6a7.tar.gz
gnupg-4735ab96aa5577d40ba7b3f72d863057198cc6a7.zip
gpg: Fix (quick) key generation with --always-trust.
* g10/keygen.c (do_generate_keypair): Only update the ownertrust if we do have a trust database. * g10/trustdb.c (have_trustdb): New function. * g10/trustdb.h (have_trustdb): New prototype. * tests/openpgp/quick-key-manipulation.scm: Remove workaround. GnuPG-bug-id: 2695 Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'g10/trustdb.c')
-rw-r--r--g10/trustdb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/g10/trustdb.c b/g10/trustdb.c
index f4df4c818..74430510d 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -511,6 +511,16 @@ init_trustdb (int no_create)
}
+/* Check whether we have a trust database, initializing it if
+ necessary if the trust model is not 'always trust'. Returns true
+ if we do have a usable trust database. */
+int
+have_trustdb (void)
+{
+ return init_trustdb (opt.trust_model == TM_ALWAYS) == 0;
+}
+
+
/****************
* Recreate the WoT but do not ask for new ownertrusts. Special
* feature: In batch mode and without a forced yes, this is only done