summaryrefslogtreecommitdiff
path: root/tests/unit_node
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-10-14 14:24:26 +0530
committerGitHub <noreply@github.com>2024-10-14 14:24:26 +0530
commitbbad7c592282dace88c77b0e089d53cb32878673 (patch)
treeb6798da918c99eb30c90f819161fc983b8211fdf /tests/unit_node
parent68b388a93a3efe443fc5e306e883847bfb8551db (diff)
fix(ext/node): compute pem length (upper bound) for key exports (#26231)
Fixes https://github.com/denoland/deno/issues/26188
Diffstat (limited to 'tests/unit_node')
-rw-r--r--tests/unit_node/crypto/crypto_key_test.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/unit_node/crypto/crypto_key_test.ts b/tests/unit_node/crypto/crypto_key_test.ts
index 7995ce5d3..3c7ad4423 100644
--- a/tests/unit_node/crypto/crypto_key_test.ts
+++ b/tests/unit_node/crypto/crypto_key_test.ts
@@ -656,3 +656,24 @@ z6TExWlQMjt66nV7R8cRAkzmABrG+NW3e8Zpac7Lkuv+zu0S+K7c
assertEquals(publicKey.type, "public");
assertEquals(publicKey.asymmetricKeyType, "rsa");
});
+
+// https://github.com/denoland/deno/issues/26188
+Deno.test("generateKeyPair large pem", function () {
+ const passphrase = "mypassphrase";
+ const cipher = "aes-256-cbc";
+ const modulusLength = 4096;
+
+ generateKeyPairSync("rsa", {
+ modulusLength,
+ publicKeyEncoding: {
+ type: "spki",
+ format: "pem",
+ },
+ privateKeyEncoding: {
+ type: "pkcs8",
+ format: "pem",
+ cipher,
+ passphrase,
+ },
+ });
+});