From de70a2f377c1647417fb8a2b6476c3744a901296 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 18 Mar 2019 14:10:16 +0100 Subject: 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 --- g10/parse-packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'g10/parse-packet.c') diff --git a/g10/parse-packet.c b/g10/parse-packet.c index ff348ec69..05f63e928 100644 --- a/g10/parse-packet.c +++ b/g10/parse-packet.c @@ -2296,7 +2296,7 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen, log_error ("packet(%d) with unknown version %d\n", pkttype, version); if (list_mode) es_fputs (":key packet: [unknown version]\n", listfp); - err = gpg_error (GPG_ERR_INV_PACKET); + err = gpg_error (GPG_ERR_UNKNOWN_VERSION); goto leave; } -- cgit v1.2.3