Page MenuHome GnuPG

gpg --import cannot display user ID
Closed, ResolvedPublic

Description

The current master branch of gnupg (commit 24ae5af102cb53bd7abfb9f25aca93debb785a2f) displays [User ID not found] when attempting to import a key:

$ gpg --import damien.asc
gpg: key A8DC7067E25EFBABB: 17 signatures not checked to due to missing keys
gpg: key A8DC7067E25EFBABB: public key "[User ID not found]" imported
gpg: Total number processed: 1
gpg:               imported: 1

It also happens when the imported key is already present in the keyring:

$ gpg --import damien.asc 
gpg: key A8DC7067E25FBABB: 17 signatures not checked due to missing keys
gpg: key A8DC7067E25FBABB: "[User ID not found]" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

This is independent of the actual key imported.

The bug is not present in GnuPG 2.2.4 and also not present in tag gnupg-2.3-base, so it must have been introduced somewhere in the 2.3 branch.

Details

Version
master

Event Timeline

gouttegd created this object in space S1 Public.

Bissecting between gnupg-2.3-base and master pinpointed commit ecbbafb88d920e713439b6b1b8e1b41a6f8d0e38 as the origin of the bug. This commit changed MAX_FINGERPRINT_LEN from 20 to 32, but the get_user_id_byfpr function in g10/getkey.c still assumes the old value.

werner added a subscriber: werner.

Thanks for tracking this down. I'll fix.

Well, it took long to fix. My original plan was to fix it while reworking getkey.c but that I have not yet come to work on that.