summaryrefslogtreecommitdiff
path: root/ext/crypto/00_crypto.js
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2021-08-16 21:41:36 +0530
committerGitHub <noreply@github.com>2021-08-16 18:11:36 +0200
commiteea6f578fc0fe9488c9fbd6c2bcbf665fff92424 (patch)
tree726098c526f26cee4ed0c7f683641c3b967d12b5 /ext/crypto/00_crypto.js
parent245987b2a7f61d186a64a253b84346072335c878 (diff)
fix(ext/crypto): enable non-extractable keys (#11705)
Diffstat (limited to 'ext/crypto/00_crypto.js')
-rw-r--r--ext/crypto/00_crypto.js18
1 files changed, 1 insertions, 17 deletions
diff --git a/ext/crypto/00_crypto.js b/ext/crypto/00_crypto.js
index 69425ae6a..5fdbe6ebc 100644
--- a/ext/crypto/00_crypto.js
+++ b/ext/crypto/00_crypto.js
@@ -491,14 +491,6 @@
throw new DOMException("Invalid key usages", "SyntaxError");
}
- // https://github.com/denoland/deno/pull/9614#issuecomment-866049433
- if (!extractable) {
- throw new DOMException(
- "Non-extractable keys are not supported",
- "SecurityError",
- );
- }
-
switch (normalizedAlgorithm.name) {
// https://w3c.github.io/webcrypto/#hmac-operations
case "HMAC": {
@@ -543,7 +535,7 @@
const key = constructKey(
"secret",
- true,
+ extractable,
usageIntersection(keyUsages, recognisedUsages),
algorithm,
handle,
@@ -757,14 +749,6 @@
const normalizedAlgorithm = normalizeAlgorithm(algorithm, "generateKey");
- // https://github.com/denoland/deno/pull/9614#issuecomment-866049433
- if (!extractable) {
- throw new DOMException(
- "Non-extractable keys are not supported",
- "SecurityError",
- );
- }
-
const result = await generateKey(
normalizedAlgorithm,
extractable,