-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
[v3] wrong curve when marshaling ecdh keypair #1265
Comments
@gunawanwijaya thank you. Can you please check #1266 and see if it works for you? (you can ignore the lint errors on CI) |
just done some smoke testing, but |
I think the issue is on |
my suggestion is map https://github.com/lestrrat-go/jwx/blob/develop/v3/jwk/okp.go#L47 to the respective ecdh |
Can you please put down the expected behavior in a test (not just print the values, please put checks to show me exactly what you are expecting). It's less ambiguous than doing back on forth on comments. FWIW I think originally in jwx ECDH on P-384 was returning OKP (before you raised the issue) and I subsequently researched and thought ECDH on P-384 should return EC, not OKP. |
sorry for the confusion, I've updated the issue with a snippet from my code, the expectation is for |
@gunawanwijaya I've just updated #1266. One minor nit from your updated code: I'd almost say that resulting JWK should only be exportable to ECDSA keys, but I do agree that because of how things are, being able to convert it back to an ecdh.(Public|Private)Key is desirable. So as of the latest change in #1266, you can explicitly ask for the key to be exported to a ECDH key. |
Contribution Guidelines
Before filing an issue, please read the contents of CONTRIBUTING.md, and follow its instructions.
Describe the bug
json marshaling jwk.Key resulting in a different curve when using ecdh keypair,
e.g. using P384 but instead returning X25519
To Reproduce / Expected behavior
https://go.dev/play/p/YHIuYo-T-Lv
gist of jwk usage
The text was updated successfully, but these errors were encountered: