aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2018-07-03 15:50:23 +0000
committerAndre Heinecke <[email protected]>2018-07-09 08:58:04 +0000
commit7bc5d3c7e41c6e42a583a61a4c9504058fbb2976 (patch)
tree68a40e8c6a2ab8a9a9af69b2e85636d1085cbe1c /tests
parentpython bindings: howto examples (diff)
downloadgpgme-7bc5d3c7e41c6e42a583a61a4c9504058fbb2976.tar.gz
gpgme-7bc5d3c7e41c6e42a583a61a4c9504058fbb2976.zip
Add ctx flag for auto-key-locate
* src/context.h (gpgme_context): Add auto_key_locate. * src/engine-gpg.c (engine_gpg): Add auto_key_locate. (gpg_set_engine_flags, build_argv): Handle auto_key_locate. (gpg_release): Free auto_key_locate. * src/gpgme.c (gpgme_release): Free auto_key_locate. (gpgme_get_ctx_flag, gpgme_set_ctx_flag): Handle auto-key-locate. * doc/gpgme.texi: Document auto-key-locate flag. * tests/run-keylist.c (show_usage, main): Add --from-wkd option. -- This enables users of GPGME to control more fine grained what auto-key-locate does. Especially for WKD lookups / refreshes can this be useful. GnuPG-Bug-Id: T2917 Differential Revision: https://dev.gnupg.org/D463
Diffstat (limited to 'tests')
-rw-r--r--tests/run-keylist.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/run-keylist.c b/tests/run-keylist.c
index 295251ae..9725fa3f 100644
--- a/tests/run-keylist.c
+++ b/tests/run-keylist.c
@@ -57,6 +57,7 @@ show_usage (int ex)
" --import import all keys\n"
" --offline use offline mode\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"
, stderr);
exit (ex);
@@ -100,6 +101,7 @@ main (int argc, char **argv)
int only_secret = 0;
int offline = 0;
int from_file = 0;
+ int from_wkd = 0;
gpgme_data_t data = NULL;
@@ -194,6 +196,12 @@ main (int argc, char **argv)
gpgme_set_global_flag ("require-gnupg", *argv);
argc--; argv++;
}
+ else if (!strcmp (*argv, "--from-wkd"))
+ {
+ argc--; argv++;
+ mode |= GPGME_KEYLIST_MODE_LOCATE;
+ from_wkd = 1;
+ }
else if (!strncmp (*argv, "--", 2))
show_usage (1);
}
@@ -213,6 +221,13 @@ main (int argc, char **argv)
gpgme_set_offline (ctx, offline);
+ if (from_wkd)
+ {
+ err = gpgme_set_ctx_flag (ctx, "auto-key-locate",
+ "clear,nodefault,wkd");
+ fail_if_err (err);
+ }
+
if (from_file)
{
err = gpgme_data_new_from_file (&data, *argv, 1);