From 1012bbc380c81bf7782a85d43c2c9ed7caf8c8b9 Mon Sep 17 00:00:00 2001 From: mschwarzl Date: Tue, 13 Aug 2024 21:40:10 +0200 Subject: [PATCH] Support for Cloudflare Workers for javascript_stir (#1401) * Support for Cloudflare Workers for javascript_stir * Ramove debugging comment --------- Co-authored-by: Frank Denis <124872+jedisct1@users.noreply.github.com> --- src/libsodium/randombytes/randombytes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libsodium/randombytes/randombytes.c b/src/libsodium/randombytes/randombytes.c index 6741434b..85c24454 100644 --- a/src/libsodium/randombytes/randombytes.c +++ b/src/libsodium/randombytes/randombytes.c @@ -57,6 +57,7 @@ javascript_stir(void) try { var window_ = 'object' === typeof window ? window : self; var crypto_ = typeof window_.crypto !== 'undefined' ? window_.crypto : window_.msCrypto; + crypto_ = (crypto_ === undefined) ? crypto : crypto_; var randomValuesStandard = function() { var buf = new Uint32Array(1); crypto_.getRandomValues(buf);