gpg: Do not bail out on v5 keys in the local keyring.
authorWerner Koch <wk@gnupg.org>
Mon, 18 Mar 2019 13:10:16 +0000 (14:10 +0100)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 22 Aug 2019 19:11:59 +0000 (20:11 +0100)
commitc14e2ff742d83a70e4d9fc0766768fdf92e3d7fc
treed651102fe12e2abb2fdc8cf4215d197910c2db62
parentd946ac98c64e272812c8e65f62eaf816e11084f4
gpg: Do not bail out on v5 keys in the local keyring.

* g10/parse-packet.c (parse_key): Return GPG_ERR_UNKNOWN_VERSION
instead of invalid packet.
* g10/keydb.c (parse_keyblock_image): Do not map the unknown version
error to invalid keyring.
(keydb_search): Skip unknown version errors simlar to legacy keys.
* g10/keyring.c (keyring_rebuild_cache): Skip keys with unknown
versions.
* g10/import.c (read_block): Handle unknown version.
--

When using gpg 2.3 the local keyring may contain v5 keys.  This patch
allows the use of such a keyring also with a 2.2 version which does
not support v5 keys.  We will probably need some more tweaking here
but this covers the most common cases of listing keys and also
importing v5 keys.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit de70a2f377c1647417fb8a2b6476c3744a901296)

Gbp-Pq: Topic from-2.2.14
Gbp-Pq: Name gpg-Do-not-bail-out-on-v5-keys-in-the-local-keyring.patch
g10/import.c
g10/keydb.c
g10/keylist.c
g10/keyring.c
g10/parse-packet.c