Skip to content

Commit

Permalink
fix(ext/crypto): use correct handle for public keys
Browse files Browse the repository at this point in the history
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: denoland#14119
Refs: denoland/deno_std#2631
  • Loading branch information
cjihrig committed Sep 30, 2022
1 parent 38f5445 commit b380845
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/crypto/00_crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b380845

Please sign in to comment.