1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-10-30 19:58:44 +01:00

gpg: Don't bail out for unknown subkey packet versions.

* g10/import.c (read_block): Don't show a warning for unbnown version
also for non-primary-key packets.

* g10/parse-packet.c (parse_key): Use log_info for unsupported v5
packets.
--

This fixes the problem that 2.2 can't import keys with a v5 subkey.
This fix allows a gnupg 2.6. version to export a key with an
additional PQC subkey and 2.2 can still import the other subkeys.

The second patch avoids that gpg returns with an error code.

Updates-commit: de70a2f377
This commit is contained in:
Werner Koch 2024-09-12 11:06:09 +02:00
parent 95468f531c
commit b357ff2aa6
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 6 additions and 2 deletions

View File

@ -959,7 +959,8 @@ read_block( IOBUF a, unsigned int options,
else if (rc ) /* (ignore errors) */
{
skip_sigs = 0;
if (gpg_err_code (rc) == GPG_ERR_UNKNOWN_PACKET)
if (gpg_err_code (rc) == GPG_ERR_UNKNOWN_PACKET
|| gpg_err_code (rc) == GPG_ERR_UNKNOWN_VERSION)
; /* Do not show a diagnostic. */
else if (gpg_err_code (rc) == GPG_ERR_INV_PACKET
&& (pkt->pkttype == PKT_USER_ID

View File

@ -2474,7 +2474,10 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
}
else
{
log_error ("packet(%d) with unknown version %d\n", pkttype, version);
if (version == 5)
log_info ("packet(%d) with unsupported version %d\n", pkttype, version);
else
log_error ("packet(%d) with unsupported version %d\n", pkttype,version);
if (list_mode)
es_fputs (":key packet: [unknown version]\n", listfp);
err = gpg_error (GPG_ERR_UNKNOWN_VERSION);