diff options
author | Andre Heinecke <[email protected]> | 2018-07-03 15:50:23 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2018-07-09 08:58:04 +0000 |
commit | 7bc5d3c7e41c6e42a583a61a4c9504058fbb2976 (patch) | |
tree | 68a40e8c6a2ab8a9a9af69b2e85636d1085cbe1c /src/gpgme.c | |
parent | python bindings: howto examples (diff) | |
download | gpgme-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 'src/gpgme.c')
-rw-r--r-- | src/gpgme.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gpgme.c b/src/gpgme.c index b03c7b87..2d829d9b 100644 --- a/src/gpgme.c +++ b/src/gpgme.c @@ -249,6 +249,7 @@ gpgme_release (gpgme_ctx_t ctx) free (ctx->lc_messages); free (ctx->override_session_key); free (ctx->request_origin); + free (ctx->auto_key_locate); _gpgme_engine_info_release (ctx->engine_info); ctx->engine_info = NULL; DESTROY_LOCK (ctx->lock); @@ -546,6 +547,13 @@ gpgme_set_ctx_flag (gpgme_ctx_t ctx, const char *name, const char *value) { ctx->ignore_mdc_error = abool; } + else if (!strcmp (name, "auto-key-locate")) + { + free (ctx->auto_key_locate); + ctx->auto_key_locate = strdup (value); + if (!ctx->auto_key_locate) + err = gpg_error_from_syserror (); + } else err = gpg_error (GPG_ERR_UNKNOWN_NAME); @@ -599,6 +607,10 @@ gpgme_get_ctx_flag (gpgme_ctx_t ctx, const char *name) { return ctx->ignore_mdc_error? "1":""; } + else if (!strcmp (name, "auto-key-locate")) + { + return ctx->auto_key_locate? ctx->auto_key_locate : ""; + } else return NULL; } |