-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
crypto: support ML-DSA KeyObject, sign, and verify #59259
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
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
18133e1
to
2f37933
Compare
This comment was marked as outdated.
This comment was marked as outdated.
cc @nodejs/cpp-reviewers 🙏 |
521deae
to
7a6c57c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
7c37a1c
to
3c220b4
Compare
3c220b4
to
7bd6d1e
Compare
7bd6d1e
to
a08d556
Compare
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
99ed3b4
to
2739dba
Compare
2739dba
to
69fc44e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #59259 +/- ##
==========================================
+ Coverage 89.97% 89.98% +0.01%
==========================================
Files 649 650 +1
Lines 192131 192321 +190
Branches 37653 37722 +69
==========================================
+ Hits 172864 173056 +192
+ Misses 11883 11840 -43
- Partials 7384 7425 +41
🚀 New features to boost your workflow:
|
@@ -1942,7 +1942,16 @@ EVP_PKEY* EVPKeyPointer::release() { | |||
|
|||
int EVPKeyPointer::id(const EVP_PKEY* key) { | |||
if (key == nullptr) return 0; | |||
return EVP_PKEY_id(key); | |||
int type = EVP_PKEY_id(key); | |||
#if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker but, does this also need to have a OPENSSL_IS_BORING
guard? I doubt boring would end up duplicating these version values but just want to be cautious.
/cc @codebytere
first view pass looks good but there's a lot here so I want to take a second pass through before signing off. |
This allows
node:crypto
to recognize the following asymmetric KeyObject types (keyObject.asymmetricKeyType
) when built with or linked to OpenSSL 3.5 (#59234):'ml-dsa-44'
,'ml-dsa-65'
,'ml-dsa-87'
(https://docs.openssl.org/3.5/man7/EVP_PKEY-ML-DSA/)And the following functionality for them:
crypto.createPublicKey()
SPKI/JWKcrypto.createPrivateKey()
PKCS#8/JWKkeyObject.export()
SPKI/PKCS#8/JWKcrypto.generateKeyPair(Sync)()
into KeyObject, PEM, DER, JWKcrypto.sign()
and signature verification viacrypto.verify()
notable-changePRs with changes that should be highlighted in changelogs.
ML-DSA support in
node:crypto
kicks off post-quantum cryptography efforts in Node.js. This is part of a broader effort to support NIST's post-quantum cryptography standards for future-proofing applications against quantum computing threats.TODO:
crypto.createPublicKey()
andcrypto.createPrivateKey()
context-string
as an option fromcrypto.sign()
andcrypto.verify()