Filip Skokan
e0cab9dcf7
crypto: add TurboSHAKE and KangarooTwelve Web Cryptography algorithms
...
PR-URL: https://github.com/nodejs/node/pull/62183
Refs: https://wicg.github.io/webcrypto-modern-algos/#kangarootwelve
Refs: https://wicg.github.io/webcrypto-modern-algos/#turboshake
Refs: https://www.rfc-editor.org/rfc/rfc9861.html
Refs: https://redirect.github.com/openssl/openssl/issues/30304
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2026-03-26 22:04:32 +01:00
Filip Skokan
3e5a2f0fa9
lib: prefer primordials in SubtleCrypto
...
PR-URL: https://github.com/nodejs/node/pull/62226
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Jordan Harband <ljharb@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com >
2026-03-14 12:52:22 +00:00
Filip Skokan
e1ca754de0
crypto: read algorithm name property only once in normalizeAlgorithm
...
PR-URL: https://github.com/nodejs/node/pull/62170
Refs: https://redirect.github.com/web-platform-tests/wpt/pull/57614#pullrequestreview-3808145365
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2026-03-11 18:23:21 +00:00
Filip Skokan
d9f22269c0
crypto: add missing AES dictionaries
...
PR-URL: https://github.com/nodejs/node/pull/62099
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2026-03-06 10:39:52 +00:00
Filip Skokan
0124e0e0d7
crypto: support Ed448 and ML-DSA context parameter in Web Cryptography
...
PR-URL: https://github.com/nodejs/node/pull/59570
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-09-07 13:17:42 +00:00
Filip Skokan
14c68e3b53
crypto: add KMAC Web Cryptography algorithms
...
PR-URL: https://github.com/nodejs/node/pull/59647
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-09-06 22:43:15 +00:00
Filip Skokan
27e2d81617
crypto: add Argon2 Web Cryptography algorithms
...
PR-URL: https://github.com/nodejs/node/pull/59544
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
2025-08-26 16:05:56 +00:00
Filip Skokan
8692e601cc
crypto: add AES-OCB Web Cryptography algorithm
...
PR-URL: https://github.com/nodejs/node/pull/59539
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-08-24 09:47:20 +00:00
Filip Skokan
589ef79bf8
crypto: support ML-KEM in Web Cryptography
...
PR-URL: https://github.com/nodejs/node/pull/59569
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-08-23 17:01:51 +02:00
Filip Skokan
0fab11805f
crypto: require HMAC key length with SHA-3 hashes in Web Cryptography
...
PR-URL: https://github.com/nodejs/node/pull/59567
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2025-08-23 10:25:50 +00:00
Filip Skokan
7a47cbf4c5
crypto: normalize RsaHashedKeyParams publicExponent
...
Fixes: https://github.com/nodejs/node/issues/59535
PR-URL: https://github.com/nodejs/node/pull/59538
Fixes: https://github.com/nodejs/node/issues/59534
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2025-08-21 14:14:56 +00:00
Filip Skokan
5329f73816
lib: refactor kSupportedAlgorithms
...
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2025-08-19 15:57:25 +02:00
Filip Skokan
0cc2c83e32
crypto: subject some algorithms in Web Cryptography on BoringSSL absence
...
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2025-08-19 15:57:23 +02:00
Filip Skokan
84aaed7597
crypto: add ChaCha20-Poly1305 Web Cryptography algorithm
...
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2025-08-19 15:57:08 +02:00
Filip Skokan
1c4d534b75
crypto: add SHA-3 Web Cryptography digest algorithms
...
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2025-08-19 15:55:57 +02:00
Filip Skokan
327618c430
crypto: add SHAKE Web Cryptography digest algorithms
...
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2025-08-19 15:55:56 +02:00
Filip Skokan
87f4f99c09
crypto: support ML-DSA in Web Cryptography
...
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2025-08-19 15:55:53 +02:00
Filip Skokan
700a965dc3
crypto: prepare webcrypto key import/export for modern algorithms
...
PR-URL: https://github.com/nodejs/node/pull/59284
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2025-08-05 13:25:29 +00:00
Filip Skokan
d18f4878cf
src: refactor SubtleCrypto algorithm and length validations
...
PR-URL: https://github.com/nodejs/node/pull/57319
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-03-08 06:38:17 -08:00
Filip Skokan
6fdd4e6dcf
src: refactor SubtleCrypto algorithm and length validations
...
PR-URL: https://github.com/nodejs/node/pull/57273
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jason Zhang <xzha4350@gmail.com >
Reviewed-By: Mattias Buelens <mattias@buelens.com >
2025-03-04 17:45:51 +00:00
Michael Dawson
f2d274753a
crypto: add api to get openssl security level
...
Distros may compile with a different openssl security level than the
default. In addition there has been some discussion with respect
to shipping with a different default security security level in
different Node.js versions in order to main stabilty. Exposing the
default openssl security level with let us have tests that work in
these situations as well as allow applications to better cope with
the avialable crypto algorithms.
- add API to get openssl security level
- modify one test to use security level instead
of openssl version as an example
Signed-off-by: Michael Dawson <midawson@redhat.com >
PR-URL: https://github.com/nodejs/node/pull/56601
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com >
2025-01-28 14:00:59 -05:00
Filip Skokan
ee8810731d
crypto: graduate WebCryptoAPI Ed25519 and X25519 algorithms as stable
...
PR-URL: https://github.com/nodejs/node/pull/56142
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2024-12-07 15:07:53 +01:00
Antoine du Hamel
4c844a2f30
crypto: remove unused kHashTypes internal
...
PR-URL: https://github.com/nodejs/node/pull/54627
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-08-31 06:34:53 +00:00
Filip Skokan
64bb5f8f8e
lib: refactor SubtleCrypto experimental warnings
...
PR-URL: https://github.com/nodejs/node/pull/54620
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2024-08-30 21:50:10 +00:00
Mustafa Ateş UZUN
2b57e47d42
crypto: fix duplicated switch-case return values
...
PR-URL: https://github.com/nodejs/node/pull/49030
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-05-12 21:17:14 +02:00
Antoine du Hamel
231548b5cf
lib: enforce ASCII order in error code imports
...
PR-URL: https://github.com/nodejs/node/pull/52625
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2024-04-23 17:05:38 +00:00
Filip Skokan
2241e8c5b3
crypto: validate RSA-PSS saltLength in subtle.sign and subtle.verify
...
fixes: https://github.com/nodejs/node/issues/52188
PR-URL: https://github.com/nodejs/node/pull/52262
Fixes: https://github.com/nodejs/node/issues/52188
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io >
2024-04-03 05:16:10 +00:00
Joyee Cheung
57c22e4a22
crypto: use EVP_MD_fetch and cache EVP_MD for hashes
...
On OpenSSL 3, migrate from EVP_get_digestbyname() to EVP_MD_fetch()
to get the implementation and use a per-Environment cache for it.
The EVP_MDs are freed during Environment cleanup.
Drive-by: declare the smart pointer for EVP_MD_CTX as EVPMDCtxPointer
instead of EVPMDPointer to avoid confusion with EVP_MD pointers.
PR-URL: https://github.com/nodejs/node/pull/51034
Refs: https://www.openssl.org/docs/man3.0/man7/crypto.html#Explicit-fetching
Refs: https://github.com/nodejs/performance/issues/136
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-01-05 22:16:27 +00:00
Aras Abbasi
83e6350b82
errors: improve hideStackFrames
...
PR-URL: https://github.com/nodejs/node/pull/49990
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-11-11 16:25:08 +00:00
Tobias Nießen
78842cf213
crypto: remove getDefaultEncoding()
...
Refs: https://github.com/nodejs/node/pull/47182
Refs: https://github.com/nodejs/node/pull/47869
Refs: https://github.com/nodejs/node/pull/47943
Refs: https://github.com/nodejs/node/pull/47998
Refs: https://github.com/nodejs/node/pull/49140
Refs: https://github.com/nodejs/node/pull/49145
Refs: https://github.com/nodejs/node/pull/49167
Refs: https://github.com/nodejs/node/pull/49169
PR-URL: https://github.com/nodejs/node/pull/49170
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-08-19 12:55:30 +05:30
Tobias Nießen
5b4c7bd78f
crypto: fix setEngine() when OPENSSL_NO_ENGINE set
...
When OpenSSL is configured with OPENSSL_NO_ENGINE, setEngine() currently
throws an internal error because the C++ binding does not export the
relevant function, which causes _setEngine() to be undefined within JS.
Instead, match the behavior of tls/secure-context.js and throw the
existing error code ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED when OpenSSL
has been configured with OPENSSL_NO_ENGINE.
PR-URL: https://github.com/nodejs/node/pull/47977
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
2023-05-15 15:39:11 +00:00
Tobias Nießen
9374700d7a
crypto: remove DEFAULT_ENCODING
...
Citing 76b0bdf720 from 2012, "only use
this as a temporary measure."
Getting or setting DEFAULT_ENCODING has emitted a warning ever since
Node.js 10, so it seems appropriate to remove it in Node.js 20 five
years later. The last Node.js version that did not emit a warning
reached its end-of-life status at the end of 2019.
This commit only removes the public API so that the change can land in
time for Node.js 20.
Refs: https://github.com/nodejs/node-v0.x-archive/pull/4179
Refs: https://github.com/nodejs/node/pull/18333
PR-URL: https://github.com/nodejs/node/pull/47182
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com >
Reviewed-By: Erick Wendel <erick.workspace@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2023-03-26 18:03:58 +00:00
Antoine du Hamel
ab8942848b
lib: enforce use of trailing commas
...
PR-URL: https://github.com/nodejs/node/pull/46881
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
2023-03-06 10:44:14 +01:00
Antoine du Hamel
fe514bf960
lib: enforce use of trailing commas for functions
...
PR-URL: https://github.com/nodejs/node/pull/46629
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
2023-02-14 18:45:16 +01:00
Filip Skokan
3ef38c4bd7
crypto: use WebIDL converters in WebCryptoAPI
...
WebCryptoAPI functions' arguments are now coersed and validated as per
their WebIDL definitions like in other Web Crypto API implementations.
This further improves interoperability with other implementations of
Web Crypto API.
PR-URL: https://github.com/nodejs/node/pull/46067
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2023-01-17 08:57:58 +00:00
Antoine du Hamel
bb908fc886
crypto: simplify lazy loading of internal modules
...
The internal `require()` is actually just one map load (to see if the
module is already loaded) + one property load (state check for circular
dependencies) for modules that are already loaded.
Refs: https://github.com/nodejs/node/pull/45659#discussion_r1033762328
PR-URL: https://github.com/nodejs/node/pull/45809
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-12-12 15:17:44 +00:00
Filip Skokan
73a5112583
crypto: handle more webcrypto errors with OperationError
...
PR-URL: https://github.com/nodejs/node/pull/45320
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-11-07 06:35:35 +00:00
Filip Skokan
214354fc9f
crypto: fix webcrypto HMAC "get key length" in deriveKey and generateKey
...
PR-URL: https://github.com/nodejs/node/pull/44917
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-10-12 19:18:38 +00:00
Filip Skokan
0d80e7344e
crypto: add causes to applicable webcrypto's OperationError
...
PR-URL: https://github.com/nodejs/node/pull/44890
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-10-10 01:12:28 +00:00
Filip Skokan
ac1b90eed1
crypto: fix webcrypto operation errors to be OperationError
...
PR-URL: https://github.com/nodejs/node/pull/44171
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-08-12 19:29:14 +00:00
Filip Skokan
fbfb91ba33
crypto: remove Node.js-specific webcrypto extensions
...
PR-URL: https://github.com/nodejs/node/pull/43310
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-06-11 08:04:20 +01:00
Filip Skokan
7e5da97d15
crypto: add CFRG curves to Web Crypto API
...
PR-URL: https://github.com/nodejs/node/pull/42507
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-06-04 07:20:27 +01:00
Tobias Nießen
75dbb86c58
crypto: clean up parameter validation in HKDF
...
PR-URL: https://github.com/nodejs/node/pull/42924
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Zeyu Yang <himself65@outlook.com >
2022-05-02 18:46:04 +01:00
Rich Trott
49547abe99
lib: prepare files for no-var lint rule
...
PR-URL: https://github.com/nodejs/node/pull/42573
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2022-04-04 10:53:28 +00:00
Filip Skokan
5d0eb10c80
crypto: do not add undefined hash in webcrypto normalizeAlgorithm
...
PR-URL: https://github.com/nodejs/node/pull/42559
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-04-03 11:11:21 +01:00
XadillaX
2de139b5d5
lib: make lazyDOMException more common
...
PR-URL: https://github.com/nodejs/node/pull/39105
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2021-06-28 13:44:28 +08:00
Antoine du Hamel
26e318a321
doc: use HEAD instead of master for links
...
PR-URL: https://github.com/nodejs/node/pull/38518
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
2021-05-05 10:45:30 +02:00
Filip Skokan
c81d0fa9bc
crypto: use correct webcrypto RSASSA-PKCS1-v1_5 algorithm name
...
PR-URL: https://github.com/nodejs/node/pull/38029
Refs: https://www.w3.org/TR/WebCryptoAPI/#rsassa-pkcs1
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2021-04-04 00:08:37 +02:00
Antoine du Hamel
75259c7492
crypto: refactor hasAnyNotIn to avoid unsafe array iteration
...
PR-URL: https://github.com/nodejs/node/pull/37433
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com >
2021-02-26 16:34:04 +01:00
Rich Trott
b461a1b125
doc,lib: prepare for stricter multi-line array linting
...
We're about to turn on a requirement for dangling commas.
PR-URL: https://github.com/nodejs/node/pull/37088
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2021-02-19 09:55:35 -08:00