1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-09-24 15:31:41 +02:00
gnupg/kbx
Werner Koch ec332d58ef gpg: Take care to use pubring.kbx if it has ever been used.
* kbx/keybox-defs.h (struct keybox_handle): Add field for_openpgp.
* kbx/keybox-file.c (_keybox_write_header_blob): Set openpgp header
flag.
* kbx/keybox-blob.c (_keybox_update_header_blob): Add arg for_openpgp
and set header flag.
* kbx/keybox-init.c (keybox_new): Rename to do_keybox_new, make static
and add arg for_openpgp.
(keybox_new_openpgp, keybox_new_x509): New.  Use them instead of the
former keybox_new.
* kbx/keybox-update.c (blob_filecopy): Add arg for_openpgp and set the
openpgp header flags.

* g10/keydb.c (rt_from_file): New.  Factored out and extended from
keydb_add_resource.
(keydb_add_resource): Switch to the kbx file if it has the openpgp
flag set.

* kbx/keybox-dump.c (dump_header_blob): Print header flags.
--

The problem was reported by dkg on gnupg-devel (2014-10-07):

  I just discovered a new problem, though, which will affect people on
  systems that have gpg and gpg2 coinstalled:

   0) create a new keyring with gpg2, and use it exclusively with gpg2
  for a while.
   1) somehow (accidentally?) use gpg (1.4.x) again -- this creates
  ~/.gnupg/pubring.gpg
   2) future runs of gpg2 now only look at pubring.gpg and ignore
  pubring.kbx -- the keys you had accumulated in the keybox are no
  longer listed in the output of gpg2 --list-keys

Note that gpgsm has always used pubring.kbx and thus this file might
already be there but without gpg ever inserted a key.  The new flag in
the KBX header gives us an indication whether a KBX file has ever been
written by gpg >= 2.1.  If that is the case we will use it instead of
the default pubring.gpg.

Signed-off-by: Werner Koch <wk@gnupg.org>
2014-10-09 19:10:32 +02:00
..
ChangeLog-2011 Generate the ChangeLog from commit logs. 2011-12-01 11:09:02 +01:00
kbxutil.c Switch to the libgpg-error provided estream. 2014-08-26 17:47:54 +02:00
keybox-blob.c gpg: Take care to use pubring.kbx if it has ever been used. 2014-10-09 19:10:32 +02:00
keybox-defs.h gpg: Take care to use pubring.kbx if it has ever been used. 2014-10-09 19:10:32 +02:00
keybox-dump.c gpg: Take care to use pubring.kbx if it has ever been used. 2014-10-09 19:10:32 +02:00
keybox-errors.c Nuked almost all trailing white space. 2011-02-04 12:57:53 +01:00
keybox-file.c gpg: Take care to use pubring.kbx if it has ever been used. 2014-10-09 19:10:32 +02:00
keybox-init.c gpg: Take care to use pubring.kbx if it has ever been used. 2014-10-09 19:10:32 +02:00
keybox-openpgp.c kbx: Add experimental support for EDDSA. 2014-05-07 12:39:43 +02:00
keybox-search-desc.h Nuked almost all trailing white space. 2011-02-04 12:57:53 +01:00
keybox-search.c gpg: Fix uninitialized access to search descindex with gpg keyboxes. 2014-05-14 18:13:11 +02:00
keybox-update.c gpg: Take care to use pubring.kbx if it has ever been used. 2014-10-09 19:10:32 +02:00
keybox-util.c Nuked almost all trailing white space. 2011-02-04 12:57:53 +01:00
keybox.h gpg: Take care to use pubring.kbx if it has ever been used. 2014-10-09 19:10:32 +02:00
Makefile.am Prepare for newer automake versions. 2013-06-27 09:27:32 +02:00
Manifest The keybox gets now compressed after 3 hours and ephemeral 2004-04-26 08:09:25 +00:00
mkerrors Nuked almost all trailing white space. 2011-02-04 12:57:53 +01:00