aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2024-09-12 09:06:09 +0000
committerWerner Koch <[email protected]>2024-09-12 09:06:09 +0000
commitb357ff2aa64c6a0ff17941d99feeb1174035b031 (patch)
tree6db6c84f2725d5e6cbd05cbe020aa5d61aaae003
parentagent: Fix KEYTOCARD for the use case with loopback pinentry. (diff)
downloadgnupg-b357ff2aa64c6a0ff17941d99feeb1174035b031.tar.gz
gnupg-b357ff2aa64c6a0ff17941d99feeb1174035b031.zip
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: de70a2f377c1647417fb8a2b6476c3744a901296
-rw-r--r--g10/import.c3
-rw-r--r--g10/parse-packet.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/g10/import.c b/g10/import.c
index 657b2deb6..ba9531234 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -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
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index e0fe9c0c8..d0190fd43 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -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);