From 85627e58184529e982369cfc00ed7865244c13d6 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Wed, 12 Sep 2018 09:42:09 +0200 Subject: 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 --- doc/gpgme.texi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc') diff --git a/doc/gpgme.texi b/doc/gpgme.texi index d99e9bb7..fc4840ee 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -2444,6 +2444,7 @@ started. In fact, these references are accessed through the * Passphrase Callback:: Getting the passphrase from the user. * Progress Meter Callback:: Being informed about the progress. * Status Message Callback:: Status messages received from gpg. +* Context Flags:: Additional flags for a context. * Locale:: Setting the locale of a context. * Additional Logs:: Additional logs of a context. @end menu @@ -3030,6 +3031,10 @@ or @var{ctx} is not a valid pointer, @code{NULL} is returned in both variables. @end deftypefun +@node Context Flags +@subsection Context Flags +@cindex flags, of a context + @deftypefun {gpgme_error_t} gpgme_set_ctx_flag @ (@w{gpgme_ctx_t @var{ctx}}, @ @w{const char *@var{name}}, @ @@ -3131,6 +3136,20 @@ Requires at least GnuPG 2.1.18. Note: Keys retrieved through @code{auto-key-locate} are automatically imported in the keyring. +@item trust-model +@since{1.11.2} + +Change the trust-model for all GnuPG engine operations. An empty +string sets the trust-model back to the users default. If the +trust-model is not supported by GnuPG the behavior is undefined +and will likely cause all operations to fail. Example: "tofu+pgp". + +This options should be used carefully with a strict version +requirement. In some versions of GnuPG setting the +trust-model changes the default trust-model for future operations. +A change in the trust-model also can have unintended side effects, like +rebuilding the trust-db. + @end table This function returns @code{0} on success. -- cgit v1.2.3