aboutsummaryrefslogtreecommitdiffstats
path: root/g10/gpg.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-05-21 10:26:44 +0000
committerWerner Koch <[email protected]>2016-05-21 10:26:44 +0000
commit754b1c463034a634a678d8efc76c27fd46aad9b9 (patch)
treef83aa8b328058ebc57a016f0a854009f5cffc2cf /g10/gpg.h
parentgpg: Pass CTRL object down to the trust functions (diff)
downloadgnupg-754b1c463034a634a678d8efc76c27fd46aad9b9.tar.gz
gnupg-754b1c463034a634a678d8efc76c27fd46aad9b9.zip
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 <[email protected]>
Diffstat (limited to 'g10/gpg.h')
-rw-r--r--g10/gpg.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/g10/gpg.h b/g10/gpg.h
index 5cd836697..c0f0a2dea 100644
--- a/g10/gpg.h
+++ b/g10/gpg.h
@@ -63,6 +63,10 @@ typedef struct dirmngr_local_s *dirmngr_local_t;
typedef struct kbnode_struct *KBNODE;
typedef struct kbnode_struct *kbnode_t;
+/* TOFU database meta object. */
+struct tofu_dbs_s;
+typedef struct tofu_dbs_s *tofu_dbs_t;
+
/* Session control object. This object is passed to most functions to
convey the status of a session. Note that the defaults are set by
@@ -74,6 +78,12 @@ struct server_control_s
/* Local data for call-dirmngr.c */
dirmngr_local_t dirmngr_local;
+
+ /* Local data for tofu.c */
+ struct {
+ tofu_dbs_t dbs;
+ } tofu;
+
};