aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2022-11-04 09:21:25 +0000
committerIngo Klöcker <[email protected]>2022-11-04 09:38:41 +0000
commit4f874ea431ba68ba70cf569741488502b1f61e66 (patch)
tree9b17d35addc0d86ecbb60bbf51a9004932de34b6 /tests
parentbuild: Update libassuan.m4. (diff)
downloadgpgme-4f874ea431ba68ba70cf569741488502b1f61e66.tar.gz
gpgme-4f874ea431ba68ba70cf569741488502b1f61e66.zip
core: New context flag "no-auto-check-trustdb"
* src/context.h (gpgme_context): Add field no_auto_check_trustdb. * src/gpgme.c (gpgme_set_ctx_flag, gpgme_get_ctx_flag): Add flag "no-auto-check-trustdb". * src/engine-gpg.c (engine_gpg): Add flags.no_auto_check_trustdb. (gpg_set_engine_flags): Set the flag. (build_argv): Pass option to gpg. * tests/run-keylist.c (show_usage, main): Add option --no-trust-check. -- This makes the --no-auto-check-trustdb option available in the GPGME API to disable the potentially expensive automatic trust database check. GnuPG-bug-id: 6261
Diffstat (limited to 'tests')
-rw-r--r--tests/run-keylist.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/run-keylist.c b/tests/run-keylist.c
index 27cdbb2a..929cb1d8 100644
--- a/tests/run-keylist.c
+++ b/tests/run-keylist.c
@@ -58,6 +58,7 @@ show_usage (int ex)
" --validate use GPGME_KEYLIST_MODE_VALIDATE\n"
" --import import all keys\n"
" --offline use offline mode\n"
+ " --no-trust-check disable automatic trust database check\n"
" --from-file list all keys in the given file\n"
" --from-wkd list key from a web key directory\n"
" --require-gnupg required at least the given GnuPG version\n"
@@ -103,6 +104,7 @@ main (int argc, char **argv)
gpgme_protocol_t protocol = GPGME_PROTOCOL_OpenPGP;
int only_secret = 0;
int offline = 0;
+ int no_trust_check = 0;
int from_file = 0;
int from_wkd = 0;
gpgme_data_t data = NULL;
@@ -192,6 +194,11 @@ main (int argc, char **argv)
offline = 1;
argc--; argv++;
}
+ else if (!strcmp (*argv, "--no-trust-check"))
+ {
+ no_trust_check = 1;
+ argc--; argv++;
+ }
else if (!strcmp (*argv, "--from-file"))
{
from_file = 1;
@@ -238,6 +245,12 @@ main (int argc, char **argv)
gpgme_set_offline (ctx, offline);
+ if (no_trust_check)
+ {
+ err = gpgme_set_ctx_flag (ctx, "no-auto-check-trustdb", "1");
+ fail_if_err (err);
+ }
+
if (trust_model)
{
err = gpgme_set_ctx_flag (ctx, "trust-model", trust_model);