Diffusion GnuPG 9a94db1f662a

keyboxd: Implement lookup by short and long keyid.

Authored by werner on Fri, Sep 11, 12:00 PM.


keyboxd: Implement lookup by short and long keyid.

* kbx/backend-sqlite.c: Change definition of column KID.
(kid_from_mem): Remove.
(kid_from_u32): Rewrite.
(run_sql_bind_int64): Remove.
(run_select_statement): Implement lookup by short keyid.  Fix lookup
by long keyid.
(store_into_fingerprint): Adjust kid arg.

The original idea of using an INTEGER, which has the required 64 bits,
didn't worked out due to problems with signed/unsigned mismatch and
the required truncation in a short keyid lookup. Thus we change the
definition to a blob.

For a database currently in use the change can be done by hand:

alter table fingerprint rename column kid to deletedkid;
alter table fingerprint add column kid not null
      default X'0000000000000000';

update fingerprint set kid = substr (fpr, 13);

The update does only work with 20 octet fingerprints; that is not with
the new v5 OpenPGP keys. Note that sqlite does not allow to drip a
column, thus we rename it.

  • Signed-off-by: Werner Koch <wk@gnupg.org>


wernerFri, Sep 11, 12:10 PM
rG616c60d93dfa: keyboxd: Add ephemeral and revoked flag to the sqlite backend.