summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/internal/crypto/cipher.ts
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-12-03 09:58:13 +0530
committerGitHub <noreply@github.com>2023-12-03 09:58:13 +0530
commit32438d25c337f9160c1c90d48680963654385e22 (patch)
tree14efb86398438a9d05d00be96791b3a6e98eca66 /ext/node/polyfills/internal/crypto/cipher.ts
parent39c7d8dafe00fd619afac7de0151790e7d53cd43 (diff)
fix(ext/node): sign with PEM private keys (#21287)
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>
Diffstat (limited to 'ext/node/polyfills/internal/crypto/cipher.ts')
-rw-r--r--ext/node/polyfills/internal/crypto/cipher.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/node/polyfills/internal/crypto/cipher.ts b/ext/node/polyfills/internal/crypto/cipher.ts
index 5fec98ff0..9b63db538 100644
--- a/ext/node/polyfills/internal/crypto/cipher.ts
+++ b/ext/node/polyfills/internal/crypto/cipher.ts
@@ -31,7 +31,8 @@ import {
export function isStringOrBuffer(val) {
return typeof val === "string" ||
isArrayBufferView(val) ||
- isAnyArrayBuffer(val);
+ isAnyArrayBuffer(val) ||
+ Buffer.isBuffer(val);
}
const { ops, encode } = globalThis.__bootstrap.core;