Page MenuHome GnuPG

Can't get a keyblock for a key if it is followed by a legacy key
Closed, ResolvedPublic

Description

The attached keyring contains two keys: a normal key and a legacy key (in that
order). 'gpg2 -k', however, does not show any keys. The problem is in
keyring_get_keyblock. Basically, this function detects a new key block when it
sees a public key or a secret key packet. However, it first checks if the
packet is a legacy packet. If so, it bails. Instead, if we encounter a legacy
packet after already processing some packets, then the legacy packet is a key
boundary.

Event Timeline

Note: to reproduce:

gpg2 --no-options --no-default-keyring --keyring pubring.gpg -k
neal claimed this task.

Fixed in ad9befa.