Page MenuHome GnuPG

search for keys by e-mail address behaves differently when key is in pubring.gpg vs. pubring.kbx
Closed, ResolvedPublic

Description

GnuPG 2.1.x now correctly finds User IDs that contain a raw e-mail address like
'foo@example.org' when the user requests '<foo@example.org>'. That's good!

However, it appears to only work for those keys stored in pubring.kbx, and does
not work for keys stored in pubring.gpg.

You can recreate this problem with a fresh $GNUPGHOME with the reproducer below:

export GNUPGHOME=$(mktemp -d)
gpg --quick-gen-key --batch --passphrase '' test@example.org
gpg --list-keys '<test@example.org>'
gpg --export '<test@example.org>' > $GNUPGHOME/pubring.gpg
mv $GNUPGHOME/pubring.kbx{,.bak}
gpg --list-keys '<test@example.org>'

not found above, but it is seen below:

gpg --list-keys

Details

Version
2.1.18

Event Timeline

dkg added projects: gnupg, Bug Report.
dkg added a subscriber: dkg.

That is a regression - it used to work since every early gpg versions.

That is no regression, that never worked well. It only works if one uses a uid
like 'test <test@example.org>'. I'll fix this.

thanks for the quick fix, Justus. I can confirm that this fixes the problem for me.