Skip to content

Correctly convert non-canonical public keys into XECPublicKeySpec. - #1371

Merged
tweksteen merged 5 commits into
google:masterfrom
juergw:master
Jul 23, 2025
Merged

Correctly convert non-canonical public keys into XECPublicKeySpec.#1371
tweksteen merged 5 commits into
google:masterfrom
juergw:master

Conversation

@juergw

@juergw juergw commented Jul 17, 2025

Copy link
Copy Markdown
Collaborator

If a X25519 public key that is in a non-canonical form is converted into a XECPublicKeySpec, the output may
be wrong. This fixes that.

We also add some tests (using the test vectors from RFC 7748, Section 5) that confirm that the conversion is now working.

We don't expect that this breaks any users, because all valid public keys should be in the canonical form.
But the RFC requires to accept keys in non-canonical form, so it is better to fix this.

@juergw
juergw requested a review from miguelaranda0 July 17, 2025 13:38
Comment thread common/src/test/java/org/conscrypt/javax/crypto/XdhKeyFactoryTest.java Outdated
Comment thread common/src/test/java/org/conscrypt/javax/crypto/XdhKeyFactoryTest.java Outdated
Comment thread common/src/test/java/org/conscrypt/javax/crypto/XdhKeyFactoryTest.java Outdated
@juergw
juergw requested a review from tweksteen July 22, 2025 12:17
@tweksteen
tweksteen merged commit d54a69a into google:master Jul 23, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants