Fix PGP EC Key Conversion - #1671
Closed
vanitasvitae wants to merge 4 commits into
Closed
Conversation
vanitasvitae
force-pushed
the
fixECKeyConversion
branch
from
May 21, 2024 10:35
87bbd5d to
7ae4dbd
Compare
Contributor
Author
|
Some observations: |
vanitasvitae
force-pushed
the
fixECKeyConversion
branch
from
May 23, 2024 08:00
7ae4dbd to
8004fb3
Compare
Contributor
|
Thanks. Merged with revision - you'll find the changes in JcaPGPKeyConverter, I've generalized it to deal with non-BC keys and also added use of the X962Parameters type which is the ASN.1 construct you'll find in a key of type id_ecPublicKey. It would be worth having a look as it explains what's going on internally in the actual Java providers (well at least the ones I have seen to date). |
hubot
pushed a commit
that referenced
this pull request
May 30, 2024
…9.62 parameters for curve OID finding (relates to github #1671)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is based on #1663 and fixes JcaPGPKeyConverter conversions for Elliptic Curve keys (Brainpool, NIST etc.).
The test from aeb001d shows that conversion between Jca and BC keys fails for some elliptic curve based keys, because some keys report the wrong OID (
X9ObjectIdentifiers.id_ecPublicKey).The patch from 87bbd5d drills down on the key to detect the proper OID by iterating over all known curves (a bit inefficient, is there a cleaner way?).