When performing a keylist with GPGME_KEYLIST_MODE_EXTERN, if the keyserver returns
a key id that is greater than 8 digits, the key id will be blank.
The draft of "HTTP Keyserver Protocol" states in section 5.2:
http://tools.ietf.org/html/draft-shaw-openpgp-hkp-00#section-5.2
---
<keyid> = this is either the fingerprint or the key ID of the key. Either the 16-digit or 8-digit key IDs are acceptable, but obviously the fingerprint is best. A keyserver should use the most specific of the key IDs that it has available. Since it is not possible to calculate the key ID from a V3 key fingerprint, for V3 keys this should be either the 16-digit or 8-digit key ID only
I have narrowed down the cause to this line:
https://gitorious.org/gnupg-org/gpgme/source/86260b47c9e306e325103d1af767842357647
e60:src/keylist.c#L553
Attached is a simple patch that works around the issue, albeit, in a not very well
tested or overly informed fashion - so it may need some reform.
Patch is against HEAD of master.