gpg: Import only packets which are allowed in a keyblock.
authorWerner Koch <wk@gnupg.org>
Thu, 20 Dec 2012 08:43:41 +0000 (09:43 +0100)
committerWerner Koch <wk@gnupg.org>
Thu, 20 Dec 2012 11:37:01 +0000 (12:37 +0100)
commitf0b33b6fb8e0586e9584a7a409dcc31263776a67
treef7c503424759dcf7699a80f2556e71b94497b15b
parentd61f7402f2b0f6dd288e403ed9408fd65e617f85
gpg: Import only packets which are allowed in a keyblock.

* g10/import.c (valid_keyblock_packet): New.
(read_block): Store only valid packets.
--

A corrupted key, which for example included a mangled public key
encrypted packet, used to corrupt the keyring.  This change skips all
packets which are not allowed in a keyblock.

GnuPG-bug-id: 1455

(cherry-picked from commit f795a0d59e197455f8723c300eebf59e09853efa)
g10/import.c