diff options
author | Werner Koch <wk@gnupg.org> | 2020-09-22 15:42:12 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2020-09-22 15:42:40 +0200 |
commit | 0e892bda4e0bf9db9116d7d5585d4e7b0d2eae57 (patch) | |
tree | d696b53bb2ecc8ee4e2a3f4b7a9c8e358df9f029 /kbx/backend-kbx.c | |
parent | kbx: Add bounds check to detect corrupt keyboxes. (diff) | |
download | gnupg2-0e892bda4e0bf9db9116d7d5585d4e7b0d2eae57.tar.xz gnupg2-0e892bda4e0bf9db9116d7d5585d4e7b0d2eae57.zip |
keyboxd: Extend PUBKEY_INFO status line with an uid ordinal.
* kbx/backend-sqlite.c (table_definitions): Add column UINO to
userids.
(be_sqlite_local_s): Add fields select_col_uidno and
select_col_subkey.
(run_select_statement): Also select subkey or uidno column.
(be_sqlite_search): Return their values.
(store_into_userid): Store the UIDNO.
* kbx/backend-support.c (be_return_pubkey): Extend PUBKEY_INFO.
--
For an existing database adding the new column to the table userid is
straightforward. However if the original version of the schema used an
integer for the keyid column, that column has likely be renamed. Make
sure that the NOT NULL constraint has also be removed; check the
SQLite documentation on how this can be done.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'kbx/backend-kbx.c')
-rw-r--r-- | kbx/backend-kbx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kbx/backend-kbx.c b/kbx/backend-kbx.c index b48795296..ca72169a0 100644 --- a/kbx/backend-kbx.c +++ b/kbx/backend-kbx.c @@ -278,7 +278,8 @@ be_kbx_search (ctrl_t ctrl, backend_handle_t backend_hd, db_request_t request, if (err) goto leave; /* FIXME: Return the ephemeral flag. */ - err = be_return_pubkey (ctrl, buffer, buflen, pubkey_type, ubid, 0, 0); + err = be_return_pubkey (ctrl, buffer, buflen, pubkey_type, ubid, + 0, 0, 0, 0); if (!err) be_cache_pubkey (ctrl, ubid, buffer, buflen, pubkey_type); xfree (buffer); |