From 754b1c463034a634a678d8efc76c27fd46aad9b9 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Sat, 21 May 2016 12:26:44 +0200 Subject: gpg: Store the Tofu meta handle for databases in CTRL. * g10/gpg.h (struct tofu_dbs_s, tofu_dbs_t): New declarations. (struct server_control_s): Add field tofu.dbs. * g10/tofu.c (struct dbs): Rename to tofu_dbs_s. Replace all users by by tofu_dbs_t. (opendbs): Add arg CTRL. Cache the DBS in CTRL. (closedbs): Rename to tofu_closedbs and make global. Add arg CTRL. (tofu_register): Add arg CTRL. Change all callers. Do not call closedbs. (tofu_get_validity): Ditto. (tofu_set_policy): Ditto. (tofu_get_policy): Ditto. (tofu_set_policy_by_keyid): Add arg CTRL. * g10/gpg.c (gpg_deinit_default_ctrl): Call tofu_closedbs. Signed-off-by: Werner Koch --- g10/keyedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'g10/keyedit.c') diff --git a/g10/keyedit.c b/g10/keyedit.c index c7288b2da..c78f8a3b5 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -3485,7 +3485,7 @@ show_key_with_all_names_colon (ctrl_t ctrl, estream_t fp, kbnode_t keyblock) { #ifdef USE_TOFU enum tofu_policy policy; - if (! tofu_get_policy (primary, uid, &policy) + if (! tofu_get_policy (ctrl, primary, uid, &policy) && policy != TOFU_POLICY_NONE) es_fprintf (fp, "%s", tofu_policy_str (policy)); #endif /*USE_TOFU*/ -- cgit v1.2.3