summaryrefslogtreecommitdiff
path: root/extensions/crypto/01_crypto.js
diff options
context:
space:
mode:
authorLeo K <crowlkats@toaxl.com>2021-06-05 19:30:20 +0200
committerGitHub <noreply@github.com>2021-06-05 19:30:20 +0200
commit083f5c345445af4e434281c37817e12249d7553d (patch)
tree2db46d622283ab37182ca988ecb0712dc11af6e8 /extensions/crypto/01_crypto.js
parent706b75d7421a33a54f51ceafc0747be4a646c707 (diff)
refactor(crypto): validate max random bytes in Rust (#10857)
Diffstat (limited to 'extensions/crypto/01_crypto.js')
-rw-r--r--extensions/crypto/01_crypto.js8
1 files changed, 1 insertions, 7 deletions
diff --git a/extensions/crypto/01_crypto.js b/extensions/crypto/01_crypto.js
index 627035c28..f18b6d5aa 100644
--- a/extensions/crypto/01_crypto.js
+++ b/extensions/crypto/01_crypto.js
@@ -26,18 +26,12 @@
"TypeMismatchError",
);
}
- if (arrayBufferView.byteLength > 65536) {
- throw new DOMException(
- `The ArrayBufferView's byte length (${arrayBufferView.byteLength}) exceeds the number of bytes of entropy available via this API (65536)`,
- "QuotaExceededError",
- );
- }
const ui8 = new Uint8Array(
arrayBufferView.buffer,
arrayBufferView.byteOffset,
arrayBufferView.byteLength,
);
- core.opSync("op_crypto_get_random_values", null, ui8);
+ core.opSync("op_crypto_get_random_values", ui8);
return arrayBufferView;
}