summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2021-07-13 22:22:59 +0530
committerGitHub <noreply@github.com>2021-07-13 18:52:59 +0200
commit9dc33907207eaafdd21ebcdcf3faee9d455d8f4c (patch)
tree8d0f808edcd7fca53d14668960d383152969c6bd
parent1ad6575028bd5a13eb0633cc5e7649e18deec556 (diff)
chore(extensions/crypto): use primoridials with verify() (#11384)
-rw-r--r--extensions/crypto/00_crypto.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/extensions/crypto/00_crypto.js b/extensions/crypto/00_crypto.js
index 896a11570..98359775e 100644
--- a/extensions/crypto/00_crypto.js
+++ b/extensions/crypto/00_crypto.js
@@ -443,7 +443,7 @@
});
// 2.
- if (ArrayBuffer.isView(signature)) {
+ if (ArrayBufferIsView(signature)) {
signature = new Uint8Array(
signature.buffer,
signature.byteOffset,
@@ -452,20 +452,20 @@
} else {
signature = new Uint8Array(signature);
}
- signature = signature.slice();
+ signature = TypedArrayPrototypeSlice(signature);
// 3.
- if (ArrayBuffer.isView(data)) {
+ if (ArrayBufferIsView(data)) {
data = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
} else {
data = new Uint8Array(data);
}
- data = data.slice();
+ data = TypedArrayPrototypeSlice(data);
const normalizedAlgorithm = normalizeAlgorithm(algorithm, "verify");
const handle = key[_handle];
- const keyData = KEY_STORE.get(handle);
+ const keyData = WeakMapPrototypeGet(KEY_STORE, handle);
if (normalizedAlgorithm.name !== key[_algorithm].name) {
throw new DOMException(
@@ -474,7 +474,7 @@
);
}
- if (!key[_usages].includes("verify")) {
+ if (!ArrayPrototypeIncludes(key[_usages], "verify")) {
throw new DOMException(
"Key does not support the 'verify' operation.",
"InvalidAccessError",