diff options
author | Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> | 2023-01-27 22:49:46 -0800 |
---|---|---|
committer | Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> | 2023-01-30 18:49:42 +0000 |
commit | 3875258f971ce534262020c8342e70226b770d95 (patch) | |
tree | 6f60631dd73ea6542a4ace38b6a2b7be6af0afc5 /misc/wasm | |
parent | 01b9656fce32249d6debc2f0eaa2ce0c4154b827 (diff) | |
download | go-3875258f971ce534262020c8342e70226b770d95.tar.gz go-3875258f971ce534262020c8342e70226b770d95.zip |
misc/wasm: use NodeJS crypto library
The move to NodeJS 18 allows us to replace the custom
crypto functions with the expanded crypto primitives of
the NodeJS crypto library.
Fixes #56860
Change-Id: I8726b4003150f31521f246f613b6976641b9fa69
Reviewed-on: https://go-review.googlesource.com/c/go/+/463975
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Evan Phoenix <evan@phx.io>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'misc/wasm')
-rw-r--r-- | misc/wasm/wasm_exec_node.js | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/misc/wasm/wasm_exec_node.js b/misc/wasm/wasm_exec_node.js index 90905db115..986069087b 100644 --- a/misc/wasm/wasm_exec_node.js +++ b/misc/wasm/wasm_exec_node.js @@ -16,12 +16,7 @@ globalThis.TextDecoder = require("util").TextDecoder; globalThis.performance ??= require("performance"); -const crypto = require("crypto"); -globalThis.crypto = { - getRandomValues(b) { - crypto.randomFillSync(b); - }, -}; +globalThis.crypto ??= require("crypto"); require("./wasm_exec"); |