From 636b448f3c9eaa29ac0452547f6e16e8fb1fb0f6 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Fri, 30 Sep 2022 09:18:30 -0400 Subject: fix(ext/crypto): use correct handle for public keys (#16099) When storing public and private keys in the key store, use a different handle for each key so that they can be looked up in the future. Refs: https://github.com/denoland/deno/pull/14119 Refs: https://github.com/denoland/deno_std/issues/2631 --- ext/crypto/00_crypto.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/crypto/00_crypto.js') diff --git a/ext/crypto/00_crypto.js b/ext/crypto/00_crypto.js index 41c85bdd1..9134f486b 100644 --- a/ext/crypto/00_crypto.js +++ b/ext/crypto/00_crypto.js @@ -1983,7 +1983,7 @@ WeakMapPrototypeSet(KEY_STORE, handle, privateKeyData); const publicHandle = {}; - WeakMapPrototypeSet(KEY_STORE, handle, publicKeyData); + WeakMapPrototypeSet(KEY_STORE, publicHandle, publicKeyData); const algorithm = { name: algorithmName, @@ -2031,7 +2031,7 @@ WeakMapPrototypeSet(KEY_STORE, handle, privateKeyData); const publicHandle = {}; - WeakMapPrototypeSet(KEY_STORE, handle, publicKeyData); + WeakMapPrototypeSet(KEY_STORE, publicHandle, publicKeyData); const algorithm = { name: algorithmName, -- cgit v1.2.3