From 9c348a0acd7d1bc288c2ce5b66016571b9603288 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Thu, 14 Mar 2024 06:39:46 -0700 Subject: fix(ext/node): support `spki` format in createPublicKey (#22918) --- ext/node/polyfills/internal/crypto/keys.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/node/polyfills') diff --git a/ext/node/polyfills/internal/crypto/keys.ts b/ext/node/polyfills/internal/crypto/keys.ts index 33034d824..74379015b 100644 --- a/ext/node/polyfills/internal/crypto/keys.ts +++ b/ext/node/polyfills/internal/crypto/keys.ts @@ -66,7 +66,7 @@ export const getArrayBufferOrView = hideStackFrames( | Uint16Array | Uint32Array => { if (isAnyArrayBuffer(buffer)) { - return buffer; + return new Uint8Array(buffer); } if (typeof buffer === "string") { if (encoding === "buffer") { -- cgit v1.2.3