diff options
author | Werner Koch <wk@gnupg.org> | 2019-09-10 16:05:54 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2019-09-10 16:05:54 +0200 |
commit | ce9906b008c94c2aa4ac770a981d1e1e0b8aea47 (patch) | |
tree | c2a0159d4763d785a6917baf7885b86a175e03df /g10/keydb-private.h | |
parent | kbx: Allow fd-passing for the keyboxd. (diff) | |
download | gnupg2-ce9906b008c94c2aa4ac770a981d1e1e0b8aea47.tar.xz gnupg2-ce9906b008c94c2aa4ac770a981d1e1e0b8aea47.zip |
gpg: First rough implementation of keyboxd access for key lookup.
* g10/Makefile.am: Add nPth flags.
* g10/gpg.c: Include npth.h.
(gpg_deinit_default_ctrl): Deinit call-keyboxd local data.
(main): Init nPth.
* g10/keydb-private.h (struct keydb_handle_s): Add field 'kbl' and
remove the search result and the assuan context.
* g10/call-keyboxd.c (struct keyboxd_local_s): Add more fields.
(lock_datastream, unlock_datastream): New.
(gpg_keyboxd_deinit_session_data): Adjust for changed data structures.
(prepare_data_pipe): New.
(open_context): Return kbl instead of an Assuan context. Init mutexes
etc.
(close_context): Merge into ...
(keydb_release): here. Adjust for changed data structures.
(datastream_thread): New.
(keydb_get_keyblock): Implement datastream stuff.
(keydb_search): Ditto.
* common/asshelp.c (wait_for_sock): Add arg connect_flags.
(start_new_service): Set FDPASSING flag for the keyboxd.
--
This code as a lot of rough edges, in particular it relies on a well
behaving keyboxd. We need to add code to shutdown the datastream
reader thread in case of errors and to properly get it up again. We
also need to make really sure that both threads run in lockstep so
that the datastream thread is only active while we are sending a
command to the keyboxd.
We should also see whether we can depend nPth initialization on the
--use-keyboxd option to avoid any problems with nPth.
And we need to test on Windows.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/keydb-private.h')
-rw-r--r-- | g10/keydb-private.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/g10/keydb-private.h b/g10/keydb-private.h index c5315b991..efef82289 100644 --- a/g10/keydb-private.h +++ b/g10/keydb-private.h @@ -92,14 +92,9 @@ struct keydb_handle_s /* A shallow pointer with the CTRL used to create this handle. */ ctrl_t ctrl; - /* The context used to communicate with the keyboxd. */ - assuan_context_t assuan_context; - - /* I/O buffer with the last search result or NULL. */ - iobuf_t search_result; - - /* Flag indicating that a search reset is required. */ - unsigned int need_search_reset : 1; + /* Connection info which also keep the local state. (This is points + * into the CTRL->keybox_local list.) */ + keyboxd_local_t kbl; /* END USE_KEYBOXD */ |