aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpgme.c
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2018-09-12 07:42:09 +0000
committerAndre Heinecke <[email protected]>2018-10-09 08:48:58 +0000
commit85627e58184529e982369cfc00ed7865244c13d6 (patch)
tree307d51952c0f108f9b80d2635ad989540e9a5fa4 /src/gpgme.c
parentcpp: Initialize all gpgme_key_t's in context (diff)
downloadgpgme-85627e58184529e982369cfc00ed7865244c13d6.tar.gz
gpgme-85627e58184529e982369cfc00ed7865244c13d6.zip
core: Add trust-model flag
* src/context.h (gpgme_context): Extend with trust_model. * src/engine-gpg.c (engine_gpg): Extend with trust_model. (gpg_set_engine_flags): Take trust_model from context. (build_argv): Handle trust_model. (gpg_release): Free trust_model. * src/gpgme.c (gpgme_set_ctx_flag): Handle trust-model flag. (gpgme_release): Release trust-model. * doc/gpgme.texi: Document new flag for gpgme_set_ctx_flag. (Context Flags): New subsection for the context flags. * tests/run-keylist.c (show_usage, main): Add new --trust-model parameter. -- This gives a GPGME user fine grained control over the trust-model. Changing the trust model for only a single application depends on: GnuPG-Bug-Id: T4134 Maniphest Tasks: T4134 Differential Revision: https://dev.gnupg.org/D466
Diffstat (limited to 'src/gpgme.c')
-rw-r--r--src/gpgme.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpgme.c b/src/gpgme.c
index 2d829d9b..3d72f695 100644
--- a/src/gpgme.c
+++ b/src/gpgme.c
@@ -250,6 +250,7 @@ gpgme_release (gpgme_ctx_t ctx)
free (ctx->override_session_key);
free (ctx->request_origin);
free (ctx->auto_key_locate);
+ free (ctx->trust_model);
_gpgme_engine_info_release (ctx->engine_info);
ctx->engine_info = NULL;
DESTROY_LOCK (ctx->lock);
@@ -554,6 +555,13 @@ gpgme_set_ctx_flag (gpgme_ctx_t ctx, const char *name, const char *value)
if (!ctx->auto_key_locate)
err = gpg_error_from_syserror ();
}
+ else if (!strcmp (name, "trust-model"))
+ {
+ free (ctx->trust_model);
+ ctx->trust_model = strdup (value);
+ if (!ctx->trust_model)
+ err = gpg_error_from_syserror ();
+ }
else
err = gpg_error (GPG_ERR_UNKNOWN_NAME);