aboutsummaryrefslogtreecommitdiffstats
path: root/g10/parse-packet.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-10-31 09:29:02 +0000
committerWerner Koch <[email protected]>2014-10-31 09:31:11 +0000
commit28ae8ad70b3b802e67344468a4765eee6e291c68 (patch)
tree4869d784c19ceab0c5354bc39a2d4f75bb073751 /g10/parse-packet.c
parentgpg: Fix testing for secret key availability. (diff)
downloadgnupg-28ae8ad70b3b802e67344468a4765eee6e291c68.tar.gz
gnupg-28ae8ad70b3b802e67344468a4765eee6e291c68.zip
gpg: Fix --rebuild-keydb-caches.
* g10/parse-packet.c (parse_key): Store even unsupported packet versions. * g10/keyring.c (keyring_rebuild_cache): Do not copy keys with versions less than 4. -- That function, which is implicitly called while checking the keydb, led to corruption of v3 key packets in the keyring which would later spit out "packet(6)too short" messages. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/parse-packet.c')
-rw-r--r--g10/parse-packet.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 7787825f6..039f085a0 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -1953,6 +1953,7 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
log_info ("packet(%d) with obsolete version %d\n", pkttype, version);
if (list_mode)
es_fprintf (listfp, ":key packet: [obsolete version %d]\n", version);
+ pk->version = version;
err = gpg_error (GPG_ERR_INV_PACKET);
goto leave;
}