summaryrefslogtreecommitdiff
path: root/ext/node/ops/crypto
AgeCommit message (Collapse)Author
2024-11-06refactor: use concrete error type for remaining ops (#26746)Leo Kettmeir
2024-11-01chore: upgrade to rust 1.82 and LLVM 19 (#26615)Divy Srivastava
Upgrade to rust 1.82 and LLVM 19 . Removes one webusb test because `requestAdapter` not working on new ubuntu 24 runners
2024-10-31fix: clamp smi in fast calls by default (#26506)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/26480 Ref https://github.com/denoland/deno_core/commit/d2945fb65bca56ebfa7bb80556a4c8f4330d2315
2024-10-14fix(ext/node): compute pem length (upper bound) for key exports (#26231)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/26188
2024-09-19fix(ext/node): support x509 certificates in `createPublicKey` (#25731)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/25681
2024-09-16fix(ext/crypto): support md4 digest algorithm (#25656)Luca Casonato
Fixes #25646
2024-09-11fix(ext/node): validate input lengths in `Cipheriv` and `Decipheriv` (#25570)Yoshiya Hinosawa
addresses the first part of #25279
2024-08-28fix(ext/node): import RSA JWK keys (#25267)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/24129
2024-08-28fix(ext/node): export JWK public key (#25239)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/18928 Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-08-28fix(ext/node): import EC JWK keys (#25266)Divy Srivastava
2024-08-28fix(ext/node): update aead-gcm-stream to 0.3 (#25261)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/25260 Fixes https://github.com/denoland/deno/issues/25254 Fixes https://github.com/denoland/deno/issues/23693 Verified that `web-push` GCM decryption works in the browser. See `aead-gcm-stream` changes [here](https://github.com/littledivy/aead-gcm-stream/commit/a9ffd0c07c14e4b566c87bf51a20ff799b9e7f5e)
2024-08-23fix(ext/node): import JWK octet key pairs (#25180)Divy Srivastava
Ref https://github.com/denoland/deno/issues/24129 `kty: "okp"` is defined in [rfc8037](https://www.rfc-editor.org/rfc/rfc8037.html)
2024-08-11fix(ext/node): rewrite X509Certificate resource and add `publicKey()` (#24988)Divy Srivastava
**Changes**: - Remove unsafe usage, rewrite Rust representation with `yoke`. - Implement `X509Certificate.prototype.publicKey()` Fixes https://github.com/denoland/deno/issues/23307
2024-08-11fix(ext/node): support ieee-p1363 ECDSA signatures and pss salt len (#24981)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/22919
2024-08-09fix(ext/node): use pem private keys in createPublicKey (#24969)Luca Casonato
2024-08-09fix(ext/node): ed25519 signing and cipheriv autopadding fixes (#24957)Luca Casonato
- Return auth tag for GCM ciphers from auto padding shortcircuit - Use _ring_ for ed25519 signing --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-08-08fix(ext/node): add `CipherIv.setAutoPadding()` (#24940)Divy Srivastava
Co-Authored-By: Luca Casonato <hello@lcas.dev> Fixes https://github.com/denoland/deno/issues/21804 Ref https://github.com/denoland/deno/issues/20924 --------- Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com> Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-08-08fix(ext/node): add crypto.diffieHellman (#24938)Luca Casonato
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com> Closes #21806
2024-08-07feat(ext/node): rewrite crypto keys (#24463)Luca Casonato
This completely rewrites how we handle key material in ext/node. Changes in this PR: - **Signing** - RSA - RSA-PSS 🆕 - DSA 🆕 - EC - ED25519 🆕 - **Verifying** - RSA - RSA-PSS 🆕 - DSA 🆕 - EC 🆕 - ED25519 🆕 - **Private key import** - Passphrase encrypted private keys 🆕 - RSA - PEM - DER (PKCS#1) 🆕 - DER (PKCS#8) 🆕 - RSA-PSS - PEM - DER (PKCS#1) 🆕 - DER (PKCS#8) 🆕 - DSA 🆕 - EC - PEM - DER (SEC1) 🆕 - DER (PKCS#8) 🆕 - X25519 🆕 - ED25519 🆕 - DH - **Public key import** - RSA - PEM - DER (PKCS#1) 🆕 - DER (PKCS#8) 🆕 - RSA-PSS 🆕 - DSA 🆕 - EC 🆕 - X25519 🆕 - ED25519 🆕 - DH 🆕 - **Private key export** - RSA 🆕 - DSA 🆕 - EC 🆕 - X25519 🆕 - ED25519 🆕 - DH 🆕 - **Public key export** - RSA - DSA 🆕 - EC 🆕 - X25519 🆕 - ED25519 🆕 - DH 🆕 - **Key pair generation** - Overhauled, but supported APIs unchanged This PR adds a lot of new individual functionality. But most importantly because of the new key material representation, it is now trivial to add new algorithms (as shown by this PR). Now, when adding a new algorithm, it is also widely supported - for example previously we supported ED25519 key pair generation, but we could not import, export, sign or verify with ED25519. We can now do all of those things.
2024-07-05fix(ext/node): rewrite digest handling (#24392)Luca Casonato
Previously we had many different code paths all handling digests in different places, all with wildly different digest support. This commit rewrites this to use a single digest handling mechanism for all digest operations. It adds various aliases for digest algorithms, like node does. For example `sha1WithRSAEncryption` is an alias for `sha1`. It also adds support for `md5-sha1` digests in various places.
2024-07-01feat: upgrade deno_core (#24364)snek
- Symbol.asyncDispose no longer needs to be polyfilled - assorted updates for cppgc api changes
2024-06-24fix(ext/node): rewrite crypto.Hash (#24302)Luca Casonato
Changes in this PR: - Added new fixed size hash algorithms (blake2b512, blake2s256, sha512-224, sha512-256, sha3-224, sha3-256, sha3-384, sha3-512, sm3) - Added variable size hash algorithms (the concept), with the algorithms shake128 and shake256 - Use cppgc instead of resources for the hasher - Enable Node's crypto.Hash tests and fix found bugs
2024-06-21fix(ext/node): don't panic on invalid utf-8 in pem (#24303)Luca Casonato
2024-06-21fix: upgrade deno_core to 0.291.0 (#24297)Divy Srivastava
2024-06-14chore: upgrade to rust 1.79 (#24207)Satya Rohith
2024-04-29fix(ext/node): exporting rsa public keys (#23596)Divy Srivastava
Initial support for exporting rsa public KeyObject. Current assumption is that RSA keys are stored in pkcs1 der format in key storage. Ref https://github.com/denoland/deno/issues/23471 Ref https://github.com/denoland/deno/issues/18928 Ref https://github.com/denoland/deno/issues/21124
2024-03-21fix(ext/node): ECDH.publicKey() point encoding (#23013)Divy Srivastava
2024-03-21fix(ext/node): panic in `op_node_ecdh_generate_keys` (#23011)Divy Srivastava
2024-03-19fix(ext/node): support Diffie-Hellman key type in ↵Asher Gomez
`crypto.createPrivateKey()` (#22984) Towards #22489 Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-03-18fix(ext/node): support public key point encoding in ECDH.generateKeys() (#22976)Satya Rohith
Towards https://github.com/denoland/deno/issues/22921 Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-03-14fix(ext/node): Support private EC key signing (#22914)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/18972 Support for web-push VAPID keys & jws signing - Fixes EC keygen to return raw private key and uncompressed public key point. - Support for `EC PRIVATE KEY`
2024-03-14fix(ext/node): support `spki` format in createPublicKey (#22918)Divy Srivastava
2024-03-14fix(ext/node): DH (`dhKeyAgreement`) support for `createPrivateKey` (#22891)Divy Srivastava
Ref https://github.com/denoland/deno/pull/22511
2024-03-13fix(ext/node): initial `crypto.createPublicKey()` support (#22509)Asher Gomez
Closes #21807 Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-03-13feat(ext/node): add more named curves in `crypto.generateKeyPair[Sync]()` ↵Asher Gomez
(#22882) Towards fixing #21761
2024-03-07perf(cli): use faster_hex (#22761)Matt Mastracci
`cli::util::checksum` was showing up on flame graphs because it was concatenating allocated strings. We can use `faster-hex` to improve it.
2024-02-01fix(ext/node): add `aes256` algorithm support (#22198)Asher Gomez
Towards #21804
2024-01-27chore: upgrade deno_core to 0.256.0 (#22145)Divy Srivastava
2024-01-24feat(publish): error on invalid external imports (#22088)Luca Casonato
2024-01-20fix(node): use `cppgc` for managing X509Certificate (#21999)Divy Srivastava
Introduces the first cppgc backed Resource into Deno. This fixes the memory leak when using `X509Certificate` **Comparison**: ```js import { X509Certificate } from 'node:crypto'; const r = Deno.readFileSync('cli/tests/node_compat/test/fixtures/keys/agent1-cert.pem'); setInterval(() => { for (let i = 0; i < 10000; i++) { const cert = new X509Certificate(r); } }, 1000); ``` Memory usage after 5 secs `main`: 1692MB `cppgc`: peaks at 400MB
2024-01-09chore: upgrade deno_core to 0.244.0 (#21859)Bartek Iwańczuk
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-27fix(ext/node): Implement `aes-192-ecb` and `aes-256-ecb` (#21710)Lino Le Van
2023-12-03fix(ext/node): sign with PEM private keys (#21287)Divy Srivastava
Add support for signing with a RSA PEM private key: `pkcs8` and `pkcs1`. Fixes https://github.com/denoland/deno/issues/18972 Ref #21124 Verified fix with `npm:sshpk`. Unverfied but fixes `npm:google-auth-library`, `npm:web-push` & `oracle/oci-typescript-sdk` --------- Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-11-10chore: use pure rust secp256k1 crate (#21154)Divy Srivastava
Saves ~40s in fresh debug build
2023-11-09fix(node): implement createPrivateKey (#20981)Divy Srivastava
Towards #18455
2023-10-30chore: upgrade rsa to 0.9 (#21016)Divy Srivastava
2023-10-27chore(ext/crypto): upgrade to ring 0.17 (#20824)Divy Srivastava
Ref https://github.com/denoland/deno/issues/18071
2023-10-06refactor: migrate ext/node/ops to op2 (#20805)Bartek Iwańczuk
2023-09-26refactor: rewrite ext/node/crypto to op2 macro (#20675)Bartek Iwańczuk