From 4f874ea431ba68ba70cf569741488502b1f61e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Fri, 4 Nov 2022 10:21:25 +0100 Subject: 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 --- src/gpgme.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gpgme.c') diff --git a/src/gpgme.c b/src/gpgme.c index ed15912a..135a75a7 100644 --- a/src/gpgme.c +++ b/src/gpgme.c @@ -607,6 +607,10 @@ gpgme_set_ctx_flag (gpgme_ctx_t ctx, const char *name, const char *value) if (!ctx->import_filter) err = gpg_error_from_syserror (); } + else if (!strcmp (name, "no-auto-check-trustdb")) + { + ctx->no_auto_check_trustdb = abool; + } else err = gpg_error (GPG_ERR_UNKNOWN_NAME); @@ -688,6 +692,10 @@ gpgme_get_ctx_flag (gpgme_ctx_t ctx, const char *name) { return ctx->import_filter? ctx->import_filter : ""; } + else if (!strcmp (name, "no-auto-check-trustdb")) + { + return ctx->no_auto_check_trustdb? "1":""; + } else return NULL; } -- cgit v1.2.3