Skip to content

Commit

Permalink
fix(ext/crypto): use correct handle for public keys (#16099)
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: #14119
Refs: denoland/std#2631
  • Loading branch information
cjihrig authored Sep 30, 2022
1 parent 20c7300 commit 636b448
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 636b448

Please sign in to comment.