diff options
author | Werner Koch <wk@gnupg.org> | 2020-09-03 13:46:54 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2020-09-03 13:49:20 +0200 |
commit | 046f419f806036248c058c4bd44368f8596287b7 (patch) | |
tree | 710c3a2d3d4d0335ea38a60e7a7c18caefeb33e8 /sm/gpgsm.h | |
parent | sm: Add arg ctrl to keydb_new. (diff) | |
download | gnupg2-046f419f806036248c058c4bd44368f8596287b7.tar.xz gnupg2-046f419f806036248c058c4bd44368f8596287b7.zip |
sm: New options to prepare the use of keyboxd.
* sm/Makefile.am (AM_CFLAGS): Add npth flags.
(common_libs): Use npth version of the lib.
(gpgsm_LDADD): Add npth libs.
* sm/gpgsm.c (oUseKeyboxd, oKeyboxdProgram): New.
(opts): New options --use-keyboxd and --keyboxd-program.
(main): Set them.
(gpgsm_deinit_default_ctrl): New.
(main): Call it.
* sm/server.c (gpgsm_server): Ditto.
* sm/gpgsm.h (opt): Add fields use_keyboxd and keyboxd_program.
(keydb_local_s): New type.
(struct server_control_s): Add field keybd_local.
* sm/keydb.c: Include assuan.h, asshelp.h, and kbx-client-util.h.
(struct keydb_local_s): New.
(struct keydb_handle): Add fields for keyboxd use.
(gpgsm_keydb_deinit_session_data): New.
(warn_version_mismatch): New.
(create_new_context): New.
(open_context): New.
(keydb_new): Implement keyboxd mode.
(keydb_release): Ditto.
(keydb_get_resource_name): Ditto.
* sm/keydb.c: Add stub support for all other functions.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'sm/gpgsm.h')
-rw-r--r-- | sm/gpgsm.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sm/gpgsm.h b/sm/gpgsm.h index 940a69f24..05f06d17b 100644 --- a/sm/gpgsm.h +++ b/sm/gpgsm.h @@ -64,10 +64,13 @@ struct int answer_no; /* assume no on most questions */ int dry_run; /* don't change any persistent data */ int no_homedir_creation; + int use_keyboxd; /* Use the external keyboxd as storage backend. */ const char *config_filename; /* Name of the used config file. */ const char *agent_program; + const char *keyboxd_program; + session_env_t session_env; char *lc_ctype; char *lc_messages; @@ -195,6 +198,11 @@ struct /* Forward declaration for an object defined in server.c */ struct server_local_s; +/* Object used to keep state locally in keydb.c */ +struct keydb_local_s; +typedef struct keydb_local_s *keydb_local_t; + + /* Session control object. This object is passed down to most functions. Note that the default values for it are set by gpgsm_init_default_ctrl(). */ @@ -204,6 +212,8 @@ struct server_control_s int status_fd; /* Only for non-server mode */ struct server_local_s *server_local; + keydb_local_t keydb_local; /* Local data for call-keyboxd.c */ + audit_ctx_t audit; /* NULL or a context for the audit subsystem. */ int agent_seen; /* Flag indicating that the gpg-agent has been accessed. */ @@ -266,6 +276,7 @@ struct rootca_flags_s /*-- gpgsm.c --*/ void gpgsm_exit (int rc); void gpgsm_init_default_ctrl (struct server_control_s *ctrl); +void gpgsm_deinit_default_ctrl (ctrl_t ctrl); int gpgsm_parse_validation_model (const char *model); /*-- server.c --*/ |