Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The PGP key server query builder omits leading zero(s) in 'keyId' parameter #1028

Closed
khakim0v opened this issue Apr 28, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@khakim0v
Copy link

Describe the bug
It appears that there is an issue with a PGP key server query building. The current format for constructing the request leads to leading zero(s) (if present) of 'keyid' being omitted. Which in turn causes an "Invalid request/Not found" error on a key server. Tested on keys.openpgp.org, keyserver.ubuntu.com and pgp.mit.edu.

Examples:
https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x04376F3EE0856959 (valid)
https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x4376F3EE0856959 (error)

Platform:

  • MimeKit Version: 4.5.0

Expected behavior
The format string in code should be updated to "op=get&search=0x{0:X16}" to correctly represent keyId as a fixed-width string of 16 hex digits:

builder.Query = string.Format (CultureInfo.InvariantCulture, "op=get&search=0x{0:X}", keyId);

@jstedfast jstedfast added the bug Something isn't working label Apr 28, 2024
jstedfast added a commit that referenced this issue Apr 28, 2024
@jstedfast
Copy link
Owner

Released 4.6.0 with this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants