+2017-08-18 Sam Weinig <sam@webkit.org>
+
+ Remove the deprecated WebKitSubtleCrypto interface
+ https://bugs.webkit.org/show_bug.cgi?id=164938
+ <rdar://problem/29894563>
+
+ Reviewed by Chris Dumez.
+
+ * crypto/webkitSubtle: Removed.
+ * crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html: Removed.
+ * crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html: Removed.
+ * crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html: Removed.
+ * crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html: Removed.
+ * crypto/webkitSubtle/aes-cbc-generate-key-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-cbc-generate-key.html: Removed.
+ * crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-cbc-import-jwk.html: Removed.
+ * crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-cbc-invalid-length.html: Removed.
+ * crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-cbc-unwrap-failure.html: Removed.
+ * crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-cbc-unwrap-rsa.html: Removed.
+ * crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html: Removed.
+ * crypto/webkitSubtle/aes-cbc-wrap-rsa.html: Removed.
+ * crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-cbc-wrong-key-class.html: Removed.
+ * crypto/webkitSubtle/aes-export-key-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-export-key.html: Removed.
+ * crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-kw-key-manipulation.html: Removed.
+ * crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html: Removed.
+ * crypto/webkitSubtle/aes-postMessage-expected.txt: Removed.
+ * crypto/webkitSubtle/aes-postMessage.html: Removed.
+ * crypto/webkitSubtle/argument-conversion-expected.txt: Removed.
+ * crypto/webkitSubtle/argument-conversion.html: Removed.
+ * crypto/webkitSubtle/array-buffer-view-offset-expected.txt: Removed.
+ * crypto/webkitSubtle/array-buffer-view-offset.html: Removed.
+ * crypto/webkitSubtle/disallowed-in-worker-expected.txt: Removed.
+ * crypto/webkitSubtle/disallowed-in-worker.html: Removed.
+ * crypto/webkitSubtle/gc-2-expected.txt: Removed.
+ * crypto/webkitSubtle/gc-2.html: Removed.
+ * crypto/webkitSubtle/gc-3-expected.txt: Removed.
+ * crypto/webkitSubtle/gc-3.html: Removed.
+ * crypto/webkitSubtle/gc-expected.txt: Removed.
+ * crypto/webkitSubtle/gc.html: Removed.
+ * crypto/webkitSubtle/hmac-check-algorithm-expected.txt: Removed.
+ * crypto/webkitSubtle/hmac-check-algorithm.html: Removed.
+ * crypto/webkitSubtle/hmac-export-key-expected.txt: Removed.
+ * crypto/webkitSubtle/hmac-export-key.html: Removed.
+ * crypto/webkitSubtle/hmac-generate-key-expected.txt: Removed.
+ * crypto/webkitSubtle/hmac-generate-key.html: Removed.
+ * crypto/webkitSubtle/hmac-import-jwk-expected.txt: Removed.
+ * crypto/webkitSubtle/hmac-import-jwk.html: Removed.
+ * crypto/webkitSubtle/hmac-postMessage-expected.txt: Removed.
+ * crypto/webkitSubtle/hmac-postMessage.html: Removed.
+ * crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt: Removed.
+ * crypto/webkitSubtle/hmac-sign-verify-empty-key.html: Removed.
+ * crypto/webkitSubtle/hmac-sign-verify-expected.txt: Removed.
+ * crypto/webkitSubtle/hmac-sign-verify.html: Removed.
+ * crypto/webkitSubtle/import-export-raw-key-leak-expected.txt: Removed.
+ * crypto/webkitSubtle/import-export-raw-key-leak.html: Removed.
+ * crypto/webkitSubtle/import-jwk-expected.txt: Removed.
+ * crypto/webkitSubtle/import-jwk.html: Removed.
+ * crypto/webkitSubtle/jwk-export-use-values-expected.txt: Removed.
+ * crypto/webkitSubtle/jwk-export-use-values.html: Removed.
+ * crypto/webkitSubtle/jwk-import-use-values-expected.txt: Removed.
+ * crypto/webkitSubtle/jwk-import-use-values.html: Removed.
+ * crypto/webkitSubtle/resources: Removed.
+ * crypto/webkitSubtle/resources/disallowed-in-worker.js: Removed.
+ * crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js: Removed.
+ * crypto/webkitSubtle/resources/rsa-indexeddb.js: Removed.
+ * crypto/webkitSubtle/rsa-export-generated-keys-expected.txt: Removed.
+ * crypto/webkitSubtle/rsa-export-generated-keys.html: Removed.
+ * crypto/webkitSubtle/rsa-export-key-expected.txt: Removed.
+ * crypto/webkitSubtle/rsa-export-key.html: Removed.
+ * crypto/webkitSubtle/rsa-export-private-key-expected.txt: Removed.
+ * crypto/webkitSubtle/rsa-export-private-key.html: Removed.
+ * crypto/webkitSubtle/rsa-indexeddb-expected.txt: Removed.
+ * crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt: Removed.
+ * crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt: Removed.
+ * crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html: Removed.
+ * crypto/webkitSubtle/rsa-indexeddb-non-exportable.html: Removed.
+ * crypto/webkitSubtle/rsa-indexeddb-private-expected.txt: Removed.
+ * crypto/webkitSubtle/rsa-indexeddb-private.html: Removed.
+ * crypto/webkitSubtle/rsa-indexeddb.html: Removed.
+ * crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt: Removed.
+ * crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html: Removed.
+ * crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt: Removed.
+ * crypto/webkitSubtle/rsa-oaep-key-manipulation.html: Removed.
+ * crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt: Removed.
+ * crypto/webkitSubtle/rsa-oaep-plaintext-length.html: Removed.
+ * crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt: Removed.
+ * crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html: Removed.
+ * crypto/webkitSubtle/rsa-postMessage-expected.txt: Removed.
+ * crypto/webkitSubtle/rsa-postMessage.html: Removed.
+ * crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt: Removed.
+ * crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html: Removed.
+ * crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt: Removed.
+ * crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html: Removed.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt: Removed.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt: Removed.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html: Removed.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html: Removed.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt: Removed.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt: Removed.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html: Removed.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html: Removed.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt: Removed.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html: Removed.
+ * crypto/webkitSubtle/sha-1-expected.txt: Removed.
+ * crypto/webkitSubtle/sha-1.html: Removed.
+ * crypto/webkitSubtle/sha-224-expected.txt: Removed.
+ * crypto/webkitSubtle/sha-224.html: Removed.
+ * crypto/webkitSubtle/sha-256-expected.txt: Removed.
+ * crypto/webkitSubtle/sha-256.html: Removed.
+ * crypto/webkitSubtle/sha-384-expected.txt: Removed.
+ * crypto/webkitSubtle/sha-384.html: Removed.
+ * crypto/webkitSubtle/sha-512-expected.txt: Removed.
+ * crypto/webkitSubtle/sha-512.html: Removed.
+ * crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt: Removed.
+ * crypto/webkitSubtle/unimplemented-unwrap-crash.html: Removed.
+ * crypto/webkitSubtle/unwrapKey-check-usage-expected.txt: Removed.
+ * crypto/webkitSubtle/unwrapKey-check-usage.html: Removed.
+ * crypto/webkitSubtle/wrapKey-check-usage-expected.txt: Removed.
+ * crypto/webkitSubtle/wrapKey-check-usage.html: Removed.
+
+ Remove webkitSubtleCrypto tests.
+
+ * fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt:
+
+ Remove webkitSubtleCrypto deprecation warning that no longer happens.
+
+ * platform/ios-wk1/TestExpectations:
+ * platform/win/TestExpectations:
+ * platform/wpe/TestExpectations:
+
+ Remove webkitSubtle tests from expectations files.
+
2017-08-18 Jonathan Bedard <jbedard@apple.com>
Marking canvas/webgl tests as failing
+++ /dev/null
-CONSOLE MESSAGE: line 22: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test AES-CBC encrypt and decrypt functions with a 256 bit key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw AES key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 192
-PASS key.usages is ['decrypt', 'encrypt']
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'
-Decrypting it back...
-PASS new Uint8Array(decryptionResult) is plaintext
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test AES-CBC encrypt and decrypt functions with a 256 bit key.");
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array("8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b");
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
-var extractable = true;
-
-debug("Importing a raw AES key from string literal...");
-crypto.webkitSubtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "192");
- shouldBe("key.usages", "['decrypt', 'encrypt']");
-
- debug("Using the key to encrypt plaintext...");
- return crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
-}).then(function(result) {
- encryptionResult = result;
- shouldBe("bytesToHexString(new Uint8Array(encryptionResult))", "'4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'");
-
- debug("Decrypting it back...");
- return crypto.webkitSubtle.decrypt({name: "aes-cbc", iv: iv}, key, result);
-}).then(function(result) {
- decryptionResult = result;
- shouldBe("new Uint8Array(decryptionResult)", "plaintext");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 22: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test AES-CBC encrypt and decrypt functions with a 256 bit key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw AES key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 256
-PASS key.usages is ['decrypt', 'encrypt']
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(encryptionResult)) is 'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644'
-Decrypting it back...
-PASS new Uint8Array(decryptionResult) is plaintext
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test AES-CBC encrypt and decrypt functions with a 256 bit key.");
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
-var extractable = true;
-
-debug("Importing a raw AES key from string literal...");
-crypto.webkitSubtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "256");
- shouldBe("key.usages", "['decrypt', 'encrypt']");
-
- debug("Using the key to encrypt plaintext...");
- return crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
-}).then(function(result) {
- encryptionResult = result;
- shouldBe("bytesToHexString(new Uint8Array(encryptionResult))", "'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644'");
-
- debug("Decrypting it back...");
- return crypto.webkitSubtle.decrypt({name: "aes-cbc", iv: iv}, key, result);
-}).then(function(result) {
- decryptionResult = result;
- shouldBe("new Uint8Array(decryptionResult)", "plaintext");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 22: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test AES-CBC encrypt and decrypt functions.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw AES key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 128
-PASS key.usages is ['decrypt', 'encrypt']
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(encryptionResult)) is '7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012'
-Decrypting it back...
-PASS new Uint8Array(decryptionResult) is plaintext
-Testing initialization vector bindings...
-PASS crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: null}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.webkitSubtle.encrypt({name: 'AES-CBC'}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: 3}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: new Uint8Array([0])}, key, plaintext) threw exception Error: AES-CBC initialization data must be 16 bytes.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-CONSOLE MESSAGE: line 22: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test AES-CBC encrypt and decrypt functions on a plaintext that is not a multiple of block size in length.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw AES key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 128
-PASS key.usages is ['decrypt', 'encrypt']
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(cyphertext)) is '630199c5f202cc7167bb84c6c72b349d'
-Decrypting it back...
-PASS new Uint8Array(decryptionResult) is plaintext
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test AES-CBC encrypt and decrypt functions on a plaintext that is not a multiple of block size in length.");
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array("2b7e151628aed2a6abf7158809cf4f3c");
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = asciiToUint8Array("test");
-var extractable = true;
-
-debug("Importing a raw AES key from string literal...");
-crypto.webkitSubtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "128");
- shouldBe("key.usages", "['decrypt', 'encrypt']");
-
- debug("Using the key to encrypt plaintext...");
- return crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
-}).then(function(result) {
- cyphertext = result;
- shouldBe("bytesToHexString(new Uint8Array(cyphertext))", "'630199c5f202cc7167bb84c6c72b349d'");
-
- debug("Decrypting it back...");
- return crypto.webkitSubtle.decrypt({name: "aes-cbc", iv: iv}, key, result);
-}).then(function(result) {
- decryptionResult = result;
- shouldBe("new Uint8Array(decryptionResult)", "plaintext");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test AES-CBC encrypt and decrypt functions.");
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array("2b7e151628aed2a6abf7158809cf4f3c");
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
-var extractable = true;
-
-debug("Importing a raw AES key from string literal...");
-crypto.webkitSubtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "128");
- shouldBe("key.usages", "['decrypt', 'encrypt']");
-
- debug("Using the key to encrypt plaintext...");
- return crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
-}).then(function(result) {
- encryptionResult = result;
- shouldBe("bytesToHexString(new Uint8Array(encryptionResult))", "'7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012'");
-
- debug("Decrypting it back...");
- return crypto.webkitSubtle.decrypt({name: "aes-cbc", iv: iv}, key, result);
-}).then(function(result) {
- decryptionResult = result;
- shouldBe("new Uint8Array(decryptionResult)", "plaintext");
-
- debug("Testing initialization vector bindings...");
- shouldThrow("crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: null}, key, plaintext)");
- shouldThrow("crypto.webkitSubtle.encrypt({name: 'AES-CBC'}, key, plaintext)");
- shouldThrow("crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: 3}, key, plaintext)");
- shouldThrow("crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: new Uint8Array([0])}, key, plaintext)");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 616: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test generating an AES key using AES-CBC algorithm.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS crypto.webkitSubtle.generateKey("aes-cbc", extractable, ["encrypt", "decrypt"]) threw exception TypeError: Type error.
-PASS crypto.webkitSubtle.generateKey({name: "aes-cbc"}, extractable, ["encrypt", "decrypt"]) threw exception TypeError: Value NaN is outside the range [0, 65535].
-PASS crypto.webkitSubtle.generateKey({name: "aes-cbc", length: undefined}, extractable, ["encrypt", "decrypt"]) threw exception TypeError: Value NaN is outside the range [0, 65535].
-PASS crypto.webkitSubtle.generateKey({name: "aes-cbc", length: {}}, extractable, ["encrypt", "decrypt"]) threw exception TypeError: Value NaN is outside the range [0, 65535].
-Generating a key...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 128
-PASS key.usages is ['decrypt', 'encrypt']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test generating an AES key using AES-CBC algorithm.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-shouldThrow('crypto.webkitSubtle.generateKey("aes-cbc", extractable, ["encrypt", "decrypt"])');
-shouldThrow('crypto.webkitSubtle.generateKey({name: "aes-cbc"}, extractable, ["encrypt", "decrypt"])');
-shouldThrow('crypto.webkitSubtle.generateKey({name: "aes-cbc", length: undefined}, extractable, ["encrypt", "decrypt"])');
-shouldThrow('crypto.webkitSubtle.generateKey({name: "aes-cbc", length: {}}, extractable, ["encrypt", "decrypt"])');
-
-debug("Generating a key...");
-crypto.webkitSubtle.generateKey({name: "aes-cbc", length: 128}, extractable, ["encrypt", "decrypt"]).then(function(result) {
- key = result;
-
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "128");
- shouldBe("key.usages", "['decrypt', 'encrypt']");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 32: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test importing a JWK key for AES-CBC.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a key...
-
-PASS key.type is 'secret'
-PASS key.extractable is false
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 192
-PASS key.usages is ["encrypt"]
-
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test importing a JWK key for AES-CBC.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
-
-var jwkKey = {
- "kty": "oct",
- "alg": "A192CBC",
- "use": "enc",
- "ext": true,
- "k": "jnOw99oOZFLIEPMrgJB55WL46tJSLGt7"
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
-
-debug("Importing a key...\n");
-crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, null, false, ["encrypt"]).then(function(result) {
- key = result;
-
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "false");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "192");
- shouldBe("key.usages", '["encrypt"]');
-
- debug("\nUsing the key to encrypt plaintext...");
- return crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
-}).then(function(result) {
- encryptionResult = result;
- shouldBe("bytesToHexString(new Uint8Array(encryptionResult))", "'4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 22: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test an unsupported AES key length.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw AES key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 176
-PASS key.usages is ['decrypt', 'encrypt']
-Using the key to encrypt plaintext...
-Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test an unsupported AES key length.");
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array("8e73b0f7da0e6452c810f32b809079e562f8ead2522c");
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
-var extractable = true;
-
-debug("Importing a raw AES key from string literal...");
-crypto.webkitSubtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "176");
- shouldBe("key.usages", "['decrypt', 'encrypt']");
-
- debug("Using the key to encrypt plaintext...");
- return crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, [plaintext]);
-}).then(undefined, function(result) {
- debug("Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail.");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 23: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test unwrapping an RSA key with AES-CBC.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing an unwrapping key...
-PASS unwrappingKey.algorithm.name is 'AES-CBC'
-Unwrapping a key...
-PASS Promise rejected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test unwrapping an RSA key with AES-CBC.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var unwrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
-var wrappedKey = hexStringToUint8Array("b490dedb3abc3fd545e146538e6cc3ca"); // An empty encrypted JSON.
-
-debug("Importing an unwrapping key...");
-crypto.webkitSubtle.importKey("raw", unwrappingKeyOctets, "AES-CBC", nonExtractable, ["unwrapKey"]).then(function(result) {
- unwrappingKey = result;
- shouldBe("unwrappingKey.algorithm.name", "'AES-CBC'");
- var unwrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
- debug("Unwrapping a key...");
- return crypto.webkitSubtle.unwrapKey("jwk", wrappedKey, unwrappingKey, unwrapAlgorithm, null, extractable, ["sign", "verify", "encrypt", "decrypt", "wrap", "unwrap"]);
-}).then(undefined, function(result) {
- testPassed("Promise rejected");
- finishJSTest();
-});
-
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 32: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test unwrapping an RSA key with AES-CBC.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing an unwrapping key...
-PASS unwrappingKey.algorithm.name is 'AES-CBC'
-Unwrapping a key...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'public'
-PASS unwrappedKey.usages is ['sign','verify']
-PASS unwrappedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS unwrappedKey.algorithm.modulusLength is 2048
-PASS Base64URL.stringify(unwrappedKey.algorithm.publicExponent) is publicKeyJSON.e
-PASS unwrappedKey.algorithm.hash.name is 'SHA-256'
-PASS unwrappedKey.extractable is false
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test unwrapping an RSA key with AES-CBC.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- ext: false,
- use: "sig"
-};
-
-var unwrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
-var wrappedKey = hexStringToUint8Array("3511f6028db04ea97e7cfad3c4cc60837bceff25cb6c88292fbcb4547570afdc32e4003fe4d65f1e7df60dc1fdb3df36c3f58ab228e33aa31005852d46d0c2ad1318435a071bbb5bbb05650ea63d551698b0c040dd95ed0d379b5e2eccb545ae5620acb8051174cd2ad647328ad99dcd462fec40748724eb1e68f209f779faa2c35b4d4d1b6604a74e62a1846249ea6192954a5af10c71ebfea79948142441ed307e9f52e797a51a8007a6f87b57c51f9e7eef54b7e4a1f818ba6ac25ee5935c23b3253d6d9d222262c79ccdb7147d9c07527c22fe7a4ab91af20479edf5930b3c053c0a0b27092cfb53203633d01dcf6e333b5be7c1933c321c953f962b934ebefd9df8cca6c0a25fcd5fb96105435c42d9902406f82bc8daa8ec12fa85d9afa65adbfe3f60828ef64adaf43ad8e3b0af104cbfafd994323732bba08f84d5cac1d157b276233dffecafe47942b83c85ead6d5886c6badf534d4a32d3f545e8032dd5e419d7bff3acde2c37a96fc34fda8747d89500bf9f7ef45873c6b3b2741aaf74ff96a2f950028f38eb62f1be936fe0a994ebfa928021c0c96172d84584e");
-
-debug("Importing an unwrapping key...");
-crypto.webkitSubtle.importKey("raw", unwrappingKeyOctets, "AES-CBC", nonExtractable, ["unwrapKey"]).then(function(result) {
- unwrappingKey = result;
- shouldBe("unwrappingKey.algorithm.name", "'AES-CBC'");
- var unwrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
- debug("Unwrapping a key...");
- return crypto.webkitSubtle.unwrapKey("jwk", wrappedKey, unwrappingKey, unwrapAlgorithm, null, extractable, ["sign", "verify", "encrypt", "decrypt", "wrap", "unwrap"]);
-}).then(function(result) {
- unwrappedKey = result;
-
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'public'");
- shouldBe("unwrappedKey.usages", "['sign','verify']");
- shouldBe("unwrappedKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("unwrappedKey.algorithm.modulusLength", "2048");
- shouldBe("Base64URL.stringify(unwrappedKey.algorithm.publicExponent)", "publicKeyJSON.e");
- shouldBe("unwrappedKey.algorithm.hash.name", "'SHA-256'");
- shouldBe("unwrappedKey.extractable", "false");
- finishJSTest();
-});
-
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 32: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test wrapping an RSA key with AES-CBC.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a key to wrap...
-PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
-Importing a key encryption key...
-PASS wrappingKey.algorithm.name is 'AES-CBC'
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-CONSOLE MESSAGE: line 32: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test wrapping an RSA key with AES-CBC.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a key to wrap...
-PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
-Importing a key encryption key...
-PASS wrappingKey.algorithm.name is 'AES-CBC'
-wrapping the key...
-PASS Rejected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test wrapping an RSA key with AES-CBC.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- ext: false,
- use: "sig"
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
-var wrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
-
-debug("Importing a key to wrap...");
-crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, null, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
- shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- debug("Importing a key encryption key...");
- return crypto.webkitSubtle.importKey("raw", wrappingKeyOctets, "AES-CBC", nonExtractable, ["wrapKey"]);
-}).then(function(result) {
- wrappingKey = result;
- shouldBe("wrappingKey.algorithm.name", "'AES-CBC'");
- var wrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
- debug("wrapping the key...");
- return crypto.webkitSubtle.wrapKey("jwk", key, wrappingKey, wrapAlgorithm);
-}).then(undefined, function() {
- testPassed("Rejected");
- finishJSTest();
-});
-
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test wrapping an RSA key with AES-CBC.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- ext: true,
- use: "sig"
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
-var wrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
-
-debug("Importing a key to wrap...");
-crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, null, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
- shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- debug("Importing a key encryption key...");
- return crypto.webkitSubtle.importKey("raw", wrappingKeyOctets, "AES-CBC", nonExtractable, ["wrapKey"]);
-}).then(function(result) {
- wrappingKey = result;
- shouldBe("wrappingKey.algorithm.name", "'AES-CBC'");
- var wrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
- return crypto.webkitSubtle.wrapKey("jwk", key, wrappingKey, wrapAlgorithm);
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
- finishJSTest();
-});
-
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 22: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test calling AES-CBC encrypt with a HMAC key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw HMAC key from string literal...
-Using the key to encrypt plaintext...
-PASS crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext) threw exception NotSupportedError: The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test calling AES-CBC encrypt with a HMAC key.");
-
-jsTestIsAsync = true;
-
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
-var hmacKey = asciiToUint8Array('a');
-var extractable = true;
-
-debug("Importing a raw HMAC key from string literal...");
-crypto.webkitSubtle.importKey("raw", hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, ["sign", "verify", "encrypt", "decrypt"]).then(function(result) {
- key = result;
- debug("Using the key to encrypt plaintext...");
- shouldThrow('crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext)')
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 616: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test exporting an AES key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS crypto.webkitSubtle.exportKey("raw") threw exception TypeError: Not enough arguments.
-PASS crypto.webkitSubtle.exportKey("raw", null) threw exception TypeError: Type error.
-PASS crypto.webkitSubtle.exportKey("raw", undefined) threw exception TypeError: Type error.
-PASS crypto.webkitSubtle.exportKey("raw", {}) threw exception TypeError: Type error.
-PASS crypto.webkitSubtle.exportKey("raw", 1) threw exception TypeError: Type error.
-
-Importing a JWK key...
-PASS crypto.webkitSubtle.exportKey(null, key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey({}, key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey("", key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
-
-Exporting the key as raw data...
-PASS bytesToHexString(new Uint8Array(exportedData)) is '8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'
-Exporting the key as JWK...
-PASS exportedJWK.kty is 'oct'
-PASS exportedJWK.k is 'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7'
-PASS exportedJWK.alg is 'A192CBC'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
-
-Importing a key that's not extractable...
-
-Trying to export as raw...
-PASS Rejected, as expected
-Trying to export as jwk...
-PASS Rejected, as expected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test exporting an AES key.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var jwkKey = {
- kty: "oct",
- k: "jnOw99oOZFLIEPMrgJB55WL46tJSLGt7"
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
-
-shouldThrow('crypto.webkitSubtle.exportKey("raw")');
-shouldThrow('crypto.webkitSubtle.exportKey("raw", null)');
-shouldThrow('crypto.webkitSubtle.exportKey("raw", undefined)');
-shouldThrow('crypto.webkitSubtle.exportKey("raw", {})');
-shouldThrow('crypto.webkitSubtle.exportKey("raw", 1)');
-
-debug("\nImporting a JWK key...");
-crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, "AES-CBC", extractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']).then(function(result) {
- key = result;
-
- shouldThrow('crypto.webkitSubtle.exportKey(null, key)');
- shouldThrow('crypto.webkitSubtle.exportKey(undefined, key)');
- shouldThrow('crypto.webkitSubtle.exportKey({}, key)');
- shouldThrow('crypto.webkitSubtle.exportKey("", key)');
- shouldThrow('crypto.webkitSubtle.exportKey("foobar", key)');
-
- debug("\nExporting the key as raw data...");
- return crypto.webkitSubtle.exportKey("raw", key);
-}).then(function(result) {
- exportedData = result;
- shouldBe("bytesToHexString(new Uint8Array(exportedData))", "'8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'");
-
- debug("Exporting the key as JWK...");
- return crypto.webkitSubtle.exportKey("jwk", key);
-}).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
- shouldBe("exportedJWK.kty", "'oct'");
- shouldBe("exportedJWK.k", "'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7'");
- shouldBe("exportedJWK.alg", "'A192CBC'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.key_ops", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
-
- debug("\nImporting a key that's not extractable...");
- return crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, "AES-CBC", nonExtractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'])
-}).then(function(result) {
- key = result;
-
- debug("\nTrying to export as raw...");
- return crypto.webkitSubtle.exportKey("raw", key);
-}).then(function(result) {
- testFailed("Promise wasn't rejected");
- finishJSTest();
-}, function() {
- testPassed("Rejected, as expected");
-
- debug("Trying to export as jwk...");
- return crypto.webkitSubtle.exportKey("jwk", key);
-}).then(function(result) {
- testFailed("Promise wasn't rejected");
- finishJSTest();
-}, function() {
- testPassed("Rejected, as expected");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 19: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test generating, importing and exporting keys for AES-KW. Test that they can't be used with another algorithm.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Generating a key...
-PASS key.toString() is '[object CryptoKey]'
-PASS key.type is 'secret'
-PASS key.algorithm.name is 'AES-KW'
-PASS key.algorithm.length is 256
-
-Testing that the key can't be used with AES-CBC...
-PASS crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, hexStringToUint8Array("00")) threw exception NotSupportedError: The operation is not supported..
-
-Exporting the key to raw...
-PASS exportedKey.toString() is '[object ArrayBuffer]'
-Importing it back...
-PASS importedKey.toString() is '[object CryptoKey]'
-PASS importedKey.type is 'secret'
-PASS importedKey.algorithm.name is 'AES-KW'
-PASS importedKey.algorithm.length is 256
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test generating, importing and exporting keys for AES-KW. Test that they can't be used with another algorithm.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-debug("Generating a key...");
-crypto.webkitSubtle.generateKey({name: "aes-kw", length: 256}, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(result) {
- key = result;
- shouldBe("key.toString()", "'[object CryptoKey]'");
- shouldBe("key.type", "'secret'");
- shouldBe("key.algorithm.name", "'AES-KW'");
- shouldBe("key.algorithm.length", "256");
-
- debug("\nTesting that the key can't be used with AES-CBC...");
- iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
- shouldThrow('crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, hexStringToUint8Array("00"))');
-
- debug("\nExporting the key to raw...");
- return crypto.webkitSubtle.exportKey('raw', key);
-}).then(function(result) {
- exportedKey = result;
- shouldBe("exportedKey.toString()", "'[object ArrayBuffer]'");
- debug("Importing it back...");
- return crypto.webkitSubtle.importKey('raw', exportedKey, "aes-kw", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
-}).then(function(result) {
- importedKey = result;
-
- shouldBe("importedKey.toString()", "'[object CryptoKey]'");
- shouldBe("importedKey.type", "'secret'");
- shouldBe("importedKey.algorithm.name", "'AES-KW'");
- shouldBe("importedKey.algorithm.length", "256");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 21: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test wrapping and unwrapping keys with AES-KW.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing key encryption key...
-Importing a key to be wrapped...
-Wrapping it...
-PASS bytesToHexString(wrappedKey) is '1fa68b0a8112b447aef34bd8fb5a7b829d3e862371d2cfe5'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 128
-PASS unwrappedKey.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(keyData)
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test wrapping and unwrapping keys with AES-KW.");
-
-jsTestIsAsync = true;
-
-var kekData = hexStringToUint8Array("000102030405060708090A0B0C0D0E0F");
-var keyData = hexStringToUint8Array("00112233445566778899AABBCCDDEEFF");
-var extractable = true;
-
-debug("Importing key encryption key...");
-crypto.webkitSubtle.importKey("raw", kekData, "aes-kw", extractable, ["wrapKey", "unwrapKey"]).then(function(result) {
- kek = result;
-
- debug("Importing a key to be wrapped...");
- return crypto.webkitSubtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
-}).then(function(result) {
- key = result;
-
- debug("Wrapping it...");
- return crypto.webkitSubtle.wrapKey("raw", key, kek, "aes-kw");
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("bytesToHexString(wrappedKey)", "'1fa68b0a8112b447aef34bd8fb5a7b829d3e862371d2cfe5'"); // Result from RFC 3394.
-
- debug("Unwrapping it...");
- return crypto.webkitSubtle.unwrapKey("raw", wrappedKey, kek, "aes-kw", "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
-}).then(function(result) {
- unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'secret'");
- shouldBe("unwrappedKey.extractable", "true");
- shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
- shouldBe("unwrappedKey.algorithm.length", "128");
- shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']");
-
- debug("Exporting it...");
- return crypto.webkitSubtle.exportKey("raw", unwrappedKey);
-}).then(function(result) {
- unwrappedKeyData = result;
- shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(keyData)");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 26: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test sending crypto keys via postMessage.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 128
-PASS key.usages is ["decrypt", "encrypt"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<script>
-
-description("Test sending crypto keys via postMessage.");
-
-jsTestIsAsync = true;
-
-window.addEventListener("message", function(evt) {
- key = evt.data;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "128");
- shouldBe("key.usages", '["decrypt", "encrypt"]');
-
- finishJSTest();
-}, false);
-
-crypto.webkitSubtle.importKey("raw", asciiToUint8Array("16 bytes of key!"), {name: "aes-cbc", length: 128}, true, ["encrypt", "decrypt"]).then(function(key) {
- postMessage(key, "*");
-});
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 1: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test crypto.webkitSubtle argument conversion
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Passing algorithm name as a string object...
-PASS ...succeeded
-
-Passing algorithm name as a string object in a dictionary...
-PASS ...succeeded
-
-Passing algorithm name as an object with toString
-PASS ...succeeded
-
-Passing invalid data to digest()
-PASS crypto.webkitSubtle.digest({name: 'sha-1'}) threw exception TypeError: Not enough arguments.
-PASS crypto.webkitSubtle.digest({name: 'sha-1'}, null) threw exception TypeError: Type error.
-PASS crypto.webkitSubtle.digest({name: 'sha-1'}, 10) threw exception TypeError: Type error.
-PASS crypto.webkitSubtle.digest({name: 'sha-1'}, [10]) threw exception TypeError: Type error.
-PASS crypto.webkitSubtle.digest({name: 'sha-1'}, [new Uint8Array([0])]) threw exception TypeError: Type error.
-
-Passing invalid algorithmIdentifiers to digest()
-PASS crypto.webkitSubtle.digest({ toString:function() { return 'sha-1' } }, data) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.digest({name: ''}, data) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.digest({name: null}, data) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.digest({name: undefined}, data) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.digest({name: 'sha'}, data) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.digest({name: 1}, data) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.digest('', data) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.digest(null, data) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.digest(undefined, data) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.digest(1, data) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.digest({}, data) threw exception NotSupportedError: The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test crypto.webkitSubtle argument conversion");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- debug("\nPassing algorithm name as a string object...");
- return crypto.webkitSubtle.digest(new String('sha-1'), new Uint8Array([]));
-}).then(function(result) {
- testPassed("...succeeded");
- debug("\nPassing algorithm name as a string object in a dictionary...");
- return crypto.webkitSubtle.digest({name: new String('sha-1')}, new Uint8Array([]));
-}).then(function(result) {
- testPassed("...succeeded");
- debug("\nPassing algorithm name as an object with toString");
- return crypto.webkitSubtle.digest({name: { toString:function() { return 'sha-1' } } }, new Uint8Array([]));
-}).then(function(result) {
- testPassed("...succeeded");
-
- debug("\nPassing invalid data to digest()");
- shouldThrow("crypto.webkitSubtle.digest({name: 'sha-1'})");
- shouldThrow("crypto.webkitSubtle.digest({name: 'sha-1'}, null)");
- shouldThrow("crypto.webkitSubtle.digest({name: 'sha-1'}, 10)");
- shouldThrow("crypto.webkitSubtle.digest({name: 'sha-1'}, [10])");
- shouldThrow("crypto.webkitSubtle.digest({name: 'sha-1'}, [new Uint8Array([0])])");
-
- debug("\nPassing invalid algorithmIdentifiers to digest()");
- data = new Uint8Array([0]);
- shouldThrow("crypto.webkitSubtle.digest({ toString:function() { return 'sha-1' } }, data)"); // Algorithm normalization doesn't attempt to call toString.
- shouldThrow("crypto.webkitSubtle.digest({name: ''}, data)");
- shouldThrow("crypto.webkitSubtle.digest({name: null}, data)");
- shouldThrow("crypto.webkitSubtle.digest({name: undefined}, data)");
- shouldThrow("crypto.webkitSubtle.digest({name: 'sha'}, data)");
- shouldThrow("crypto.webkitSubtle.digest({name: 1}, data)");
- shouldThrow("crypto.webkitSubtle.digest('', data)");
- shouldThrow("crypto.webkitSubtle.digest(null, data)");
- shouldThrow("crypto.webkitSubtle.digest(undefined, data)");
- shouldThrow("crypto.webkitSubtle.digest(1, data)");
- shouldThrow("crypto.webkitSubtle.digest({}, data)");
-}).then(finishJSTest);
-
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 1: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test that an ArrayBufferView with offset is processed correctly.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS bytesToHexString(new Uint8Array(digest)) is '2c7e7c384f7829694282b1e3a6216def8082d055'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test that an ArrayBufferView with offset is processed correctly.");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- var originalData = new Uint8Array([0xf, 0xf, 0xf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0xf, 0xf, 0xf]);
- var slicedData = new Uint8Array(originalData.buffer, 3, 11);
- return crypto.webkitSubtle.digest({name: 'sha-1'}, slicedData);
-}).then(function(result) {
- digest = result;
- // Expected result for [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'2c7e7c384f7829694282b1e3a6216def8082d055'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-[Worker] Tests that crypto.webkitSubtle will throw in workers.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Starting worker: resources/disallowed-in-worker.js
-PASS [Worker] crypto.webkitSubtle threw exception NotSupportedError: The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
- <script src="../../resources/js-test-pre.js"></script>
-</head>
-<body>
- <script>
- worker = startWorker('resources/disallowed-in-worker.js');
- </script>
- <script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 19: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test that window.crypto.webkitSubtle wrapper preserves custom properties.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS [object Crypto] is defined.
-PASS [object WebKitSubtleCrypto] is defined.
-PASS anotherWindowCrypto.webkitSubtle.foo is "bar"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src="../../resources/js-test-pre.js"></script>
-</head>
-<body>
-<script>
-
-description("Test that window.crypto.webkitSubtle wrapper preserves custom properties.");
-jsTestIsAsync = true;
-
-var anotherWindowCrypto;
-
-function startTest()
-{
- anotherWindowCrypto = frames[0].crypto;
- shouldBeDefined(anotherWindowCrypto);
- shouldBeDefined(anotherWindowCrypto.webkitSubtle);
-
- anotherWindowCrypto.webkitSubtle.foo = "bar";
- document.body.removeChild(document.getElementsByTagName("iframe")[0]);
- gc();
- setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
- gc();
- setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
- gc();
- shouldBe('anotherWindowCrypto.webkitSubtle.foo', '"bar"');
- finishJSTest();
-}
-
-window.onload = startTest;
-
-</script>
-<iframe src="about:blank"></iframe>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-Test that window.crypto wrapper protects all dependencies, so it can always be used to create crypto.webkitSubtle.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS [object Crypto] is defined.
-PASS [object WebKitSubtleCrypto] is defined.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src="../../resources/js-test-pre.js"></script>
-</head>
-<body>
-<script>
-
-description("Test that window.crypto wrapper protects all dependencies, so it can always be used to create crypto.webkitSubtle.");
-jsTestIsAsync = true;
-
-var anotherWindowCrypto;
-
-function startTest()
-{
- anotherWindowCrypto = frames[0].crypto;
- shouldBeDefined(anotherWindowCrypto);
- document.body.removeChild(document.getElementsByTagName("iframe")[0]);
- gc();
- setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
- gc();
- setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
- gc();
- shouldBeDefined(anotherWindowCrypto.webkitSubtle);
- finishJSTest();
-}
-
-window.onload = startTest;
-
-</script>
-<iframe src="about:blank"></iframe>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 15: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test that window.crypto.webkitSubtle wrapper preserves custom properties.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS window.crypto.webkitSubtle.foo is "bar"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src="../../resources/js-test-pre.js"></script>
-</head>
-<body>
-<script>
-
-description("Test that window.crypto.webkitSubtle wrapper preserves custom properties.");
-jsTestIsAsync = true;
-
-function startTest()
-{
- window.crypto.webkitSubtle.foo = "bar";
- gc();
- setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
- gc();
- setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
- gc();
- shouldBe('window.crypto.webkitSubtle.foo', '"bar"');
- finishJSTest();
-}
-
-window.onload = startTest;
-
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 20: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test that HMAC operations only work when hash functions match between invocation and key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw HMAC SHA-1 key from string literal...
-Done
-PASS crypto.webkitSubtle.sign({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('foo')) did not throw exception.
-PASS crypto.webkitSubtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('foo')) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.verify({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo')) did not throw exception.
-PASS crypto.webkitSubtle.verify({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo')) threw exception NotSupportedError: The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test that HMAC operations only work when hash functions match between invocation and key.");
-
-jsTestIsAsync = true;
-
-var hmacKey = asciiToUint8Array('a');
-var extractable = true;
-
-debug("Importing a raw HMAC SHA-1 key from string literal...");
-crypto.webkitSubtle.importKey("raw", hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, ["sign", "verify"]).then(function(result) {
- debug("Done");
- key = result;
-
- shouldNotThrow("crypto.webkitSubtle.sign({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('foo'))");
- shouldThrow("crypto.webkitSubtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('foo'))");
-
- shouldNotThrow("crypto.webkitSubtle.verify({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo'))");
- shouldThrow("crypto.webkitSubtle.verify({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo'))");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 27: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test exporting an AES key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a JWK key...
-PASS crypto.webkitSubtle.exportKey(null, key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey({}, key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey("", key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
-Exporting the key as raw data...
-PASS bytesToHexString(new Uint8Array(exportedData)) is '6a18e49feff7f3b7e09ec89b7f6deab2f6a18e49feff7f3b7e09ec89b7f6deab'
-Exporting the key as JWK...
-PASS exportedJWK.kty is 'oct'
-PASS exportedJWK.k is 'ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs'
-PASS exportedJWK.alg is 'HS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['sign', 'verify']
-
-Importing a key that's not extractable...
-
-Trying to export as raw...
-PASS Rejected, as expected
-Trying to export as jwk...
-PASS Rejected, as expected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test exporting an AES key.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var jwkKey = {
- "kty": "oct",
- "k": "ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs"
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
-
-debug("Importing a JWK key...");
-crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, { name: "HMAC", hash: "SHA-256" }, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
-
- shouldThrow('crypto.webkitSubtle.exportKey(null, key)');
- shouldThrow('crypto.webkitSubtle.exportKey(undefined, key)');
- shouldThrow('crypto.webkitSubtle.exportKey({}, key)');
- shouldThrow('crypto.webkitSubtle.exportKey("", key)');
- shouldThrow('crypto.webkitSubtle.exportKey("foobar", key)');
-
- debug("Exporting the key as raw data...");
- return crypto.webkitSubtle.exportKey("raw", key);
-}).then(function(result) {
- exportedData = result;
- shouldBe("bytesToHexString(new Uint8Array(exportedData))", "'6a18e49feff7f3b7e09ec89b7f6deab2f6a18e49feff7f3b7e09ec89b7f6deab'");
-
- debug("Exporting the key as JWK...");
- return crypto.webkitSubtle.exportKey("jwk", key);
-}).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
- shouldBe("exportedJWK.kty", "'oct'");
- shouldBe("exportedJWK.k", "'ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs'");
- shouldBe("exportedJWK.alg", "'HS256'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
-
- debug("\nImporting a key that's not extractable...");
- return crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, { name: "HMAC", hash: "SHA-256" }, nonExtractable, ["sign", "verify"]);
-}).then(function(result) {
- key = result;
-
- debug("\nTrying to export as raw...");
- return crypto.webkitSubtle.exportKey("raw", key);
-}).then(function(result) {
- testFailed("Promise wasn't rejected");
- finishJSTest();
-}, function() {
- testPassed("Rejected, as expected");
-
- debug("Trying to export as jwk...");
- return crypto.webkitSubtle.exportKey("jwk", key);
-}).then(function(result) {
- testFailed("Promise wasn't rejected");
- finishJSTest();
-}, function() {
- testPassed("Rejected, as expected");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 616: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test generating a HMAC key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS crypto.webkitSubtle.generateKey("hmac", extractable, ["sign", "verify"]) threw exception TypeError: Type error.
-PASS crypto.webkitSubtle.generateKey({name: "hmac"}, extractable, ["sign", "verify"]) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.generateKey({name: "hmac", length: undefined}, extractable, ["sign", "verify"]) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.generateKey({name: "hmac", length: {}}, extractable, ["sign", "verify"]) threw exception NotSupportedError: The operation is not supported..
-
-Generating a key with default length...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 512
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is ["sign", "verify"]
-
-Generating a key with custom length...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 8
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is ["sign"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test generating a HMAC key.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-shouldThrow('crypto.webkitSubtle.generateKey("hmac", extractable, ["sign", "verify"])');
-shouldThrow('crypto.webkitSubtle.generateKey({name: "hmac"}, extractable, ["sign", "verify"])');
-shouldThrow('crypto.webkitSubtle.generateKey({name: "hmac", length: undefined}, extractable, ["sign", "verify"])');
-shouldThrow('crypto.webkitSubtle.generateKey({name: "hmac", length: {}}, extractable, ["sign", "verify"])');
-
-debug("\nGenerating a key with default length...");
-crypto.webkitSubtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
-
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "512");
- shouldBe("key.algorithm.hash.name", "'SHA-1'");
- shouldBe("key.usages", '["sign", "verify"]');
-
- debug("\nGenerating a key with custom length...");
- return crypto.webkitSubtle.generateKey({name: "hmac", hash: "sha-1", length: 8}, extractable, ["sign"]);
-}).then(function(result) {
- key = result;
-
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "8");
- shouldBe("key.algorithm.hash.name", "'SHA-1'");
- shouldBe("key.usages", '["sign"]');
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 29: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test importing a JWK key for HMAC.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a key...
-
-PASS key.type is 'secret'
-PASS key.extractable is false
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 256
-PASS key.usages is ["sign", "verify"]
-
-Using the key to sign message 'foo'...
-PASS bytesToHexString(new Uint8Array(signature)) is 'e03736fe098892b2a2da77812431f7c014d32e2fd69f3bcff883ac923a8fa2da'
-
-Verifying the signature...
-PASS verificationResult is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test importing a JWK key for HMAC.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var hmacKey = {
- "kty": "oct",
- "alg": "HS256",
- "use": "sig",
- "ext": false,
- "k": "ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs"
-};
-
-var hmacKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(hmacKey));
-
-debug("Importing a key...\n");
-crypto.webkitSubtle.importKey("jwk", hmacKeyAsArrayBuffer, null, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
-
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "false");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "256");
- shouldBe("key.usages", '["sign", "verify"]');
-
- debug("\nUsing the key to sign message 'foo'...");
- return crypto.webkitSubtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
-}).then(function(result) {
- signature = result;
- shouldBe("bytesToHexString(new Uint8Array(signature))", "'e03736fe098892b2a2da77812431f7c014d32e2fd69f3bcff883ac923a8fa2da'");
-
- debug("\nVerifying the signature...");
- return crypto.webkitSubtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
-}).then(function(result) {
- verificationResult = result;
- shouldBe("verificationResult", "true");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 26: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test sending crypto keys via postMessage.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 128
-PASS key.usages is ["sign", "verify"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<script>
-
-description("Test sending crypto keys via postMessage.");
-
-jsTestIsAsync = true;
-
-window.addEventListener("message", function(evt) {
- key = evt.data;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "128");
- shouldBe("key.usages", '["sign", "verify"]');
-
- finishJSTest();
-}, false);
-
-crypto.webkitSubtle.importKey("raw", asciiToUint8Array("16 bytes of key!"), {name: 'hmac', hash: {name: 'sha-1'}}, true, ['sign', 'verify']).then(function(key) {
- postMessage(key, "*");
-});
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 20: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test HMAC sign and verify functions with an empty key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw HMAC key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 0
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is ['sign', 'verify']
-Using the key to sign 'foo'...
-PASS bytesToHexString(new Uint8Array(signature)) is 'a3cc770fc033e2cb419d42b64e0081a3bd3be30e'
-Verifying the signature...
-PASS verificationResult is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test HMAC sign and verify functions with an empty key.");
-
-jsTestIsAsync = true;
-
-var hmacKey = asciiToUint8Array('');
-var extractable = true;
-
-debug("Importing a raw HMAC key from string literal...");
-crypto.webkitSubtle.importKey("raw", hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "0"); // See <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098>.
- shouldBe("key.algorithm.hash.name", "'SHA-1'");
- shouldBe("key.usages", "['sign', 'verify']");
-
- debug("Using the key to sign 'foo'...");
- return crypto.webkitSubtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
-}).then(function(result) {
- signature = result;
- shouldBe("bytesToHexString(new Uint8Array(signature))", "'a3cc770fc033e2cb419d42b64e0081a3bd3be30e'");
-
- debug("Verifying the signature...");
- return crypto.webkitSubtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
-}).then(function(result) {
- verificationResult = result;
- shouldBe("verificationResult", "true");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 20: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test HMAC sign and verify functions.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw HMAC key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 8
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is ['sign', 'verify']
-Using the key to sign 'foo'...
-PASS bytesToHexString(new Uint8Array(signature)) is 'bebbc02e46b0f81183f40c25dce23e5045d65519'
-Verifying the signature...
-PASS verificationResult is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test HMAC sign and verify functions.");
-
-jsTestIsAsync = true;
-
-var hmacKey = asciiToUint8Array('a');
-var extractable = true;
-
-debug("Importing a raw HMAC key from string literal...");
-crypto.webkitSubtle.importKey("raw", hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "8"); // See <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098>.
- shouldBe("key.algorithm.hash.name", "'SHA-1'");
- shouldBe("key.usages", "['sign', 'verify']");
-
- debug("Using the key to sign 'foo'...");
- return crypto.webkitSubtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
-}).then(function(result) {
- signature = result;
- shouldBe("bytesToHexString(new Uint8Array(signature))", "'bebbc02e46b0f81183f40c25dce23e5045d65519'");
-
- debug("Verifying the signature...");
- return crypto.webkitSubtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
-}).then(function(result) {
- verificationResult = result;
- shouldBe("verificationResult", "true");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 44: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Sending Worker Message
-Worker Terminated
-PASS exportedKey.byteLength is 0
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
- <script src="../../resources/js-test-pre.js"></script>
- <script type="text/javascript">
- jsTestIsAsync = true;
-
- var keySize = 0x100;
- var blob = new Blob([""], {type : 'application/javascript'});
- var worker = new Worker(URL.createObjectURL(blob));
-
- function run()
- {
- if (window.testRunner)
- testRunner.dumpAsText();
-
- function arrayBufferNeuter(ab)
- {
- /* Neuter the ArrayBuffer */
- debug("Sending Worker Message");
- worker.postMessage(ab, [ab]);
- worker.terminate();
- debug("Worker Terminated");
- }
-
- var a = new ArrayBuffer(keySize);
- var b = { };
- b.__defineGetter__('name', function(){
- arrayBufferNeuter(a);
- return "AES-CBC";
- });
- var result = window.crypto.webkitSubtle.importKey("raw", a, b, true);
- result.then(function(key) {
- window.crypto.webkitSubtle.exportKey("raw", key).then(function(result) {
- exportedKey = result;
- shouldBeZero("exportedKey.byteLength");
- finishJSTest();
- });
- });
- }
- </script>
- <script src="../../resources/js-test-post.js"></script>
-</head>
-<body onload="run()"></body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 616: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test error handling for JWK import.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(''), null) threw exception TypeError: Invalid JWK serialization.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{'), null) threw exception TypeError: Invalid JWK serialization.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('null'), null) threw exception TypeError: Invalid JWK serialization.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('undefined'), null) threw exception TypeError: Invalid JWK serialization.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{}'), null) threw exception TypeError: Neither key nor function argument has crypto algorithm specified.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{}'), "aes-cbc") threw exception TypeError: Required JWK "kty" member is missing.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "foobar", "alg": "HS256", "use": "sig", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Unsupported JWK key type foobar.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "foobar", "use": "sig", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Unsupported JWK algorithm foobar.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), "aes-cbc") threw exception TypeError: Algorithm specified in key is not compatible with one passed to importKey as argument.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), { name: "hmac", hash: "sha-1" }) threw exception TypeError: Algorithm specified in key is not compatible with one passed to importKey as argument.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256" }'), null) threw exception TypeError: Secret key data is not present is JWK.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "A128CBC" }'), null) threw exception TypeError: Secret key data is not present is JWK.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "1234" }'), null) threw exception TypeError: Key size is not valid for HS256.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "A128CBC", "use": "sig", "ext": false, "k": "1234" }'), null) threw exception TypeError: Key size is not valid for A128CBC.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "A128CBC", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Key size is not valid for A128CBC.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387f+nsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Cannot decode base64url key data in JWK.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": 1, "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Expected a string value for "kty" JSON key.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": 1, "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Expected a string value for "alg" JSON key.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": 1, "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Expected a string value for "use" JSON key.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": "false", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Expected a boolean value for "ext" JSON key.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": 1 }'), null) threw exception TypeError: Expected a string value for "k" JSON key.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test error handling for JWK import.");
-
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'null\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'undefined\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{}\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{}\'), "aes-cbc")')
-
-// Unknown/invalid JWK values.
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "foobar", "alg": "HS256", "use": "sig", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "foobar", "use": "sig", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-
-// Algorithm mismatch.
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), "aes-cbc")')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), { name: "hmac", hash: "sha-1" })')
-
-// No key data.
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256" }\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "A128CBC" }\'), null)')
-
-// Key data length is incorrect, not allowed in JWK.
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "1234" }\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "A128CBC", "use": "sig", "ext": false, "k": "1234" }\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "A128CBC", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-
-// Key data is not valid base64url.
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387f+nsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-
-// Incorrect data types.
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": 1, "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": 1, "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": 1, "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": "false", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": 1 }\'), null)')
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 48: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test exporting keys with various usages to JWK.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-encrypt:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["encrypt"]
-
-decrypt:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["decrypt"]
-
-encrypt,decrypt:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["encrypt","decrypt"]
-
-wrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["wrapKey"]
-
-unwrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["unwrapKey"]
-
-wrapKey,unwrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["wrapKey","unwrapKey"]
-
-encrypt,decrypt,wrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["encrypt","decrypt","wrapKey"]
-
-encrypt,decrypt,wrapKey,unwrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["encrypt","decrypt","wrapKey","unwrapKey"]
-
-sign:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["sign"]
-
-verify:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["verify"]
-
-sign,verify:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["sign","verify"]
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test exporting keys with various usages to JWK.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var aesKeyAsArrayBuffer = Base64URL.parse("jnOw99oOZFLIEPMrgJB55WL46tJSLGt7");
-var hmacKeyAsArrayBuffer = Base64URL.parse("ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs");
-
-function testWithAESCBC(usages, expectedKeyOps)
-{
- return crypto.webkitSubtle.importKey("raw", aesKeyAsArrayBuffer, "AES-CBC", extractable, usages).then(function(result) {
- return crypto.webkitSubtle.exportKey("jwk", result);
- }).then(function(result) {
- jwk = JSON.parse(bytesToASCIIString(result));
- debug(usages + ":");
- shouldBe("jwk.use", "undefined");
- shouldBe("jwk.key_ops", JSON.stringify(expectedKeyOps));
- debug("");
- });
-}
-
-function testWithHMAC(usages, expectedKeyOps)
-{
- return crypto.webkitSubtle.importKey("raw", hmacKeyAsArrayBuffer, {name: 'hmac', hash: {name: 'sha-256'}}, extractable, usages).then(function(result) {
- return crypto.webkitSubtle.exportKey("jwk", result);
- }).then(function(result) {
- jwk = JSON.parse(bytesToASCIIString(result));
- debug(usages + ":");
- shouldBe("jwk.use", "undefined");
- shouldBe("jwk.key_ops", JSON.stringify(expectedKeyOps));
- debug("");
- });
-}
-
-Promise.all([
- testWithAESCBC(["encrypt"], ["encrypt"]),
- testWithAESCBC(["decrypt"], ["decrypt"]),
- testWithAESCBC(["encrypt", "decrypt"], ["encrypt", "decrypt"]),
- testWithAESCBC(["wrapKey"], ["wrapKey"]),
- testWithAESCBC(["unwrapKey"], ["unwrapKey"]),
- testWithAESCBC(["wrapKey", "unwrapKey"], ["wrapKey", "unwrapKey"]),
- testWithAESCBC(["encrypt", "decrypt", "wrapKey"], ["encrypt", "decrypt", "wrapKey"]),
- testWithAESCBC(["encrypt", "decrypt", "wrapKey", "unwrapKey"], ["encrypt", "decrypt", "wrapKey", "unwrapKey"]),
- testWithHMAC(["sign"], ["sign"]),
- testWithHMAC(["verify"], ["verify"]),
- testWithHMAC(["sign", "verify"], ["sign", "verify"]),
-]).then(function() { finishJSTest(); } );
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 1: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test importing keys with various uses from JWK.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS testWithAESCBC(["encrypt"], {key_ops: ["encrypt", "encrypt"]}) threw exception TypeError: JWK key_ops contains a duplicate operation.
-
-{"key_ops":["encrypt"]}:
-PASS key.usages is ["encrypt"]
-
-{"key_ops":["decrypt"]}:
-PASS key.usages is ["decrypt"]
-
-{"key_ops":["encrypt","decrypt"]}:
-PASS key.usages is ["decrypt","encrypt"]
-
-{"key_ops":["wrapKey"]}:
-PASS key.usages is ["wrapKey"]
-
-{"key_ops":["unwrapKey"]}:
-PASS key.usages is ["unwrapKey"]
-
-{"key_ops":["wrapKey","unwrapKey"]}:
-PASS key.usages is ["unwrapKey","wrapKey"]
-
-{"key_ops":["encrypt","decrypt","wrapKey"]}:
-PASS key.usages is ["decrypt","encrypt","wrapKey"]
-
-{"use":"enc"}:
-PASS key.usages is ["decrypt","encrypt","unwrapKey","wrapKey"]
-
-{"key_ops":["sign"]}:
-PASS key.usages is ["sign"]
-
-{"key_ops":["verify"]}:
-PASS key.usages is ["verify"]
-
-{"use":"sig"}:
-PASS key.usages is ["sign","verify"]
-
-{"key_ops":["'encrypt'"]}:
-PASS key.usages is []
-
-{"key_ops":["encrypt "]}:
-PASS key.usages is []
-
-{"key_ops":["Encrypt"]}:
-PASS key.usages is []
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test importing keys with various uses from JWK.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var aesKeyAsJSON = {
- "alg": "A192CBC",
- "ext": true,
- "kty": "oct",
- "k": "jnOw99oOZFLIEPMrgJB55WL46tJSLGt7"
-};
-
-var hmacKeyAsJSON = {
- "alg": "HS256",
- "ext": true,
- "kty": "oct",
- "k": "ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs"
-};
-
-function testWithAESCBC(expectedUsages, jwkUsages)
-{
- if (jwkUsages.key_ops) {
- aesKeyAsJSON.key_ops = jwkUsages.key_ops;
- delete aesKeyAsJSON.use;
- } else {
- delete aesKeyAsJSON.key_ops;
- aesKeyAsJSON.use = jwkUsages.use;
- }
-
- return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(aesKeyAsJSON)), "AES-CBC", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(result) {
- key = result;
- debug(JSON.stringify(jwkUsages) + ":");
- shouldBe("key.usages", JSON.stringify(expectedUsages));
- debug("");
- });
-}
-
-function testWithHMAC(expectedUsages, jwkUsages)
-{
- if (jwkUsages.key_ops) {
- hmacKeyAsJSON.key_ops = jwkUsages.key_ops;
- delete hmacKeyAsJSON.use;
- } else {
- delete hmacKeyAsJSON.key_ops;
- hmacKeyAsJSON.use = jwkUsages.use;
- }
-
- return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(hmacKeyAsJSON)), {name: 'hmac', hash: {name: 'sha-256'}}, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
- debug(JSON.stringify(jwkUsages) + ":");
- shouldBe("key.usages", JSON.stringify(expectedUsages));
- debug("");
- });
-}
-
-// Duplicates are not allowed. We currently raise an exception, although we should reject the promise instead.
-shouldThrow('testWithAESCBC(["encrypt"], {key_ops: ["encrypt", "encrypt"]})');
-debug("");
-
-Promise.all([
- testWithAESCBC(["encrypt"], {key_ops: ["encrypt"]}),
- testWithAESCBC(["decrypt"], {key_ops: ["decrypt"]}),
- testWithAESCBC(["decrypt", "encrypt"], {key_ops: ["encrypt", "decrypt"]}),
- testWithAESCBC(["wrapKey"], {key_ops: ["wrapKey"]}),
- testWithAESCBC(["unwrapKey"], {key_ops: ["unwrapKey"]}),
- testWithAESCBC(["unwrapKey", "wrapKey"], {key_ops: ["wrapKey", "unwrapKey"]}),
- testWithAESCBC(["decrypt", "encrypt", "wrapKey"], {key_ops: ["encrypt", "decrypt", "wrapKey"]}),
- testWithAESCBC(["decrypt", "encrypt", "unwrapKey", "wrapKey"], {use: "enc"}),
- testWithHMAC(["sign"], {key_ops: ["sign"]}),
- testWithHMAC(["verify"], {key_ops: ["verify"]}),
- testWithHMAC(["sign", "verify"], {use: "sig"}),
-
-// Unknown key_ops strings are ignored.
- testWithAESCBC([], {key_ops: ["'encrypt'"]}),
- testWithAESCBC([], {key_ops: ["encrypt "]}),
- testWithAESCBC([], {key_ops: ["Encrypt"]}),
-
-]).then(function() { finishJSTest(); } );
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-importScripts('../../../resources/js-test-pre.js');
-
-description("Tests that crypto.webkitSubtle will throw in workers.");
-
-shouldThrowErrorName("crypto.webkitSubtle", "NotSupportedError");
-
-finishJSTest();
+++ /dev/null
-description("Test storing a private RSA key in IndexedDB, and retrieving it.");
-
-jsTestIsAsync = true;
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- d: "eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ",
- p: "4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0",
- q: "xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc",
- dp: "fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk",
- dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE",
- qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk"
-};
-
-crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, false, ["sign", "verify"]).then(function(key) {
- var openRequest = indexedDB.open("crypto_webkitSubtle");
- openRequest.onupgradeneeded = function(event) {
- var objectStore = event.target.result.createObjectStore("rsa-indexeddb");
- }
- openRequest.onerror = function(event) {
- testFailed("Could not open database: " + event.target.error.name);
- finishJSTest();
- }
- openRequest.onsuccess = function(event) {
- db = event.target.result;
- storeKey();
- }
-
- function storeKey() {
- var objectStore = db.transaction("rsa-indexeddb", "readwrite").objectStore("rsa-indexeddb");
- var req = objectStore.put(key, "mykey");
- req.onerror = function(event) {
- testFailed("Could not put a key into database: " + event.target.error.name);
- finishJSTest();
- }
- req.onsuccess = function(event) { readKey(); }
- }
-
- function readKey() {
- var objectStore = db.transaction("rsa-indexeddb").objectStore("rsa-indexeddb");
- var req = objectStore.get("mykey");
- req.onerror = function(event) {
- testFailed("Could not get a key from database: " + event.target.error.name);
- finishJSTest();
- }
- req.onsuccess = function(event) {
- window.retrievedKey = event.target.result;
- shouldBe("retrievedKey.type", "'private'");
- shouldBe("retrievedKey.extractable", "false");
- shouldBe("retrievedKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("retrievedKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(retrievedKey.algorithm.publicExponent)", "'010001'");
- shouldBe("retrievedKey.usages", '["sign", "verify"]');
-
- finishJSTest();
- }
- }
-});
+++ /dev/null
-description("Test storing a private RSA key in IndexedDB, and retrieving it.");
-
-jsTestIsAsync = true;
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- d: "eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ",
- p: "4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0",
- q: "xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc",
- dp: "fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk",
- dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE",
- qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk"
-};
-
-crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, true, ["sign", "verify"]).then(function(key) {
- var openRequest = indexedDB.open("crypto_webkitSubtle");
- openRequest.onupgradeneeded = function(event) {
- var objectStore = event.target.result.createObjectStore("rsa-indexeddb");
- }
- openRequest.onerror = function(event) {
- testFailed("Could not open database: " + event.target.error.name);
- finishJSTest();
- }
- openRequest.onsuccess = function(event) {
- db = event.target.result;
- storeKey();
- }
-
- function storeKey() {
- var objectStore = db.transaction("rsa-indexeddb", "readwrite").objectStore("rsa-indexeddb");
- var req = objectStore.put(key, "mykey");
- req.onerror = function(event) {
- testFailed("Could not put a key into database: " + event.target.error.name);
- finishJSTest();
- }
- req.onsuccess = function(event) { readKey(); }
- }
-
- function readKey() {
- var objectStore = db.transaction("rsa-indexeddb").objectStore("rsa-indexeddb");
- var req = objectStore.get("mykey");
- req.onerror = function(event) {
- testFailed("Could not get a key from database: " + event.target.error.name);
- finishJSTest();
- }
- req.onsuccess = function(event) {
- window.retrievedKey = event.target.result;
- shouldBe("retrievedKey.type", "'private'");
- shouldBe("retrievedKey.extractable", "true");
- shouldBe("retrievedKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("retrievedKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(retrievedKey.algorithm.publicExponent)", "'010001'");
- shouldBe("retrievedKey.usages", '["sign", "verify"]');
-
- finishJSTest();
- }
- }
-});
+++ /dev/null
-CONSOLE MESSAGE: line 26: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test exporting a generated RSA keypair with hash.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Generating RSA-PKCS1-v1.5 keyPair...
-PASS crypto.webkitSubtle.exportKey(null, key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey({}, key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey("", key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
-PASS key.publicKey.algorithm.hash.name is defined.
-PASS key.privateKey.algorithm.hash.name is defined.
-
-Exporting public key as JWK...
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.alg is 'RS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['sign', 'verify']
-
-Exporting private key as JWK...
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.alg is 'RS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['sign', 'verify']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test exporting a generated RSA keypair with hash.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var algorithm = {
- name: "RSASSA-PKCS1-v1_5",
- modulusLength: "2048",
- publicExponent: new Uint8Array([1, 0, 1]), // 2^16 + 1 (65537)
- hash: { name: "SHA-256" }
-};
-
-debug("\nGenerating RSA-PKCS1-v1.5 keyPair...");
-crypto.webkitSubtle.generateKey(algorithm, extractable, ['sign', 'verify'])
-.then(function(result) {
- key = result;
-
- shouldThrow('crypto.webkitSubtle.exportKey(null, key)');
- shouldThrow('crypto.webkitSubtle.exportKey(undefined, key)');
- shouldThrow('crypto.webkitSubtle.exportKey({}, key)');
- shouldThrow('crypto.webkitSubtle.exportKey("", key)');
- shouldThrow('crypto.webkitSubtle.exportKey("foobar", key)');
- shouldBeDefined('key.publicKey.algorithm.hash.name');
- shouldBeDefined('key.privateKey.algorithm.hash.name');
-
- debug("\nExporting public key as JWK...");
- return crypto.webkitSubtle.exportKey("jwk", key.publicKey);
-}).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
-
- shouldBe("exportedJWK.kty", "'RSA'");
- shouldBe("exportedJWK.alg", "'RS256'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
-
- debug("\nExporting private key as JWK...");
- return crypto.webkitSubtle.exportKey("jwk", key.privateKey);
-}).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
-
- shouldBe("exportedJWK.kty", "'RSA'");
- shouldBe("exportedJWK.alg", "'RS256'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 29: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test exporting an RSA key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Importing a JWK key...
-PASS crypto.webkitSubtle.exportKey(null, key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey({}, key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey("", key) threw exception TypeError: Unknown key format.
-PASS crypto.webkitSubtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
-
-Exporting the key as JWK...
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.n is publicKeyJSON.n
-PASS exportedJWK.e is publicKeyJSON.e
-PASS exportedJWK.alg is 'RS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['sign', 'verify']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test exporting an RSA key.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB"
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
-
-debug("\nImporting a JWK key...");
-crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, "RSASSA-PKCS1-v1_5", extractable, ['sign', 'verify']).then(function(result) {
- key = result;
-
- shouldThrow('crypto.webkitSubtle.exportKey(null, key)');
- shouldThrow('crypto.webkitSubtle.exportKey(undefined, key)');
- shouldThrow('crypto.webkitSubtle.exportKey({}, key)');
- shouldThrow('crypto.webkitSubtle.exportKey("", key)');
- shouldThrow('crypto.webkitSubtle.exportKey("foobar", key)');
-
- debug("\nExporting the key as JWK...");
- return crypto.webkitSubtle.exportKey("jwk", key);
-}).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
-
- shouldBe("exportedJWK.kty", "'RSA'");
- shouldBe("exportedJWK.n", "publicKeyJSON.n");
- shouldBe("exportedJWK.e", "publicKeyJSON.e");
- shouldBe("exportedJWK.alg", "'RS256'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 36: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test exporting a private RSA key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Importing a JWK key...
-
-Exporting the key as JWK...
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.n is privateKeyJSON.n
-PASS exportedJWK.e is privateKeyJSON.e
-PASS exportedJWK.d is privateKeyJSON.d
-PASS exportedJWK.p is privateKeyJSON.p
-PASS exportedJWK.q is privateKeyJSON.q
-PASS exportedJWK.dp is privateKeyJSON.dp
-PASS exportedJWK.dq is privateKeyJSON.dq
-PASS exportedJWK.qi is privateKeyJSON.qi
-PASS exportedJWK.oth is privateKeyJSON.oth
-PASS exportedJWK.alg is privateKeyJSON.alg
-PASS exportedJWK.ext is true
-PASS exportedJWK.key_ops is ['sign', 'verify']
-PASS exportedJWK.use is undefined
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test exporting a private RSA key.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-// Example from JWK specification.
-var privateKeyJSON = {
- "kty":"RSA",
- "n":"0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",
- "e":"AQAB",
- "d":"X4cTteJY_gn4FYPsXB8rdXix5vwsg1FLN5E3EaG6RJoVH-HLLKD9M7dx5oo7GURknchnrRweUkC7hT5fJLM0WbFAKNLWY2vv7B6NqXSzUvxT0_YSfqijwp3RTzlBaCxWp4doFk5N2o8Gy_nHNKroADIkJ46pRUohsXywbReAdYaMwFs9tv8d_cPVY3i07a3t8MN6TNwm0dSawm9v47UiCl3Sk5ZiG7xojPLu4sbg1U2jx4IBTNBznbJSzFHK66jT8bgkuqsk0GjskDJk19Z4qwjwbsnn4j2WBii3RL-Us2lGVkY8fkFzme1z0HbIkfz0Y6mqnOYtqc0X4jfcKoAC8Q",
- "p":"83i-7IvMGXoMXCskv73TKr8637FiO7Z27zv8oj6pbWUQyLPQBQxtPVnwD20R-60eTDmD2ujnMt5PoqMrm8RfmNhVWDtjjMmCMjOpSXicFHj7XOuVIYQyqVWlWEh6dN36GVZYk93N8Bc9vY41xy8B9RzzOGVQzXvNEvn7O0nVbfs",
- "q":"3dfOR9cuYq-0S-mkFLzgItgMEfFzB2q3hWehMuG0oCuqnb3vobLyumqjVZQO1dIrdwgTnCdpYzBcOfW5r370AFXjiWft_NGEiovonizhKpo9VVS78TzFgxkIdrecRezsZ-1kYd_s1qDbxtkDEgfAITAG9LUnADun4vIcb6yelxk",
- "dp":"G4sPXkc6Ya9y8oJW9_ILj4xuppu0lzi_H7VTkS8xj5SdX3coE0oimYwxIi2emTAue0UOa5dpgFGyBJ4c8tQ2VF402XRugKDTP8akYhFo5tAA77Qe_NmtuYZc3C3m3I24G2GvR5sSDxUyAN2zq8Lfn9EUms6rY3Ob8YeiKkTiBj0",
- "dq":"s9lAH9fggBsoFR8Oac2R_E2gw282rT2kGOAhvIllETE1efrA6huUUvMfBcMpn8lqeW6vzznYY5SSQF7pMdC_agI3nG8Ibp1BUb0JUiraRNqUfLhcQb_d9GF4Dh7e74WbRsobRonujTYN1xCaP6TO61jvWrX-L18txXw494Q_cgk",
- "qi":"GyM_p6JrXySiz1toFgKbWV-JdI3jQ4ypu9rbMWx3rQJBfmt0FoYzgUIZEVFEcOqwemRN81zoDAaa-Bk0KWNGDjJHZDdDmFhW3AN7lI-puxk_mHZGJ11rxyR8O55XLSe3SPmRfKwZI6yU24ZxvQKFYItdldUKGzO6Ia6zTKhAVRU",
- "alg":"RS256",
- "kid":"2011-04-29"
-}
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(privateKeyJSON));
-
-debug("\nImporting a JWK key...");
-crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, "RSASSA-PKCS1-v1_5", extractable, ['sign', 'verify']).then(function(result) {
- key = result;
-
- debug("\nExporting the key as JWK...");
- return crypto.webkitSubtle.exportKey("jwk", key);
-}).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
-
- shouldBe("exportedJWK.kty", "'RSA'");
- shouldBe("exportedJWK.n", "privateKeyJSON.n");
- shouldBe("exportedJWK.e", "privateKeyJSON.e");
- shouldBe("exportedJWK.d", "privateKeyJSON.d");
- shouldBe("exportedJWK.p", "privateKeyJSON.p");
- shouldBe("exportedJWK.q", "privateKeyJSON.q");
- shouldBe("exportedJWK.dp", "privateKeyJSON.dp");
- shouldBe("exportedJWK.dq", "privateKeyJSON.dq");
- shouldBe("exportedJWK.qi", "privateKeyJSON.qi");
- shouldBe("exportedJWK.oth", "privateKeyJSON.oth");
- shouldBe("exportedJWK.alg", "privateKeyJSON.alg");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
- shouldBe("exportedJWK.use", "undefined");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 18: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test storing a private RSA key in IndexedDB, and retrieving it.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS retrievedKey.type is 'private'
-PASS retrievedKey.extractable is true
-PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS retrievedKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
-PASS retrievedKey.usages is ["sign", "verify"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-CONSOLE MESSAGE: line 18: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test storing a private RSA key in IndexedDB, and retrieving it.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS retrievedKey.type is 'private'
-PASS retrievedKey.extractable is false
-PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS retrievedKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
-PASS retrievedKey.usages is ["sign", "verify"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-CONSOLE MESSAGE: line 18: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test storing a private RSA key in IndexedDB, and retrieving it.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS retrievedKey.type is 'private'
-PASS retrievedKey.extractable is false
-PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS retrievedKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
-PASS retrievedKey.usages is ["sign", "verify"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script>
-enablePrivateBrowsing = true;
-</script>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<script src="resources/rsa-indexeddb-non-exportable.js"></script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<script src="resources/rsa-indexeddb-non-exportable.js"></script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 18: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test storing a private RSA key in IndexedDB, and retrieving it.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS retrievedKey.type is 'private'
-PASS retrievedKey.extractable is true
-PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS retrievedKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
-PASS retrievedKey.usages is ["sign", "verify"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script>
-enablePrivateBrowsing = true;
-</script>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<script src="resources/rsa-indexeddb.js"></script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<script src="resources/rsa-indexeddb.js"></script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 25: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test that even when non-extractability is requested, the public key is still extractable.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Generating a key pair...
-PASS keyPair.toString() is '[object Object]'
-PASS keyPair.publicKey.type is 'public'
-PASS keyPair.publicKey.extractable is true
-PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
-PASS keyPair.publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
-PASS keyPair.publicKey.algorithm.hash is undefined.
-PASS keyPair.privateKey.type is 'private'
-PASS keyPair.privateKey.extractable is false
-PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
-PASS keyPair.privateKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
-PASS keyPair.privateKey.algorithm.hash is undefined.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test that even when non-extractability is requested, the public key is still extractable.");
-
-jsTestIsAsync = true;
-
-var algorithmKeyGen = {
- name: "RSA-OAEP",
- // RsaKeyGenParams
- modulusLength: 2048,
- publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
-};
-var nonExtractable = false;
-
-debug("Generating a key pair...");
-crypto.webkitSubtle.generateKey(algorithmKeyGen, nonExtractable, []).then(function(result) {
- keyPair = result;
- shouldBe("keyPair.toString()", "'[object Object]'");
- shouldBe("keyPair.publicKey.type", "'public'");
- shouldBe("keyPair.publicKey.extractable", "true");
- shouldBe("keyPair.publicKey.algorithm.name", "'RSA-OAEP'");
- shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
- shouldBeUndefined("keyPair.publicKey.algorithm.hash");
- shouldBe("keyPair.privateKey.type", "'private'");
- shouldBe("keyPair.privateKey.extractable", "false");
- shouldBe("keyPair.privateKey.algorithm.name", "'RSA-OAEP'");
- shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
- shouldBeUndefined("keyPair.privateKey.algorithm.hash");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 25: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test generating, importing and exporting RSA keys for RSA-OAEP. Test that they can't be used with another algorithm.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Generating a key pair...
-PASS keyPair.toString() is '[object Object]'
-PASS keyPair.publicKey.type is 'public'
-PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
-PASS keyPair.publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
-PASS keyPair.publicKey.algorithm.hash is undefined.
-PASS keyPair.privateKey.type is 'private'
-PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
-PASS keyPair.privateKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
-PASS keyPair.privateKey.algorithm.hash is undefined.
-
-Testing that the keys can't be used with different algorithms...
-PASS crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, keyPair.privateKey, hexStringToUint8Array("00")) threw exception NotSupportedError: The operation is not supported..
-PASS crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, keyPair.publicKey, hexStringToUint8Array("00")) threw exception NotSupportedError: The operation is not supported..
-
-Trying to export keys to raw...
-PASS Promise rejected for exporting public key
-PASS Promise rejected for exporting private key
-
-Exporting public key to JWK...
-PASS jwkPublicKey.alg is 'RSA-OAEP'
-PASS jwkPublicKey.ext is true
-PASS jwkPublicKey.key_ops is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
-PASS jwkPublicKey.use is undefined
-PASS jwkPublicKey.kty is 'RSA'
-PASS bytesToHexString(Base64URL.parse(jwkPublicKey.e)) is '010001'
-
-Importing it back...
-PASS exportedPublicKey.type is 'public'
-PASS exportedPublicKey.algorithm.name is 'RSA-OAEP'
-PASS exportedPublicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(exportedPublicKey.algorithm.publicExponent) is '010001'
-PASS exportedPublicKey.algorithm.hash.name is 'SHA-1'
-PASS exportedPublicKey.extractable is true
-PASS exportedPublicKey.usages is ['decrypt','encrypt','unwrapKey','wrapKey']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test generating, importing and exporting RSA keys for RSA-OAEP. Test that they can't be used with another algorithm.");
-
-jsTestIsAsync = true;
-
-var algorithmKeyGen = {
- name: "RSA-OAEP",
- // RsaKeyGenParams
- modulusLength: 2048,
- publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
-};
-var extractable = true;
-
-debug("Generating a key pair...");
-crypto.webkitSubtle.generateKey(algorithmKeyGen, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(result) {
- keyPair = result;
- shouldBe("keyPair.toString()", "'[object Object]'");
- shouldBe("keyPair.publicKey.type", "'public'");
- shouldBe("keyPair.publicKey.algorithm.name", "'RSA-OAEP'");
- shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
- shouldBeUndefined("keyPair.publicKey.algorithm.hash");
- shouldBe("keyPair.privateKey.type", "'private'");
- shouldBe("keyPair.privateKey.algorithm.name", "'RSA-OAEP'");
- shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
- shouldBeUndefined("keyPair.privateKey.algorithm.hash");
-
- debug("\nTesting that the keys can't be used with different algorithms...");
- iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
- shouldThrow('crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, keyPair.privateKey, hexStringToUint8Array("00"))');
- shouldThrow('crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, keyPair.publicKey, hexStringToUint8Array("00"))');
-
- debug("\nTrying to export keys to raw...");
- return crypto.webkitSubtle.exportKey('raw', keyPair.publicKey);
-}).then(undefined, function(result) {
- testPassed("Promise rejected for exporting public key");
- return crypto.webkitSubtle.exportKey('raw', keyPair.privateKey);
-}).then(undefined, function(result) {
- testPassed("Promise rejected for exporting private key");
-
- debug("\nExporting public key to JWK...");
- return crypto.webkitSubtle.exportKey("jwk", keyPair.publicKey);
-}).then(function(result) {
- jwkPublicKeyArray = result;
- jwkPublicKey = JSON.parse(bytesToASCIIString(jwkPublicKeyArray));
- shouldBe("jwkPublicKey.alg", "'RSA-OAEP'");
- shouldBe("jwkPublicKey.ext", "true");
- shouldBe("jwkPublicKey.key_ops", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
- shouldBe("jwkPublicKey.use", "undefined");
- shouldBe("jwkPublicKey.kty", "'RSA'");
- shouldBe("bytesToHexString(Base64URL.parse(jwkPublicKey.e))", "'010001'");
-
- debug("\nImporting it back...");
- return crypto.webkitSubtle.importKey("jwk", jwkPublicKeyArray, null, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
-}).then(function(result) {
- exportedPublicKey = result;
- shouldBe("exportedPublicKey.type", "'public'");
- shouldBe("exportedPublicKey.algorithm.name", "'RSA-OAEP'");
- shouldBe("exportedPublicKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(exportedPublicKey.algorithm.publicExponent)", "'010001'");
- shouldBe("exportedPublicKey.algorithm.hash.name", "'SHA-1'");
- shouldBe("exportedPublicKey.extractable", "true");
- shouldBe("exportedPublicKey.usages", "['decrypt','encrypt','unwrapKey','wrapKey']");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 40: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test what happens when trying to encrypt a too large plain text with RSA-OAEP.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing RSA keys...
-Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...
-PASS Succeeded
-Encrypting a 215 byte buffer...
-PASS Rejected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test what happens when trying to encrypt a too large plain text with RSA-OAEP.");
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB"
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- d: "eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ",
- p: "4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0",
- q: "xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc",
- dp: "fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk",
- dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE",
- qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk"
-};
-var encryptAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
-var extractable = true;
-var nonExtractable = false;
-
-debug("Importing RSA keys...");
-crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["encrypt", "decrypt"]).then(function(result) {
- publicKey = result;
- return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["encrypt", "decrypt"]);
-}).then(function(result) {
- privateKey = result;
-
- debug("Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...");
- return crypto.webkitSubtle.encrypt({name: "RSA-OAEP", hash: "SHA-1"}, publicKey, new Uint8Array(214));
-}).then(function(result) {
- testPassed("Succeeded");
- debug("Encrypting a 215 byte buffer...");
- return crypto.webkitSubtle.encrypt({name: "RSA-OAEP", hash: "SHA-1"}, publicKey, new Uint8Array(215));
-}).then(function(result) {
- testFailed("Succeeded");
- finishJSTest();
-}, function(result) {
- testPassed("Rejected");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 40: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test wrapping and unwrapping AES keys with RSA-OAEP.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing RSA keys...
-Importing an AES key...
-Wrapping it...
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 256
-PASS unwrappedKey.usages is ['decrypt', 'encrypt']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
-
-Wrapping the same key as JWK...
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 256
-PASS unwrappedKey.usages is ['decrypt', 'encrypt']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test wrapping and unwrapping AES keys with RSA-OAEP.");
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB"
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- d: "eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ",
- p: "4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0",
- q: "xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc",
- dp: "fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk",
- dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE",
- qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk"
-};
-var wrapAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
-var extractable = true;
-var nonExtractable = false;
-
-debug("Importing RSA keys...");
-crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["wrapKey", "unwrapKey"]).then(function(result) {
- publicKey = result;
- return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["wrapKey", "unwrapKey"]);
-}).then(function(result) {
- privateKey = result;
-
- debug("Importing an AES key...");
- aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
- return crypto.webkitSubtle.importKey("raw", aesKeyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
-}).then(function(result) {
- aesKey = result;
- debug("Wrapping it...");
-
- return crypto.webkitSubtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
-
- debug("Unwrapping it...");
- return crypto.webkitSubtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
-}).then(function(result) {
- unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'secret'");
- shouldBe("unwrappedKey.extractable", "true");
- shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
- shouldBe("unwrappedKey.algorithm.length", "256");
- shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
-
- debug("Exporting it...");
- return crypto.webkitSubtle.exportKey("raw", unwrappedKey);
-}).then(function(result) {
- unwrappedKeyData = result;
- shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData)");
-
- debug("\nWrapping the same key as JWK...");
- return crypto.webkitSubtle.wrapKey("jwk", aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
-
- debug("Unwrapping it...");
- return crypto.webkitSubtle.unwrapKey("jwk", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
-}).then(function(result) {
- unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'secret'");
- shouldBe("unwrappedKey.extractable", "true");
- shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
- shouldBe("unwrappedKey.algorithm.length", "256");
- shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
-
- debug("Exporting it...");
- return crypto.webkitSubtle.exportKey("raw", unwrappedKey);
-}).then(function(result) {
- unwrappedKeyData = result;
- shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData)");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 60: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test sending crypto keys via postMessage.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Key received in a message:
-PASS key.type is 'private'
-PASS key.extractable is true
-PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS key.algorithm.modulusLength is 2048
-PASS bytesToHexString(key.algorithm.publicExponent) is '010001'
-PASS key.usages is ["sign", "verify"]
-
-Exported back to JWK:
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.alg is 'RS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.key_ops is ['sign','verify']
-PASS exportedJWK.use is undefined
-PASS exportedJWK.n is privateKeyJSON.n
-PASS exportedJWK.e is privateKeyJSON.e
-PASS exportedJWK.d is privateKeyJSON.d
-PASS exportedJWK.p is privateKeyJSON.p
-PASS exportedJWK.q is privateKeyJSON.q
-PASS exportedJWK.dp is privateKeyJSON.dp
-PASS exportedJWK.dq is privateKeyJSON.dq
-PASS exportedJWK.qi is privateKeyJSON.qi
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<script>
-
-description("Test sending crypto keys via postMessage.");
-
-jsTestIsAsync = true;
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- d: "eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ",
- p: "4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0",
- q: "xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc",
- dp: "fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk",
- dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE",
- qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk"
-};
-
-window.addEventListener("message", function(evt) {
- debug("Key received in a message:");
- key = evt.data;
- shouldBe("key.type", "'private'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("key.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(key.algorithm.publicExponent)", "'010001'");
- shouldBe("key.usages", '["sign", "verify"]');
-
- crypto.webkitSubtle.exportKey("jwk", key).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
- debug("\nExported back to JWK:");
- shouldBe("exportedJWK.kty", "'RSA'");
- shouldBe("exportedJWK.alg", "'RS256'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.key_ops", "['sign','verify']");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.n", "privateKeyJSON.n");
- shouldBe("exportedJWK.e", "privateKeyJSON.e");
- shouldBe("exportedJWK.d", "privateKeyJSON.d");
- shouldBe("exportedJWK.p", "privateKeyJSON.p");
- shouldBe("exportedJWK.q", "privateKeyJSON.q");
- shouldBe("exportedJWK.dp", "privateKeyJSON.dp");
- shouldBe("exportedJWK.dq", "privateKeyJSON.dq");
- shouldBe("exportedJWK.qi", "privateKeyJSON.qi");
- debug("");
-
- finishJSTest();
- });
-}, false);
-
-crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, true, ["sign", "verify"]).then(function(result) {
- postMessage(result, "*");
-});
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 33: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test decrypting a known message with RSAES-PKCS1-v1_5.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing an RSA key...
-Decrypting...
-PASS bytesToHexString(new Uint8Array(message)) is '2aacec86f423dd925ec158822a748cbe6c31a0'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test decrypting a known message with RSAES-PKCS1-v1_5.");
-
-jsTestIsAsync = true;
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RSA1_5",
- n: Base64URL.stringify(hexStringToUint8Array("dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1")),
- e: Base64URL.stringify(hexStringToUint8Array("010001")),
- d: Base64URL.stringify(hexStringToUint8Array("21950851cdf25320318b305afa0f371f07ae5a44b314ebd729f5dcb15da7fa3947acdd915daed574bd16df88bf85f61060b387172fae6e01262b3864c2d3c22f94e04a8159422b4ed279c48a4c9d767d4966071a5bbf5d043e16ff46ec1ba0716f00bbc97bff5d5693e214e99c9721f12b3ec6282ae2a485721b96ddcf7403fa037d0c57ab463c448de5cc12265add886d311ea8d8a5903fa56c5f1c9cf2eb11cb657a1a7d3e41352dc3e686898c4ce4305e8b638e1b08a2a86cc9eb9866f3499ac77b6136b81cb276d614cfeb7b6ed3f3bc775e46c00066ebeee2cff7166b57520598947ff6210320b288fb4f2c3f8fe97b279414ebf7203000a19fc0424875")),
- p: Base64URL.stringify(hexStringToUint8Array("f123bfe53de97a569d91adcf556fa625ad30f3fd3d811f9e91e6af44b6e780cb0f327829fb21190ae2806646d728cd9b6531132b1ebfef1272993060f1ce70b124393091ee8593b727367edbba009ec5be17c4acee120c841267d47631a16c36a6d1c99973c1b0b5a835bf39feafe8f6421fd9c2a90bc27976659e67bc83124d")),
- q: Base64URL.stringify(hexStringToUint8Array("ea9839b7e37ea89bbda27e4c93471cb4fd92189a0a96bcb4d75693f18a5c2f742af9e36fde679fbd9eae345fa269527b6965021c4bdf54d685bf08960cc976f68dca21cebf44f268a59dab8d1a25e519f5147e1f45fe287d74cf725bec1326d34212c56cf4fffa202f57b68ee8cca943f3c138c4cde33bdf2c9440df65322445")),
- dp: Base64URL.stringify(hexStringToUint8Array("ca0c9b60b8e4a6066756c65d2088419df6253b7b688a85f4f6e964d85dad52a45262867f1e9618069fccd865e9289e46e39e2022944c5c4487d345cf252d460d977d77edfefedbcbae46a23af7fa470f077da0e50942044cb1a360497cc2760ac0f2ad4a2fcd0e84d7a1d94dfdd2658fd9ce18475c1fa75ee0cebad0cf0ac04d")),
- dq: Base64URL.stringify(hexStringToUint8Array("528171233c4e4a6c63b86764f51338846afddbcb2958344c01c4004a1dd828145a1d02a1507def4f58247a64fc10c0a288c1ae895721d78b8f044db7c00d86da55a9b654292ecd768270be69e4bd5922d4effd1f70955f9627e3e19b749e93b40ef3dd1d61d93915e2b09d930b4b1768bfacc0136f39b0cfdfb4d050011e2e65")),
- qi: Base64URL.stringify(hexStringToUint8Array("df2eb2322cc2daabf4d1465508f41521cda7ceff23ebe61d00d441ee728dda5d16c7bf920cd95f34beb4fe32ee817ef3362e0bcd1d1245f7b07793eaa190dc5a37fdaf4c68e2ca13972d7f5148b796b6fb6d7adda07bd2cd13be98cebed1edc6ca412e395350c59a1d842bc4aa2f3c0b243fde7dfd95356f2439251a1172c45e"))
-};
-
-var extractable = true;
-var nonExtractable = false;
-
-debug("Importing an RSA key...");
-crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["decrypt"]).then(function(result) {
- privateKey = result;
-
- debug("Decrypting...");
- encryptedMessage = hexStringToUint8Array("6042e745589af03af87520f93c45d8c35985ada1161a37d822e9f9460fc75fcf0179d8491b8f5d1e4de8ceb31e07c4865c5a3efdbbb69a8803b89ee65a430a5809c707569150b580bb686a94c5541c46adcd827960ce244ff688387d1616e85b4d1780c6483606cf924b54f080cf4154e66829bf6e532481048ec41fadc07d755bb34bb28145219cb30d47d0d618709180e90303ff9ef09018bed3da75761da794811f96bc9e8d7c4ba1b5946bda0bd313faec4c993ed2748eed8cce4bdb520ba7db165f9fe56aa8454d6ff33874feeebf29de2df5b7f00aa1d9fb073fc4067b58dc50624e127f711dde2cc2cfdab4919ccf28c83660dfc227b0f500ec1f904f");
- return crypto.webkitSubtle.decrypt("RSAES-PKCS1-v1_5", privateKey, encryptedMessage);
-}).then(function(result) {
- message = result;
- shouldBe("bytesToHexString(new Uint8Array(message))", "'2aacec86f423dd925ec158822a748cbe6c31a0'");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 40: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test wrapping and unwrapping an AES key with RSAES-PKCS1-v1_5.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing RSA keys...
-Importing an AES key...
-Wrapping it...
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 256
-PASS unwrappedKey.usages is ['decrypt', 'encrypt']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
-
-Wrapping the same key as JWK...
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 256
-PASS unwrappedKey.usages is ['decrypt', 'encrypt']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test wrapping and unwrapping an AES key with RSAES-PKCS1-v1_5.");
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RSA1_5",
- n: Base64URL.stringify(hexStringToUint8Array("dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1")),
- e: Base64URL.stringify(hexStringToUint8Array("010001"))
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RSA1_5",
- n: Base64URL.stringify(hexStringToUint8Array("dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1")),
- e: Base64URL.stringify(hexStringToUint8Array("010001")),
- d: Base64URL.stringify(hexStringToUint8Array("21950851cdf25320318b305afa0f371f07ae5a44b314ebd729f5dcb15da7fa3947acdd915daed574bd16df88bf85f61060b387172fae6e01262b3864c2d3c22f94e04a8159422b4ed279c48a4c9d767d4966071a5bbf5d043e16ff46ec1ba0716f00bbc97bff5d5693e214e99c9721f12b3ec6282ae2a485721b96ddcf7403fa037d0c57ab463c448de5cc12265add886d311ea8d8a5903fa56c5f1c9cf2eb11cb657a1a7d3e41352dc3e686898c4ce4305e8b638e1b08a2a86cc9eb9866f3499ac77b6136b81cb276d614cfeb7b6ed3f3bc775e46c00066ebeee2cff7166b57520598947ff6210320b288fb4f2c3f8fe97b279414ebf7203000a19fc0424875")),
- p: Base64URL.stringify(hexStringToUint8Array("f123bfe53de97a569d91adcf556fa625ad30f3fd3d811f9e91e6af44b6e780cb0f327829fb21190ae2806646d728cd9b6531132b1ebfef1272993060f1ce70b124393091ee8593b727367edbba009ec5be17c4acee120c841267d47631a16c36a6d1c99973c1b0b5a835bf39feafe8f6421fd9c2a90bc27976659e67bc83124d")),
- q: Base64URL.stringify(hexStringToUint8Array("ea9839b7e37ea89bbda27e4c93471cb4fd92189a0a96bcb4d75693f18a5c2f742af9e36fde679fbd9eae345fa269527b6965021c4bdf54d685bf08960cc976f68dca21cebf44f268a59dab8d1a25e519f5147e1f45fe287d74cf725bec1326d34212c56cf4fffa202f57b68ee8cca943f3c138c4cde33bdf2c9440df65322445")),
- dp: Base64URL.stringify(hexStringToUint8Array("ca0c9b60b8e4a6066756c65d2088419df6253b7b688a85f4f6e964d85dad52a45262867f1e9618069fccd865e9289e46e39e2022944c5c4487d345cf252d460d977d77edfefedbcbae46a23af7fa470f077da0e50942044cb1a360497cc2760ac0f2ad4a2fcd0e84d7a1d94dfdd2658fd9ce18475c1fa75ee0cebad0cf0ac04d")),
- dq: Base64URL.stringify(hexStringToUint8Array("528171233c4e4a6c63b86764f51338846afddbcb2958344c01c4004a1dd828145a1d02a1507def4f58247a64fc10c0a288c1ae895721d78b8f044db7c00d86da55a9b654292ecd768270be69e4bd5922d4effd1f70955f9627e3e19b749e93b40ef3dd1d61d93915e2b09d930b4b1768bfacc0136f39b0cfdfb4d050011e2e65")),
- qi: Base64URL.stringify(hexStringToUint8Array("df2eb2322cc2daabf4d1465508f41521cda7ceff23ebe61d00d441ee728dda5d16c7bf920cd95f34beb4fe32ee817ef3362e0bcd1d1245f7b07793eaa190dc5a37fdaf4c68e2ca13972d7f5148b796b6fb6d7adda07bd2cd13be98cebed1edc6ca412e395350c59a1d842bc4aa2f3c0b243fde7dfd95356f2439251a1172c45e"))
-};
-var wrapAlgorithm = {name: "RSAES-PKCS1-v1_5"};
-var extractable = true;
-var nonExtractable = false;
-
-debug("Importing RSA keys...");
-crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["wrapKey", "unwrapKey"]).then(function(result) {
- publicKey = result;
- return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["wrapKey", "unwrapKey"]);
-}).then(function(result) {
- privateKey = result;
-
- debug("Importing an AES key...");
- aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
- return crypto.webkitSubtle.importKey("raw", aesKeyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
-}).then(function(result) {
- aesKey = result;
- debug("Wrapping it...");
-
- return crypto.webkitSubtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
-
- debug("Unwrapping it...");
- return crypto.webkitSubtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
-}).then(function(result) {
- unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'secret'");
- shouldBe("unwrappedKey.extractable", "true");
- shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
- shouldBe("unwrappedKey.algorithm.length", "256");
- shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
-
- debug("Exporting it...");
- return crypto.webkitSubtle.exportKey("raw", unwrappedKey);
-}).then(function(result) {
- unwrappedKeyData = result;
- shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData)");
-
- debug("\nWrapping the same key as JWK...");
- return crypto.webkitSubtle.wrapKey("jwk", aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
-
- debug("Unwrapping it...");
- return crypto.webkitSubtle.unwrapKey("jwk", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
-}).then(function(result) {
- unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'secret'");
- shouldBe("unwrappedKey.extractable", "true");
- shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
- shouldBe("unwrappedKey.algorithm.length", "256");
- shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
-
- debug("Exporting it...");
- return crypto.webkitSubtle.exportKey("raw", unwrappedKey);
-}).then(function(result) {
- unwrappedKeyData = result;
- shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData)");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 25: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test generating an RSA key pair for RSASSA-PKCS1-v1_5.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Generating a key pair...
-PASS keyPair.toString() is '[object Object]'
-PASS keyPair.publicKey.type is 'public'
-PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS keyPair.publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
-PASS keyPair.publicKey.algorithm.hash is undefined.
-PASS keyPair.privateKey.type is 'private'
-PASS keyPair.privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS keyPair.privateKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
-PASS keyPair.privateKey.algorithm.hash is undefined.
-
-Testing that custom attributes on keys survive garbage collection...
-PASS keyPair.publicKey.foo is 'bar'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-CONSOLE MESSAGE: line 25: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test generating an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Generating a key pair...
-PASS keyPair.toString() is '[object Object]'
-PASS keyPair.publicKey.type is 'public'
-PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS keyPair.publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
-PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test generating an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes.");
-
-jsTestIsAsync = true;
-
-var algorithmKeyGen = {
- name: "RSASSA-PKCS1-v1_5",
- // RsaKeyGenParams
- modulusLength: 2048,
- publicExponent: new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01]), // Equivalent to 65537
-};
-var extractable = true;
-
-debug("Generating a key pair...");
-crypto.webkitSubtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
- keyPair = result;
- shouldBe("keyPair.toString()", "'[object Object]'");
- shouldBe("keyPair.publicKey.type", "'public'");
- shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
- shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test generating an RSA key pair for RSASSA-PKCS1-v1_5.");
-
-jsTestIsAsync = true;
-
-var algorithmKeyGen = {
- name: "RSASSA-PKCS1-v1_5",
- // RsaKeyGenParams
- modulusLength: 2048,
- publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
-};
-var extractable = true;
-
-debug("Generating a key pair...");
-crypto.webkitSubtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
- keyPair = result;
- shouldBe("keyPair.toString()", "'[object Object]'");
- shouldBe("keyPair.publicKey.type", "'public'");
- shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
- shouldBeUndefined("keyPair.publicKey.algorithm.hash");
- shouldBe("keyPair.privateKey.type", "'private'");
- shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
- shouldBeUndefined("keyPair.privateKey.algorithm.hash");
-
- debug("\nTesting that custom attributes on keys survive garbage collection...");
- keyPair.publicKey.foo = "bar";
- gc();
- setTimeout(function() {
- gc();
- setTimeout(function() {
- shouldBe("keyPair.publicKey.foo", "'bar'");
- finishJSTest();
- }, 0);
- }, 0);
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 39: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test importing an RSA key for RSASSA-PKCS1-v1_5.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a public key...
-PASS publicKey.toString() is '[object CryptoKey]'
-PASS publicKey.type is 'public'
-PASS publicKey.usages is ['sign','verify']
-PASS publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
-PASS publicKey.algorithm.hash.name is 'SHA-256'
-
-Importing a private key...
-PASS privateKey.toString() is '[object CryptoKey]'
-PASS privateKey.type is 'private'
-PASS privateKey.usages is ['sign','verify']
-PASS privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS privateKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(privateKey.algorithm.publicExponent) is '010001'
-PASS privateKey.algorithm.hash.name is 'SHA-256'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-CONSOLE MESSAGE: line 616: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-A key of size 2048 bits or larger MUST be used with RS256, RS384, RS512 JWK algorithms.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"]) threw exception TypeError: Key size is not valid for RS256.
-PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"]) threw exception TypeError: Key size is not valid for RS512.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("A key of size 2048 bits or larger MUST be used with RS256, RS384, RS512 JWK algorithms.");
-
-var extractable = true;
-
-// openssl genrsa 1024 >1024.pem
-// openssl asn1parse -in 1024.pem
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: Base64URL.stringify(hexStringToUint8Array("B7F103F8412CCD26F5D54FC3157CD8CE1F134F4EABF0A042350BDD7F00FEA2B77EEF19915B10AA2417BB2CB4EC1D57B9661A20072469B9DF9C6E89CB35CCC8543CC40770DCC30D0BBFF1BF9DA1E2549F40476EDADB9312985DAE8C7527C1C12AAFEDF4584989968CDCC9EFEB197438C534D1BFAAC30B1D41F75EADB86CC581B9")),
- e: Base64URL.stringify(hexStringToUint8Array("010001"))
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RS512",
- n: Base64URL.stringify(hexStringToUint8Array("B7F103F8412CCD26F5D54FC3157CD8CE1F134F4EABF0A042350BDD7F00FEA2B77EEF19915B10AA2417BB2CB4EC1D57B9661A20072469B9DF9C6E89CB35CCC8543CC40770DCC30D0BBFF1BF9DA1E2549F40476EDADB9312985DAE8C7527C1C12AAFEDF4584989968CDCC9EFEB197438C534D1BFAAC30B1D41F75EADB86CC581B9")),
- e: Base64URL.stringify(hexStringToUint8Array("010001")),
- d: Base64URL.stringify(hexStringToUint8Array("5BA6F4F26B0F36BDB5FA6EBEE6E3096853259CFBB742B3A7A9A4DADDE0920063EC149929CB3557819A6D824E37E43B04BF323F492FC49A8028031017B81BECA8EC2A85ABCF193501D80DC251DB8863B8673D8B6772DB2D2AE08CD1829C3F542141461CACE4E8A1F112AD13FF4A4DD865A89AEA94E984D487E5798EF07643B9CD")),
- p: Base64URL.stringify(hexStringToUint8Array("E06BFE5722A68E5D597DD8DB937483CBA352AB817209275ADAD103772B7A8EF4EA946311A2B51805959818CEB362F257D6998B475FEA9E34F2A30205B5F5A7FF")),
- q: Base64URL.stringify(hexStringToUint8Array("D1D2DBDB1F4DCBFE8D16CDD2CF83C7B5FADFC7891F22FC527BF208F81B92F2543569C3AD22224B82D407DEB65F651D09D2558FEE8BC6E5DA51F6F13206CC1647")),
- dp: Base64URL.stringify(hexStringToUint8Array("73ECB4F3D3AD4F6ABEF877D56C84CA339D88ED98AF0C356D040CE58A60462DA42BAC3CC47654AF34EB4226C656F96C8F9D05B1614C1588657754668E06A0FF87")),
- dq: Base64URL.stringify(hexStringToUint8Array("5B9C5ACDB33F3E5FE7AE1B337DD325B138D5D7C2F0CB4FAB9BDE333850A1BA183631F5737441D102501D178A3CE062EB54E072B54E660B19654C12472B5C9425")),
- qi: Base64URL.stringify(hexStringToUint8Array("D6A920B241178923C59BCBD1A815764619225A90F2C090A9FBD594A61561542D0DF179590413C26C8A72FC6E14EC63A377169970671B3A1EB5E4F4DF1A4CA725"))
-};
-
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"])');
-shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"])');
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test importing an RSA key for RSASSA-PKCS1-v1_5.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB"
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- d: "eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ",
- p: "4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0",
- q: "xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc",
- dp: "fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk",
- dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE",
- qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk"
-};
-
-debug("Importing a public key...");
-crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"]).then(function(result) {
- publicKey = result;
- shouldBe("publicKey.toString()", "'[object CryptoKey]'");
- shouldBe("publicKey.type", "'public'");
- shouldBe("publicKey.usages", "['sign','verify']");
- shouldBe("publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("publicKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(publicKey.algorithm.publicExponent)", "'010001'");
- shouldBe("publicKey.algorithm.hash.name", "'SHA-256'");
- debug("\nImporting a private key...");
- return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"]);
-}).then(function(result) {
- privateKey = result;
- shouldBe("privateKey.toString()", "'[object CryptoKey]'");
- shouldBe("privateKey.type", "'private'");
- shouldBe("privateKey.usages", "['sign','verify']");
- shouldBe("privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("privateKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(privateKey.algorithm.publicExponent)", "'010001'");
- shouldBe("privateKey.algorithm.hash.name", "'SHA-256'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 41: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test importing an RSA key for RSASSA-PKCS1-v1_5.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a public key...
-
-Importing a private key...
-
-Signing some text...
-PASS bytesToHexString(new Uint8Array(signature)) is '0fd9a8aef4cc1876c0b762545336c6d1fb315ae16ae4b5e4bf34d384d8585ea7a01e76ea09ee7f7ee8d1c122e7dd15b7c94a573b2aa07203e8d13bc6fd16156cd8e5f0c15a15dccb62d152127fca09882fb53bc3e60ab586d15b95cf411e3aab4a1c231a7e91aab09ee3d4b13d11e97505ddff77683470da510ee76e8bd530c56a85f901626a5a710f716f113dfe9cf6c473ee16fa248aea3480a1033abe30f4c1243289a661e64d7818b55698280688097135968c6d4b029496d85cab2a67e4696737781f70e4392c7df71bbd6c92465947f029a1de48160aced11b5721b1cd25039fe2c16c2b38de73df3b9a83e3ea755fd0cfe51ca06b61fadf6d84677f95'
-
-Verifying the signature...
-PASS verificationResult is true
-
-Verifying a bad signature...
-PASS verificationResult is false
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test importing an RSA key for RSASSA-PKCS1-v1_5.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: Base64URL.stringify(hexStringToUint8Array("ADC0940AFECE7351D56A6D432210B3AA49D38566B03A9F102E4F198B2DA9D740728D01426A3A058B2B805A5F91D565D969FE318AD2D1ADA713F5A829CC8CDCF8C6CB4872068164063B6D651A2226CB97ED67E0FC6C702A473DB2D79A730F8738084A2EED74922C3A119D1D101B932C0E10FAB36815F66C0792BB640B1B4C59D062FBBEDAB3CC069A535195D70E4A06432CAF149C24A00353A0B99F7CF5B17273CB4E38421BD315127CF4B3DCB3D20A7C98CFAF1A0E398A55E347FA283CE7B39273259B1B2132DC18B0EB8AAE9F78EE525356B09DF39E090E76D7985B2B71E50AF85CA36CE91F8CCB2ABBD8A529D369890D98A2CA2825C4C2FF8B7FBF09E79C0B")),
- e: Base64URL.stringify(hexStringToUint8Array("010001")),
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: Base64URL.stringify(hexStringToUint8Array("ADC0940AFECE7351D56A6D432210B3AA49D38566B03A9F102E4F198B2DA9D740728D01426A3A058B2B805A5F91D565D969FE318AD2D1ADA713F5A829CC8CDCF8C6CB4872068164063B6D651A2226CB97ED67E0FC6C702A473DB2D79A730F8738084A2EED74922C3A119D1D101B932C0E10FAB36815F66C0792BB640B1B4C59D062FBBEDAB3CC069A535195D70E4A06432CAF149C24A00353A0B99F7CF5B17273CB4E38421BD315127CF4B3DCB3D20A7C98CFAF1A0E398A55E347FA283CE7B39273259B1B2132DC18B0EB8AAE9F78EE525356B09DF39E090E76D7985B2B71E50AF85CA36CE91F8CCB2ABBD8A529D369890D98A2CA2825C4C2FF8B7FBF09E79C0B")),
- e: Base64URL.stringify(hexStringToUint8Array("010001")),
- d: Base64URL.stringify(hexStringToUint8Array("78D2D2DFB682CFB45748D3C3FC3B4B049EA3E53F1C4B17734410A33DA23A59C1AA269D7A96ADD44F0BA80CB02A940F681989B6DFC76C216A6EB9C3FF950B5B59EFBB4A9C6823AFEF99819FED85541EFD7E0C5F6A88E992ACC99DC4C9D53B361763C45A4FAB613E39FF27971F2D5DB123F2F0B2B32D9A9752C8D9605F4CD3521C2DB9A86000A3040A16231F61278C7747C3AB18DBEC00A5D71023B50B134A28E51CDB419A66BA170DF618817342F7861174AA8E7499B974DBFEB9FC643B0E95645C1C4D81104BCE53DA6E6CF31B6A0085F79F2E0626482D68A5A0A45C4EAF45640D58D2F8E5164D64560CDEEA0982138CA867A870CD01A63742847ACF3A516F49")),
- p: Base64URL.stringify(hexStringToUint8Array("E26893B808CA31E1F9B89E4A077F7B414C216E46048126DC0369A27E64A4BC4DB4D7C81BE79AA40472B5795AF27F5FE6E372CD95CE8EFDA93A81FCDD64866F4B93421A33E5D2AD3DA65529BBCA85392B2907003AEEA187EFA9459592E7FDDE328254BBC1F2EBBB8FF962CF2A2CBB3E0EA54BBE2C29A2C3A7CB25AAC0CE405E9D")),
- q: Base64URL.stringify(hexStringToUint8Array("C4762BCE48AFB669F3FEC19C867586734ABEA433A42A2729B51A6FDA93052085F19C55F968C7845C866356E8D7B70532D5494520DD866494AFCB9289EFD9AEFD7C8D9C51CCCDE747F80DDE7B7BBC875514AD917EBD4BB5FDEE14FF1EBB34DD5D79DCD448ACA737BA459773A4B9284C056195F9CC3338F75C5407D5B9997150C7")),
- dp: Base64URL.stringify(hexStringToUint8Array("7C1CC3CD80D40660501A8A7B1E7D1DBDFFD3DBB57A46AA5CB56A34EF809065C15B3F66AD155B4A4A3DEF8964F7C62776547CDC8220C775FA4CDE71159443B5C302289C6092BDD8C610E66288554E8EB640395C40F20B8E8F2C85BEA6D791ED3A5703C8215BDF29E494DB3BA16CFFFFD6DB7A17F7F1A30E0A6F6C689C64F41869")),
- dq: Base64URL.stringify(hexStringToUint8Array("8E61360E220F761C0380B5C042921A06A43CD5B3B75DF553FCB4542C0C30C3094FB90575E3C1F4E33961F5327A6361991D8A2457553478E0692717E46FB74B62DA49A6E8818D17F8C88504A06964908FD09499C5485AFE62319175F347A96064C6548C64BEFBD11F662004E7746907EF3E71FABF4AC016450B81421B6860FF31")),
- qi: Base64URL.stringify(hexStringToUint8Array("6025FFA4BC1B3010354E1547D167309A7CADA8D72B3021304E6EC1C80D9E53A9D66D0AD42EF7FB9BDFE4CDF2D4723B27A405650501B924C5CCCB44AAE29B706F2C2C6B9F86F0A00E38E4762F7BF8842F84CACF5FB6014CFF78B4A38D1E7901F86F785A3DB9EDAC878C83C23394EB9560A7FDFB642E283A1679175DECDB1DC539"))
-};
-
-var data = asciiToUint8Array("Hello, world!");
-
-debug("Importing a public key...");
-crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"]).then(function(result) {
- publicKey = result;
- debug("\nImporting a private key...");
- return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"]);
-}).then(function(result) {
- privateKey = result;
- debug("\nSigning some text...");
- return crypto.webkitSubtle.sign({ name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" }, privateKey, data);
-}).then(function(result) {
- signature = result;
- shouldBe("bytesToHexString(new Uint8Array(signature))", "'0fd9a8aef4cc1876c0b762545336c6d1fb315ae16ae4b5e4bf34d384d8585ea7a01e76ea09ee7f7ee8d1c122e7dd15b7c94a573b2aa07203e8d13bc6fd16156cd8e5f0c15a15dccb62d152127fca09882fb53bc3e60ab586d15b95cf411e3aab4a1c231a7e91aab09ee3d4b13d11e97505ddff77683470da510ee76e8bd530c56a85f901626a5a710f716f113dfe9cf6c473ee16fa248aea3480a1033abe30f4c1243289a661e64d7818b55698280688097135968c6d4b029496d85cab2a67e4696737781f70e4392c7df71bbd6c92465947f029a1de48160aced11b5721b1cd25039fe2c16c2b38de73df3b9a83e3ea755fd0cfe51ca06b61fadf6d84677f95'");
-
- debug("\nVerifying the signature...");
- return crypto.webkitSubtle.verify({ name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" }, publicKey, signature, data);
-}).then(function(result) {
- verificationResult = result;
- shouldBe("verificationResult", "true");
- debug("\nVerifying a bad signature...");
- return crypto.webkitSubtle.verify({ name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" }, publicKey, new Uint8Array(256), data);
-}).then(function(result) {
- verificationResult = result;
- shouldBe("verificationResult", "false");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 1: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test crypto.webkitSubtle.digest.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-SHA1 of []
-PASS bytesToHexString(new Uint8Array(digest)) is 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
-SHA1 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is '5ba93c9db0cff93f52b521d7420e43f6eda2784f'
-SHA1 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '2c7e7c384f7829694282b1e3a6216def8082d055'
-PASS crypto.webkitSubtle.generateKey('sha-1') threw exception NotSupportedError: The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test crypto.webkitSubtle.digest.");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- debug("SHA1 of []");
- return crypto.webkitSubtle.digest('sha-1', new Uint8Array([]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'da39a3ee5e6b4b0d3255bfef95601890afd80709'");
-
- debug("SHA1 of [0x0]")
- return crypto.webkitSubtle.digest({name: 'sha-1'}, new Uint8Array([0]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'5ba93c9db0cff93f52b521d7420e43f6eda2784f'");
-
- debug("SHA1 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
- var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
- return crypto.webkitSubtle.digest({name: 'sha-1'}, data);
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'2c7e7c384f7829694282b1e3a6216def8082d055'");
-
- // All SHA-1 can do is digest.
- shouldThrow("crypto.webkitSubtle.generateKey('sha-1')");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 1: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test crypto.webkitSubtle.digest.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-SHA224 of []
-PASS bytesToHexString(new Uint8Array(digest)) is 'd14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f'
-SHA224 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is 'fff9292b4201617bdc4d3053fce02734166a683d7d858a7f5f59b073'
-SHA224 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '767d0cdc11079ba8dca276df5c4b85507de67dce47eda4cd9196d312'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test crypto.webkitSubtle.digest.");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- debug("SHA224 of []");
- return crypto.webkitSubtle.digest('sha-224', new Uint8Array([]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f'");
-
- debug("SHA224 of [0x0]")
- return crypto.webkitSubtle.digest({name: 'sha-224'}, new Uint8Array([0]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'fff9292b4201617bdc4d3053fce02734166a683d7d858a7f5f59b073'");
-
- debug("SHA224 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
- var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
- return crypto.webkitSubtle.digest({name: 'sha-224'}, data);
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'767d0cdc11079ba8dca276df5c4b85507de67dce47eda4cd9196d312'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 1: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test crypto.webkitSubtle.digest.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-SHA256 of []
-PASS bytesToHexString(new Uint8Array(digest)) is 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
-SHA256 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is '6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d'
-SHA256 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '78a6273103d17c39a0b6126e226cec70e33337f4bc6a38067401b54a33e78ead'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test crypto.webkitSubtle.digest.");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- debug("SHA256 of []");
- return crypto.webkitSubtle.digest('sha-256', new Uint8Array([]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'");
-
- debug("SHA256 of [0x0]")
- return crypto.webkitSubtle.digest({name: 'sha-256'}, new Uint8Array([0]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d'");
-
- debug("SHA256 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
- var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
- return crypto.webkitSubtle.digest({name: 'sha-256'}, data);
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'78a6273103d17c39a0b6126e226cec70e33337f4bc6a38067401b54a33e78ead'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 1: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test crypto.webkitSubtle.digest.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-SHA384 of []
-PASS bytesToHexString(new Uint8Array(digest)) is '38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b'
-SHA384 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is 'bec021b4f368e3069134e012c2b4307083d3a9bdd206e24e5f0d86e13d6636655933ec2b413465966817a9c208a11717'
-SHA384 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '89bfcf569ae4af718510da78c67414109f5739bb5c40d51c9c8c50e2b2cee86f2f80c8b9d68f7c01201a0714572fe602'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test crypto.webkitSubtle.digest.");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- debug("SHA384 of []");
- return crypto.webkitSubtle.digest('sha-384', new Uint8Array([]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b'");
-
- debug("SHA384 of [0x0]")
- return crypto.webkitSubtle.digest({name: 'sha-384'}, new Uint8Array([0]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'bec021b4f368e3069134e012c2b4307083d3a9bdd206e24e5f0d86e13d6636655933ec2b413465966817a9c208a11717'");
-
- debug("SHA384 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
- var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
- return crypto.webkitSubtle.digest({name: 'sha-384'}, data);
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'89bfcf569ae4af718510da78c67414109f5739bb5c40d51c9c8c50e2b2cee86f2f80c8b9d68f7c01201a0714572fe602'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 1: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Test crypto.webkitSubtle.digest.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-SHA512 of []
-PASS bytesToHexString(new Uint8Array(digest)) is 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'
-SHA512 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is 'b8244d028981d693af7b456af8efa4cad63d282e19ff14942c246e50d9351d22704a802a71c3580b6370de4ceb293c324a8423342557d4e5c38438f0e36910ee'
-SHA512 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '8ffaee0cccc162851faf051ae38667eefd423c0164c50055f8ade00afc3705e3cdeb9900004b0e426ca66ab63aa3b99b075273f44fd37c22a3555c6fd1f37ccb'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test crypto.webkitSubtle.digest.");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- debug("SHA512 of []");
- return crypto.webkitSubtle.digest('sha-512', new Uint8Array([]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'");
-
- debug("SHA512 of [0x0]")
- return crypto.webkitSubtle.digest({name: 'sha-512'}, new Uint8Array([0]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'b8244d028981d693af7b456af8efa4cad63d282e19ff14942c246e50d9351d22704a802a71c3580b6370de4ceb293c324a8423342557d4e5c38438f0e36910ee'");
-
- debug("SHA512 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
- var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
- return crypto.webkitSubtle.digest({name: 'sha-512'}, data);
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'8ffaee0cccc162851faf051ae38667eefd423c0164c50055f8ade00afc3705e3cdeb9900004b0e426ca66ab63aa3b99b075273f44fd37c22a3555c6fd1f37ccb'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 17: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-Make sure that unwrap does not cause a crash.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Make sure that unwrap does not cause a crash.");
-
-jsTestIsAsync = true;
-
-crypto.webkitSubtle.generateKey({name: "AES-KW", length: 256}, false, ["wrapKey"]).then(function(wrappingKey) {
- return crypto.webkitSubtle.generateKey({name: "HMAC", hash: {name: "SHA-256"}}, true, ["sign", "verify"]).then(function(aesKey) {
- return crypto.webkitSubtle.wrapKey("raw", aesKey, wrappingKey, {name: "AES-KW"});
- });
-}).then(finishJSTest, finishJSTest); // OK if the browser does not crash.
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 40: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-CONSOLE MESSAGE: line 1: Key usages do not include 'unwrapKey'
-Verify that usage is respected in unwrapKey operation.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing RSA keys...
-Importing an AES key...
-Wrapping it...
-Unwrapping it...
-PASS crypto.webkitSubtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]) threw exception NotSupportedError: The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Verify that usage is respected in unwrapKey operation.");
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB"
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- d: "eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ",
- p: "4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0",
- q: "xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc",
- dp: "fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk",
- dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE",
- qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk"
-};
-var wrapAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
-var extractable = true;
-var nonExtractable = false;
-
-debug("Importing RSA keys...");
-crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["wrapKey"]).then(function(result) {
- publicKey = result;
- return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["encrypt", "decrypt", "wrapKey"]);
-}).then(function(result) {
- privateKey = result;
-
- debug("Importing an AES key...");
- aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
- return crypto.webkitSubtle.importKey("raw", aesKeyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
-}).then(function(result) {
- aesKey = result;
-
- debug("Wrapping it...");
- return crypto.webkitSubtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
- wrappedKey = result;
-
- debug("Unwrapping it...");
- // privateKey lacks unwrapKey usage.
- shouldThrow('crypto.webkitSubtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"])');
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
+++ /dev/null
-CONSOLE MESSAGE: line 28: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
-CONSOLE MESSAGE: line 1: Key usages do not include 'wrapKey'
-Verify that usage is respected in wrapKey operation.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing an RSA key...
-Importing an AES key...
-Wrapping it...
-PASS crypto.webkitSubtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm) threw exception NotSupportedError: The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Verify that usage is respected in wrapKey operation.");
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB"
-};
-
-var wrapAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
-var extractable = true;
-var nonExtractable = false;
-
-debug("Importing an RSA key...");
-crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["encrypt", "decrypt", "unwrapKey"]).then(function(result) {
- publicKey = result;
-
- debug("Importing an AES key...");
- aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
- return crypto.webkitSubtle.importKey("raw", aesKeyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
-}).then(function(result) {
- aesKey = result;
-
- debug("Wrapping it...");
- // publicKey lacks wrapKey usage.
- shouldThrow('crypto.webkitSubtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm)');
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
-CONSOLE MESSAGE: line 106: WebKitSubtleCrypto is deprecated. Please use SubtleCrypto instead.
Pass. WebKit didn't crash.
# libgcrypt-based implementation supports ecDH algorithm identifier for ECDH SPKI imports.
crypto/subtle/ecdh-import-spki-key-ecdh-identifier.html [ Pass ]
-# These are legacy APIs that we don't support, apart from a few digest algorithms.
-webkit.org/b/133122 crypto/webkitSubtle [ Skip ]
-webkit.org/b/133319 crypto/webkitSubtle/sha-1.html [ Pass ]
-webkit.org/b/133319 crypto/webkitSubtle/sha-224.html [ Pass ]
-webkit.org/b/133319 crypto/webkitSubtle/sha-256.html [ Pass ]
-webkit.org/b/133319 crypto/webkitSubtle/sha-384.html [ Pass ]
-webkit.org/b/133319 crypto/webkitSubtle/sha-512.html [ Pass ]
-webkit.org/b/133320 crypto/webkitSubtle/hmac-check-algorithm.html [ Pass ]
-webkit.org/b/133320 crypto/webkitSubtle/hmac-export-key.html [ Pass ]
-webkit.org/b/133320 crypto/webkitSubtle/hmac-generate-key.html [ Pass ]
-webkit.org/b/133320 crypto/webkitSubtle/hmac-import-jwk.html [ Pass ]
-webkit.org/b/133320 crypto/webkitSubtle/hmac-sign-verify-empty-key.html [ Pass ]
-webkit.org/b/133320 crypto/webkitSubtle/hmac-sign-verify.html [ Pass ]
-
# These are the imported web-platform-tests covering crypto sections we haven't implemented yet.
imported/w3c/web-platform-tests/WebCryptoAPI/ [ Slow ]
storage/indexeddb
imported/w3c/IndexedDB-private-browsing
imported/w3c/web-platform-tests/IndexedDB
-crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
-crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
-crypto/webkitSubtle/rsa-indexeddb-private.html
-crypto/webkitSubtle/rsa-indexeddb.html
fast/history/page-cache-indexed-closed-db.html
fast/history/page-cache-indexed-opened-db.html
crypto/subtle/rsa-indexeddb-non-exportable-private.html
http/tests/security/cross-origin-worker-indexeddb-allowed.html [ Skip ]
http/tests/security/cross-origin-worker-indexeddb.html [ Skip ]
http/tests/security/no-indexeddb-from-sandbox.html [ Skip ]
-crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html [ Skip ]
-crypto/webkitSubtle/rsa-indexeddb-non-exportable.html [ Skip ]
-crypto/webkitSubtle/rsa-indexeddb-private.html [ Skip ]
-crypto/webkitSubtle/rsa-indexeddb.html [ Skip ]
fast/history/page-cache-indexed-closed-db.html [ Skip ]
fast/history/page-cache-indexed-opened-db.html [ Skip ]
webkit.org/b/116559 storage/websql/ [ Skip ]
# TODO crypto.subtle is not yet enabled
-crypto/webkitSubtle/ [ Skip ]
crypto/subtle/ [ Skip ]
crypto/workers/subtle/ [ Skip ]
webkit.org/b/133151 js/cached-window-properties.html [ Slow ]
webkit.org/b/159754 workers/bomb.html [ Slow ]
-# We won't be supporting the deprecated interfaces.
-crypto/webkitSubtle [ Skip ]
-
# These are failures that will be enabled once the relevant parts of implementation land.
webkit.org/b/133122 crypto/subtle/aes-cfb-generate-export-key-jwk-length-128.html [ Skip ]
webkit.org/b/133122 crypto/subtle/aes-cfb-generate-export-key-jwk-length-192.html [ Skip ]
crypto/JsonWebKey.idl
crypto/RsaOtherPrimesInfo.idl
crypto/SubtleCrypto.idl
- crypto/WebKitSubtleCrypto.idl
crypto/keys/CryptoAesKeyAlgorithm.idl
crypto/keys/CryptoEcKeyAlgorithm.idl
bindings/js/JSDeprecatedCSSOMValueCustom.cpp
bindings/js/JSCallbackData.cpp
bindings/js/JSCanvasRenderingContext2DCustom.cpp
- bindings/js/JSCryptoAlgorithmDictionary.cpp
- bindings/js/JSCryptoKeySerializationJWK.cpp
- bindings/js/JSCryptoOperationData.cpp
bindings/js/JSCustomElementInterface.cpp
bindings/js/JSCustomElementRegistryCustom.cpp
bindings/js/JSCustomEventCustom.cpp
bindings/js/JSWebGLRenderingContextCustom.cpp
bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp
bindings/js/JSWebGPURenderingContextCustom.cpp
- bindings/js/JSWebKitSubtleCryptoCustom.cpp
bindings/js/JSWorkerGlobalScopeBase.cpp
bindings/js/JSWorkerGlobalScopeCustom.cpp
bindings/js/JSXMLDocumentCustom.cpp
crypto/CryptoAlgorithmRegistry.cpp
crypto/CryptoKey.cpp
crypto/SubtleCrypto.cpp
- crypto/WebKitSubtleCrypto.cpp
crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
crypto/algorithms/CryptoAlgorithmAES_CFB.cpp
crypto/keys/CryptoKeyHMAC.cpp
crypto/keys/CryptoKeyRSA.cpp
crypto/keys/CryptoKeyRaw.cpp
- crypto/keys/CryptoKeySerializationRaw.cpp
css/BasicShapeFunctions.cpp
css/CSSAspectRatioValue.cpp
+2017-08-18 Sam Weinig <sam@webkit.org>
+
+ Remove the deprecated WebKitSubtleCrypto interface
+ https://bugs.webkit.org/show_bug.cgi?id=164938
+ <rdar://problem/29894563>
+
+ Reviewed by Chris Dumez.
+
+ Remove WebKitSubtleCrypto and all of its helper classes / functionality.
+
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSCryptoAlgorithmDictionary.cpp: Removed.
+ * bindings/js/JSCryptoAlgorithmDictionary.h: Removed.
+ * bindings/js/JSCryptoKeySerializationJWK.cpp: Removed.
+ * bindings/js/JSCryptoKeySerializationJWK.h: Removed.
+ * bindings/js/JSCryptoOperationData.cpp: Removed.
+ * bindings/js/JSCryptoOperationData.h: Removed.
+ * bindings/js/JSWebKitSubtleCryptoCustom.cpp: Removed.
+ * crypto/CryptoAlgorithm.cpp:
+ (WebCore::CryptoAlgorithm::deriveKey): Deleted.
+ (WebCore::CryptoAlgorithm::encryptForWrapKey): Deleted.
+ (WebCore::CryptoAlgorithm::decryptForUnwrapKey): Deleted.
+ * crypto/CryptoAlgorithm.h:
+ * crypto/CryptoAlgorithmParametersDeprecated.h: Removed.
+ * crypto/CryptoKeySerialization.h: Removed.
+ * crypto/WebKitSubtleCrypto.cpp: Removed.
+ * crypto/WebKitSubtleCrypto.h: Removed.
+ * crypto/WebKitSubtleCrypto.idl: Removed.
+ * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
+ (WebCore::CryptoAlgorithmAES_CBC::keyAlgorithmMatches const): Deleted.
+ * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
+ * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
+ (WebCore::CryptoAlgorithmAES_KW::encryptForWrapKey): Deleted.
+ (WebCore::CryptoAlgorithmAES_KW::decryptForUnwrapKey): Deleted.
+ * crypto/algorithms/CryptoAlgorithmAES_KW.h:
+ * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
+ (WebCore::CryptoAlgorithmHMAC::keyAlgorithmMatches const): Deleted.
+ * crypto/algorithms/CryptoAlgorithmHMAC.h:
+ * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
+ * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
+ * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
+ (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::keyAlgorithmMatches const): Deleted.
+ * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
+ * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
+ (WebCore::CryptoAlgorithmRSA_OAEP::keyAlgorithmMatches const): Deleted.
+ * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
+ * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
+ * crypto/algorithms/CryptoAlgorithmSHA1.h:
+ * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
+ * crypto/algorithms/CryptoAlgorithmSHA224.h:
+ * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
+ * crypto/algorithms/CryptoAlgorithmSHA256.h:
+ * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
+ * crypto/algorithms/CryptoAlgorithmSHA384.h:
+ * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
+ * crypto/algorithms/CryptoAlgorithmSHA512.h:
+ * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
+ * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
+ (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Deleted.
+ (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Deleted.
+ * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
+ * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
+ * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
+ * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
+ * crypto/keys/CryptoKeySerializationRaw.cpp: Removed.
+ * crypto/keys/CryptoKeySerializationRaw.h: Removed.
+ * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
+ * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
+ (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Deleted.
+ (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Deleted.
+ * crypto/mac/CryptoAlgorithmHMACMac.cpp:
+ * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
+ * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
+ * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
+ * crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h: Removed.
+ * crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h: Removed.
+ * crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h: Removed.
+ * crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h: Removed.
+ * crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h: Removed.
+ * crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h: Removed.
+ * crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h: Removed.
+ * crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h: Removed.
+ * features.json:
+ * page/Crypto.cpp:
+ * page/Crypto.h:
+ * page/Crypto.idl:
+
2017-08-18 Tim Horton <timothy_horton@apple.com>
Remove classic mode screen scale clamping
#include "JSWebKitNamedFlow.cpp"
#include "JSWebKitPlaybackTargetAvailabilityEvent.cpp"
#include "JSWebKitPoint.cpp"
-#include "JSWebKitSubtleCrypto.cpp"
#include "JSWebKitTransitionEvent.cpp"
#include "JSWebSocket.cpp"
#include "JSWheelEvent.cpp"
$(WebCore)/crypto/JsonWebKey.idl \
$(WebCore)/crypto/RsaOtherPrimesInfo.idl \
$(WebCore)/crypto/SubtleCrypto.idl \
- $(WebCore)/crypto/WebKitSubtleCrypto.idl \
$(WebCore)/crypto/keys/CryptoAesKeyAlgorithm.idl \
$(WebCore)/crypto/keys/CryptoEcKeyAlgorithm.idl \
$(WebCore)/crypto/keys/CryptoHmacKeyAlgorithm.idl \
5706A6961DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5706A6951DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h */; };
5706A6981DDE5E4600A03B14 /* JSRsaOaepParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5706A6971DDE5E4600A03B14 /* JSRsaOaepParams.h */; };
5706A69A1DDE5E8500A03B14 /* JSRsaOaepParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5706A6991DDE5E8500A03B14 /* JSRsaOaepParams.cpp */; };
- 5709E8CD1D413D47003244AC /* WebKitSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */; };
- 5709E8CE1D413D5B003244AC /* JSWebKitSubtleCryptoCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F661807460800132674 /* JSWebKitSubtleCryptoCustom.cpp */; };
- 5709E8CF1D413D9A003244AC /* WebKitSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */; };
- 570A99DA1D417408004EC630 /* JSWebKitSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F62180745D800132674 /* JSWebKitSubtleCrypto.cpp */; };
- 570A99DB1D41A2F3004EC630 /* JSWebKitSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F63180745D800132674 /* JSWebKitSubtleCrypto.h */; };
571252691E524EB1008FF369 /* CryptoAlgorithmAES_CFB.h in Headers */ = {isa = PBXBuildFile; fileRef = 571252681E524EB1008FF369 /* CryptoAlgorithmAES_CFB.h */; };
571F21891DA57C54005C9EFD /* JSSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */; };
571F218B1DA57C7B005C9EFD /* JSSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */; };
E125F8351822F18A00D84CD9 /* CryptoKeyHMAC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F8331822F18A00D84CD9 /* CryptoKeyHMAC.cpp */; };
E125F8361822F18A00D84CD9 /* CryptoKeyHMAC.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F8341822F18A00D84CD9 /* CryptoKeyHMAC.h */; };
E125F8381822F1EB00D84CD9 /* CryptoAlgorithmHMACMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F8371822F1EB00D84CD9 /* CryptoAlgorithmHMACMac.cpp */; };
- E125F83A1824104800D84CD9 /* CryptoAlgorithmAesCbcParamsDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F8391824104800D84CD9 /* CryptoAlgorithmAesCbcParamsDeprecated.h */; };
- E125F83D182411E700D84CD9 /* JSCryptoOperationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F83B182411E700D84CD9 /* JSCryptoOperationData.cpp */; };
- E125F83E182411E700D84CD9 /* JSCryptoOperationData.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F83C182411E700D84CD9 /* JSCryptoOperationData.h */; };
E125F8411824253A00D84CD9 /* CryptoAlgorithmAES_CBC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F83F1824253A00D84CD9 /* CryptoAlgorithmAES_CBC.cpp */; };
E125F8421824253A00D84CD9 /* CryptoAlgorithmAES_CBC.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F8401824253A00D84CD9 /* CryptoAlgorithmAES_CBC.h */; };
E125F845182425C900D84CD9 /* CryptoAlgorithmAES_CBCMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F843182425C900D84CD9 /* CryptoAlgorithmAES_CBCMac.cpp */; };
E125F84D1824289D00D84CD9 /* CryptoKeyAES.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F84B1824289D00D84CD9 /* CryptoKeyAES.cpp */; };
E125F84E1824289D00D84CD9 /* CryptoKeyAES.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F84C1824289D00D84CD9 /* CryptoKeyAES.h */; };
- E125F85118283A5600D84CD9 /* JSCryptoKeySerializationJWK.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F84F18283A5600D84CD9 /* JSCryptoKeySerializationJWK.cpp */; };
- E125F85218283A5600D84CD9 /* JSCryptoKeySerializationJWK.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F85018283A5600D84CD9 /* JSCryptoKeySerializationJWK.h */; };
- E125F856182C0F8300D84CD9 /* CryptoKeySerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F855182C0F8300D84CD9 /* CryptoKeySerialization.h */; };
- E125F859182C1AA600D84CD9 /* CryptoKeySerializationRaw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F857182C1AA600D84CD9 /* CryptoKeySerializationRaw.cpp */; };
- E125F85A182C1AA600D84CD9 /* CryptoKeySerializationRaw.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F858182C1AA600D84CD9 /* CryptoKeySerializationRaw.h */; };
E125F85E182C2DF600D84CD9 /* CryptoKeyData.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F85D182C2DF600D84CD9 /* CryptoKeyData.h */; };
E125F863182C303A00D84CD9 /* CryptoKeyDataOctetSequence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F861182C303A00D84CD9 /* CryptoKeyDataOctetSequence.cpp */; };
E125F864182C303A00D84CD9 /* CryptoKeyDataOctetSequence.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F862182C303A00D84CD9 /* CryptoKeyDataOctetSequence.h */; };
E19AC3F31824DC7900349426 /* CryptoAlgorithmSHA384.h in Headers */ = {isa = PBXBuildFile; fileRef = E19AC3EB1824DC7900349426 /* CryptoAlgorithmSHA384.h */; };
E19AC3F41824DC7900349426 /* CryptoAlgorithmSHA512.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E19AC3EC1824DC7900349426 /* CryptoAlgorithmSHA512.cpp */; };
E19AC3F51824DC7900349426 /* CryptoAlgorithmSHA512.h in Headers */ = {isa = PBXBuildFile; fileRef = E19AC3ED1824DC7900349426 /* CryptoAlgorithmSHA512.h */; };
- E19AC3F71824E5D100349426 /* CryptoAlgorithmAesKeyGenParamsDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E19AC3F61824E5D100349426 /* CryptoAlgorithmAesKeyGenParamsDeprecated.h */; };
E19AC3F9182566F700349426 /* CryptoKeyMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E19AC3F8182566F700349426 /* CryptoKeyMac.cpp */; };
- E19DA29C18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParamsDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E19DA29B18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParamsDeprecated.h */; };
E1A1470811102B1500EEC0F3 /* ContainerNodeAlgorithms.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A1470711102B1500EEC0F3 /* ContainerNodeAlgorithms.h */; };
E1A3162D134BC32D007C9A4F /* WebNSAttributedStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A3162B134BC32D007C9A4F /* WebNSAttributedStringExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
E1A3162E134BC32D007C9A4F /* WebNSAttributedStringExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1A3162C134BC32D007C9A4F /* WebNSAttributedStringExtras.mm */; };
E1BB84AD1822CA7400525043 /* CryptoAlgorithmRegistryMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1BB84AC1822CA7400525043 /* CryptoAlgorithmRegistryMac.cpp */; };
E1BD3319182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1BD3317182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp */; };
E1BD331A182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.h in Headers */ = {isa = PBXBuildFile; fileRef = E1BD3318182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.h */; };
- E1BD331C182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E1BD331B182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h */; };
- E1BD331E182D8F4200C05D9F /* CryptoAlgorithmRsaKeyGenParamsDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E1BD331D182D8F4200C05D9F /* CryptoAlgorithmRsaKeyGenParamsDeprecated.h */; };
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1BE512B0CF6C512002EA959 /* XSLTUnicodeSort.cpp */; };
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */ = {isa = PBXBuildFile; fileRef = E1BE512C0CF6C512002EA959 /* XSLTUnicodeSort.h */; };
E1C266D818317AB4003F8B33 /* CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C266D618317AB4003F8B33 /* CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp */; };
- E1C266DB18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C266DA18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h */; };
E1C266DE18319F31003F8B33 /* CryptoKeyDataRSAComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C266DC18319F31003F8B33 /* CryptoKeyDataRSAComponents.cpp */; };
E1C266DF18319F31003F8B33 /* CryptoKeyDataRSAComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C266DD18319F31003F8B33 /* CryptoKeyDataRSAComponents.h */; };
E1C362EF0EAF2AA9007410BC /* JSWorkerLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C362ED0EAF2AA9007410BC /* JSWorkerLocation.h */; };
E1C416170F6563180092D2FB /* CrossOriginAccessControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C416160F6563180092D2FB /* CrossOriginAccessControl.cpp */; };
E1C4DE690EA75C1E0023CCD6 /* ActiveDOMObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
E1C4DE6E0EA75C650023CCD6 /* ActiveDOMObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */; };
- E1C657121815F9DD00256CDD /* JSCryptoAlgorithmDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C657101815F9DD00256CDD /* JSCryptoAlgorithmDictionary.cpp */; };
- E1C657131815F9DD00256CDD /* JSCryptoAlgorithmDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C657111815F9DD00256CDD /* JSCryptoAlgorithmDictionary.h */; };
- E1C6571F1816E50300256CDD /* CryptoAlgorithmHmacParamsDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C6571E1816E50300256CDD /* CryptoAlgorithmHmacParamsDeprecated.h */; };
E1C657251816E69D00256CDD /* CryptoAlgorithmIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C657241816E69D00256CDD /* CryptoAlgorithmIdentifier.h */; };
- E1C657271816F9FE00256CDD /* CryptoAlgorithmParametersDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C657261816F9FE00256CDD /* CryptoAlgorithmParametersDeprecated.h */; };
E1C8BE5D0E8BD15A0064CB7D /* JSWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C8BE5C0E8BD15A0064CB7D /* JSWorker.cpp */; };
E1C94AF9191303F000D5A893 /* BlobPart.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C94AF7191303F000D5A893 /* BlobPart.h */; settings = {ATTRIBUTES = (Private, ); }; };
E1CAA5C60E8BD23600A73ECA /* JSWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CAA5C50E8BD23600A73ECA /* JSWorker.h */; };
E1FE1370183FECF000892F13 /* CryptoAlgorithmRSA_OAEPMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FE136E183FECF000892F13 /* CryptoAlgorithmRSA_OAEPMac.cpp */; };
E1FE137418402A6700892F13 /* CommonCryptoUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FE137218402A6700892F13 /* CommonCryptoUtilities.cpp */; };
E1FE137518402A6700892F13 /* CommonCryptoUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FE137318402A6700892F13 /* CommonCryptoUtilities.h */; };
- E1FE1377184D1E3300892F13 /* CryptoAlgorithmRsaOaepParamsDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FE1376184D1E3300892F13 /* CryptoAlgorithmRsaOaepParamsDeprecated.h */; };
E1FE137A184D21BB00892F13 /* CryptoAlgorithmAES_KW.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FE1378184D21BB00892F13 /* CryptoAlgorithmAES_KW.cpp */; };
E1FE137B184D21BB00892F13 /* CryptoAlgorithmAES_KW.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FE1379184D21BB00892F13 /* CryptoAlgorithmAES_KW.h */; };
E1FE137E184D270200892F13 /* CryptoAlgorithmAES_KWMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FE137C184D270200892F13 /* CryptoAlgorithmAES_KWMac.cpp */; };
5706A6951DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaOaepParams.h; sourceTree = "<group>"; };
5706A6971DDE5E4600A03B14 /* JSRsaOaepParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRsaOaepParams.h; sourceTree = "<group>"; };
5706A6991DDE5E8500A03B14 /* JSRsaOaepParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRsaOaepParams.cpp; sourceTree = "<group>"; };
- 5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitSubtleCrypto.cpp; sourceTree = "<group>"; };
- 5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitSubtleCrypto.h; sourceTree = "<group>"; };
- 5709E8CC1D413CE3003244AC /* WebKitSubtleCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitSubtleCrypto.idl; sourceTree = "<group>"; };
571252681E524EB1008FF369 /* CryptoAlgorithmAES_CFB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAES_CFB.h; sourceTree = "<group>"; };
5712526A1E52527C008FF369 /* CryptoAlgorithmAES_CFB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmAES_CFB.cpp; sourceTree = "<group>"; };
571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSubtleCrypto.h; sourceTree = "<group>"; };
E125F8331822F18A00D84CD9 /* CryptoKeyHMAC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyHMAC.cpp; sourceTree = "<group>"; };
E125F8341822F18A00D84CD9 /* CryptoKeyHMAC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyHMAC.h; sourceTree = "<group>"; };
E125F8371822F1EB00D84CD9 /* CryptoAlgorithmHMACMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmHMACMac.cpp; sourceTree = "<group>"; };
- E125F8391824104800D84CD9 /* CryptoAlgorithmAesCbcParamsDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAesCbcParamsDeprecated.h; sourceTree = "<group>"; };
- E125F83B182411E700D84CD9 /* JSCryptoOperationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoOperationData.cpp; sourceTree = "<group>"; };
- E125F83C182411E700D84CD9 /* JSCryptoOperationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCryptoOperationData.h; sourceTree = "<group>"; };
E125F83F1824253A00D84CD9 /* CryptoAlgorithmAES_CBC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmAES_CBC.cpp; sourceTree = "<group>"; };
E125F8401824253A00D84CD9 /* CryptoAlgorithmAES_CBC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAES_CBC.h; sourceTree = "<group>"; };
E125F843182425C900D84CD9 /* CryptoAlgorithmAES_CBCMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmAES_CBCMac.cpp; sourceTree = "<group>"; };
E125F84B1824289D00D84CD9 /* CryptoKeyAES.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyAES.cpp; sourceTree = "<group>"; };
E125F84C1824289D00D84CD9 /* CryptoKeyAES.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyAES.h; sourceTree = "<group>"; };
- E125F84F18283A5600D84CD9 /* JSCryptoKeySerializationJWK.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoKeySerializationJWK.cpp; sourceTree = "<group>"; };
- E125F85018283A5600D84CD9 /* JSCryptoKeySerializationJWK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCryptoKeySerializationJWK.h; sourceTree = "<group>"; };
- E125F855182C0F8300D84CD9 /* CryptoKeySerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeySerialization.h; sourceTree = "<group>"; };
- E125F857182C1AA600D84CD9 /* CryptoKeySerializationRaw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeySerializationRaw.cpp; sourceTree = "<group>"; };
- E125F858182C1AA600D84CD9 /* CryptoKeySerializationRaw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeySerializationRaw.h; sourceTree = "<group>"; };
E125F85D182C2DF600D84CD9 /* CryptoKeyData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyData.h; sourceTree = "<group>"; };
E125F861182C303A00D84CD9 /* CryptoKeyDataOctetSequence.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyDataOctetSequence.cpp; sourceTree = "<group>"; };
E125F862182C303A00D84CD9 /* CryptoKeyDataOctetSequence.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyDataOctetSequence.h; sourceTree = "<group>"; };
E19AC3EB1824DC7900349426 /* CryptoAlgorithmSHA384.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmSHA384.h; sourceTree = "<group>"; };
E19AC3EC1824DC7900349426 /* CryptoAlgorithmSHA512.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmSHA512.cpp; sourceTree = "<group>"; };
E19AC3ED1824DC7900349426 /* CryptoAlgorithmSHA512.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmSHA512.h; sourceTree = "<group>"; };
- E19AC3F61824E5D100349426 /* CryptoAlgorithmAesKeyGenParamsDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAesKeyGenParamsDeprecated.h; sourceTree = "<group>"; };
E19AC3F8182566F700349426 /* CryptoKeyMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyMac.cpp; sourceTree = "<group>"; };
- E19DA29B18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParamsDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmHmacKeyParamsDeprecated.h; sourceTree = "<group>"; };
E1A1470711102B1500EEC0F3 /* ContainerNodeAlgorithms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContainerNodeAlgorithms.h; sourceTree = "<group>"; };
E1A3162B134BC32D007C9A4F /* WebNSAttributedStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNSAttributedStringExtras.h; sourceTree = "<group>"; };
E1A3162C134BC32D007C9A4F /* WebNSAttributedStringExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNSAttributedStringExtras.mm; sourceTree = "<group>"; };
E1BB84AC1822CA7400525043 /* CryptoAlgorithmRegistryMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRegistryMac.cpp; sourceTree = "<group>"; };
E1BD3317182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp; sourceTree = "<group>"; };
E1BD3318182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRSASSA_PKCS1_v1_5.h; sourceTree = "<group>"; };
- E1BD331B182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaSsaParamsDeprecated.h; sourceTree = "<group>"; };
- E1BD331D182D8F4200C05D9F /* CryptoAlgorithmRsaKeyGenParamsDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaKeyGenParamsDeprecated.h; sourceTree = "<group>"; };
E1BE512B0CF6C512002EA959 /* XSLTUnicodeSort.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XSLTUnicodeSort.cpp; sourceTree = "<group>"; };
E1BE512C0CF6C512002EA959 /* XSLTUnicodeSort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSLTUnicodeSort.h; sourceTree = "<group>"; };
E1C266D618317AB4003F8B33 /* CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp; sourceTree = "<group>"; };
- E1C266DA18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h; sourceTree = "<group>"; };
E1C266DC18319F31003F8B33 /* CryptoKeyDataRSAComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyDataRSAComponents.cpp; sourceTree = "<group>"; };
E1C266DD18319F31003F8B33 /* CryptoKeyDataRSAComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyDataRSAComponents.h; sourceTree = "<group>"; };
E1C362ED0EAF2AA9007410BC /* JSWorkerLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerLocation.h; sourceTree = "<group>"; };
E1C416160F6563180092D2FB /* CrossOriginAccessControl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrossOriginAccessControl.cpp; sourceTree = "<group>"; };
E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActiveDOMObject.h; sourceTree = "<group>"; };
E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActiveDOMObject.cpp; sourceTree = "<group>"; };
- E1C657101815F9DD00256CDD /* JSCryptoAlgorithmDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoAlgorithmDictionary.cpp; sourceTree = "<group>"; };
- E1C657111815F9DD00256CDD /* JSCryptoAlgorithmDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCryptoAlgorithmDictionary.h; sourceTree = "<group>"; };
- E1C6571E1816E50300256CDD /* CryptoAlgorithmHmacParamsDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmHmacParamsDeprecated.h; sourceTree = "<group>"; };
E1C657241816E69D00256CDD /* CryptoAlgorithmIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmIdentifier.h; sourceTree = "<group>"; };
- E1C657261816F9FE00256CDD /* CryptoAlgorithmParametersDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmParametersDeprecated.h; sourceTree = "<group>"; };
E1C6CFC21746D293007B87A1 /* DOMWindowConstructors.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = DOMWindowConstructors.idl; sourceTree = "<group>"; };
E1C8BE5C0E8BD15A0064CB7D /* JSWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorker.cpp; sourceTree = "<group>"; };
E1C94AF7191303F000D5A893 /* BlobPart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobPart.h; sourceTree = "<group>"; };
E1FE136E183FECF000892F13 /* CryptoAlgorithmRSA_OAEPMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRSA_OAEPMac.cpp; sourceTree = "<group>"; };
E1FE137218402A6700892F13 /* CommonCryptoUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommonCryptoUtilities.cpp; sourceTree = "<group>"; };
E1FE137318402A6700892F13 /* CommonCryptoUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonCryptoUtilities.h; sourceTree = "<group>"; };
- E1FE1376184D1E3300892F13 /* CryptoAlgorithmRsaOaepParamsDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaOaepParamsDeprecated.h; sourceTree = "<group>"; };
E1FE1378184D21BB00892F13 /* CryptoAlgorithmAES_KW.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmAES_KW.cpp; sourceTree = "<group>"; };
E1FE1379184D21BB00892F13 /* CryptoAlgorithmAES_KW.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAES_KW.h; sourceTree = "<group>"; };
E1FE137C184D270200892F13 /* CryptoAlgorithmAES_KWMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmAES_KWMac.cpp; sourceTree = "<group>"; };
E1FF57A20F01255B00891EBB /* ThreadGlobalData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadGlobalData.h; sourceTree = "<group>"; };
E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadGlobalData.cpp; sourceTree = "<group>"; };
- E1FF8F62180745D800132674 /* JSWebKitSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitSubtleCrypto.cpp; sourceTree = "<group>"; };
- E1FF8F63180745D800132674 /* JSWebKitSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitSubtleCrypto.h; sourceTree = "<group>"; };
- E1FF8F661807460800132674 /* JSWebKitSubtleCryptoCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitSubtleCryptoCustom.cpp; sourceTree = "<group>"; };
E1FF8F6A180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRegistry.cpp; sourceTree = "<group>"; };
E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRegistry.h; sourceTree = "<group>"; };
E30592611E27A38C00D57C98 /* InlineClassicScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineClassicScript.cpp; sourceTree = "<group>"; };
1432E8460C51493800B1500F /* GCController.h */,
C585A66011D4FAC5004C3E4B /* IDBBindingUtilities.cpp */,
C585A66111D4FAC5004C3E4B /* IDBBindingUtilities.h */,
- E1C657101815F9DD00256CDD /* JSCryptoAlgorithmDictionary.cpp */,
- E1C657111815F9DD00256CDD /* JSCryptoAlgorithmDictionary.h */,
- E125F84F18283A5600D84CD9 /* JSCryptoKeySerializationJWK.cpp */,
- E125F85018283A5600D84CD9 /* JSCryptoKeySerializationJWK.h */,
- E125F83B182411E700D84CD9 /* JSCryptoOperationData.cpp */,
- E125F83C182411E700D84CD9 /* JSCryptoOperationData.h */,
9BD4E9141C462872005065BC /* JSCustomElementInterface.cpp */,
9BD4E9151C462872005065BC /* JSCustomElementInterface.h */,
7C57BFE61EDE2F5B00534A48 /* JSDOMAbstractOperations.h */,
BC5823F40C0A98DF0053F1B5 /* JSHTMLElementCustom.cpp */,
BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */,
418C395D1C8F0AAB0051C8A3 /* JSReadableStreamSourceCustom.cpp */,
- E1FF8F661807460800132674 /* JSWebKitSubtleCryptoCustom.cpp */,
);
name = Custom;
sourceTree = "<group>";
57777E3B1E71242200EE1A8D /* CryptoKeyRaw.h */,
57E2336A1DCC262400F28D01 /* CryptoKeyRSA.cpp */,
E164FAA218315BF400DB4E61 /* CryptoKeyRSA.h */,
- E125F857182C1AA600D84CD9 /* CryptoKeySerializationRaw.cpp */,
- E125F858182C1AA600D84CD9 /* CryptoKeySerializationRaw.h */,
7C9ACAA61F3CCEB400F3AA09 /* CryptoRsaHashedKeyAlgorithm.h */,
7C9ACAA71F3CCEB400F3AA09 /* CryptoRsaHashedKeyAlgorithm.idl */,
7C9ACAA21F3CCE6900F3AA09 /* CryptoRsaKeyAlgorithm.h */,
57B5F8071E5D19F200F34F90 /* AesGcmParams.idl */,
577483101DADC49900716EF9 /* AesKeyParams.idl */,
572093D21DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcCfbParams.h */,
- E125F8391824104800D84CD9 /* CryptoAlgorithmAesCbcParamsDeprecated.h */,
57E1E5A61E8DBD3E00EE37C9 /* CryptoAlgorithmAesCtrParams.h */,
57B5F8081E5D1A9800F34F90 /* CryptoAlgorithmAesGcmParams.h */,
- E19AC3F61824E5D100349426 /* CryptoAlgorithmAesKeyGenParamsDeprecated.h */,
577483111DADC55D00716EF9 /* CryptoAlgorithmAesKeyParams.h */,
576814291E6F99C100E77754 /* CryptoAlgorithmEcdhKeyDeriveParams.h */,
57EEAA4D1E9FFBFC00701124 /* CryptoAlgorithmEcdsaParams.h */,
5750A97D1E6A13EF00705C4A /* CryptoAlgorithmEcKeyParams.h */,
57957CAF1E972645008072AB /* CryptoAlgorithmHkdfParams.h */,
577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h */,
- E19DA29B18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParamsDeprecated.h */,
- E1C6571E1816E50300256CDD /* CryptoAlgorithmHmacParamsDeprecated.h */,
57E657EB1E7162EA00F941CA /* CryptoAlgorithmPbkdf2Params.h */,
57E2336D1DCD43FD00F28D01 /* CryptoAlgorithmRsaHashedImportParams.h */,
57E233741DCD6D3B00F28D01 /* CryptoAlgorithmRsaHashedKeyGenParams.h */,
57FEDD3E1DB6D59200EB96F5 /* CryptoAlgorithmRsaKeyGenParams.h */,
- E1BD331D182D8F4200C05D9F /* CryptoAlgorithmRsaKeyGenParamsDeprecated.h */,
- E1C266DA18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h */,
5706A6951DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h */,
- E1FE1376184D1E3300892F13 /* CryptoAlgorithmRsaOaepParamsDeprecated.h */,
5721A9881ECE57040081295A /* CryptoAlgorithmRsaPssParams.h */,
- E1BD331B182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h */,
576814281E6F98AD00E77754 /* EcdhKeyDeriveParams.idl */,
57EEAA4E1E9FFBFC00701124 /* EcdsaParams.idl */,
5750A97C1E6A12B400705C4A /* EcKeyParams.idl */,
E1C657241816E69D00256CDD /* CryptoAlgorithmIdentifier.h */,
573489381DAC6B6D00DC0667 /* CryptoAlgorithmParameters.h */,
574AC7531DAC367D00E9744C /* CryptoAlgorithmParameters.idl */,
- E1C657261816F9FE00256CDD /* CryptoAlgorithmParametersDeprecated.h */,
E1FF8F6A180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp */,
E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */,
E157A8E218173A3A009F821D /* CryptoKey.cpp */,
7C9ACAC91F40B96A00F3AA09 /* CryptoKeyFormat.h */,
E1F80B8618317252007885C3 /* CryptoKeyPair.h */,
E1F80B8418317247007885C3 /* CryptoKeyPair.idl */,
- E125F855182C0F8300D84CD9 /* CryptoKeySerialization.h */,
E19727151820549E00592D51 /* CryptoKeyType.h */,
E172AF6F180F289500FBADB9 /* CryptoKeyUsage.h */,
57D0018B1DD3DBA400ED19D9 /* CryptoKeyUsage.idl */,
5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */,
5778BD811DA4802C009E3009 /* SubtleCrypto.h */,
5778BD801DA4733E009E3009 /* SubtleCrypto.idl */,
- 5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */,
- 5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */,
- 5709E8CC1D413CE3003244AC /* WebKitSubtleCrypto.idl */,
);
path = crypto;
sourceTree = "<group>";
575471991ECE5D2A00DD63B2 /* JSRsaPssParams.h */,
571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */,
571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */,
- E1FF8F62180745D800132674 /* JSWebKitSubtleCrypto.cpp */,
- E1FF8F63180745D800132674 /* JSWebKitSubtleCrypto.h */,
);
name = Crypto;
sourceTree = "<group>";
57B5F7F91E5BE84000F34F90 /* CryptoAlgorithmAES_GCM.h in Headers */,
E1FE137B184D21BB00892F13 /* CryptoAlgorithmAES_KW.h in Headers */,
572093D31DDCEB9A00310AB0 /* CryptoAlgorithmAesCbcCfbParams.h in Headers */,
- E125F83A1824104800D84CD9 /* CryptoAlgorithmAesCbcParamsDeprecated.h in Headers */,
57E1E5A71E8DBD3E00EE37C9 /* CryptoAlgorithmAesCtrParams.h in Headers */,
57B5F8091E5D1A9800F34F90 /* CryptoAlgorithmAesGcmParams.h in Headers */,
- E19AC3F71824E5D100349426 /* CryptoAlgorithmAesKeyGenParamsDeprecated.h in Headers */,
577483121DADC55D00716EF9 /* CryptoAlgorithmAesKeyParams.h in Headers */,
5750A9871E6A216800705C4A /* CryptoAlgorithmECDH.h in Headers */,
5768142A1E6F99C100E77754 /* CryptoAlgorithmEcdhKeyDeriveParams.h in Headers */,
57957CB21E972645008072AB /* CryptoAlgorithmHkdfParams.h in Headers */,
E125F8321822F11B00D84CD9 /* CryptoAlgorithmHMAC.h in Headers */,
577483191DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h in Headers */,
- E19DA29C18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParamsDeprecated.h in Headers */,
- E1C6571F1816E50300256CDD /* CryptoAlgorithmHmacParamsDeprecated.h in Headers */,
E1C657251816E69D00256CDD /* CryptoAlgorithmIdentifier.h in Headers */,
573489391DAC6B6E00DC0667 /* CryptoAlgorithmParameters.h in Headers */,
- E1C657271816F9FE00256CDD /* CryptoAlgorithmParametersDeprecated.h in Headers */,
57777E391E71217D00EE1A8D /* CryptoAlgorithmPBKDF2.h in Headers */,
57E657EC1E7162EA00F941CA /* CryptoAlgorithmPbkdf2Params.h in Headers */,
E1FF8F6D180DB5BE00132674 /* CryptoAlgorithmRegistry.h in Headers */,
E1233F0D185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h in Headers */,
57E2336E1DCD43FD00F28D01 /* CryptoAlgorithmRsaHashedImportParams.h in Headers */,
57FEDD3F1DB6D59200EB96F5 /* CryptoAlgorithmRsaKeyGenParams.h in Headers */,
- E1BD331E182D8F4200C05D9F /* CryptoAlgorithmRsaKeyGenParamsDeprecated.h in Headers */,
- E1C266DB18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h in Headers */,
5706A6961DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h in Headers */,
- E1FE1377184D1E3300892F13 /* CryptoAlgorithmRsaOaepParamsDeprecated.h in Headers */,
5721A98B1ECE57040081295A /* CryptoAlgorithmRsaPssParams.h in Headers */,
E1BD331A182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.h in Headers */,
- E1BD331C182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h in Headers */,
E125F82C1822CFEC00D84CD9 /* CryptoAlgorithmSHA1.h in Headers */,
E19AC3EF1824DC7900349426 /* CryptoAlgorithmSHA224.h in Headers */,
E19AC3F11824DC7900349426 /* CryptoAlgorithmSHA256.h in Headers */,
E1F80B8818317252007885C3 /* CryptoKeyPair.h in Headers */,
57E657DF1E71373A00F941CA /* CryptoKeyRaw.h in Headers */,
E164FAA318315BF400DB4E61 /* CryptoKeyRSA.h in Headers */,
- E125F856182C0F8300D84CD9 /* CryptoKeySerialization.h in Headers */,
- E125F85A182C1AA600D84CD9 /* CryptoKeySerializationRaw.h in Headers */,
E19727161820549E00592D51 /* CryptoKeyType.h in Headers */,
E172AF70180F289500FBADB9 /* CryptoKeyUsage.h in Headers */,
7C9ACAA81F3CCEB400F3AA09 /* CryptoRsaHashedKeyAlgorithm.h in Headers */,
77D510021ED4F71800DA4C87 /* JSCredentialUserData.h in Headers */,
975CA2A21303679D00E99AD9 /* JSCrypto.h in Headers */,
7C9ACAB81F3CF1AE00F3AA09 /* JSCryptoAesKeyAlgorithm.h in Headers */,
- E1C657131815F9DD00256CDD /* JSCryptoAlgorithmDictionary.h in Headers */,
5739E12F1DAC7F7800E14383 /* JSCryptoAlgorithmParameters.h in Headers */,
7C9ACABA1F3CF1AE00F3AA09 /* JSCryptoEcKeyAlgorithm.h in Headers */,
7C9ACABC1F3CF1AE00F3AA09 /* JSCryptoHmacKeyAlgorithm.h in Headers */,
E157A8E11817331C009F821D /* JSCryptoKey.h in Headers */,
7C9ACABE1F3CF1AF00F3AA09 /* JSCryptoKeyAlgorithm.h in Headers */,
E1F80B8E183172B5007885C3 /* JSCryptoKeyPair.h in Headers */,
- E125F85218283A5600D84CD9 /* JSCryptoKeySerializationJWK.h in Headers */,
57D0018D1DD5413200ED19D9 /* JSCryptoKeyUsage.h in Headers */,
- E125F83E182411E700D84CD9 /* JSCryptoOperationData.h in Headers */,
7C9ACAC01F3CF1AF00F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.h in Headers */,
7C9ACAC21F3CF1AF00F3AA09 /* JSCryptoRsaKeyAlgorithm.h in Headers */,
BC46C1FD0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h in Headers */,
7CC69941191EC5F500AF2270 /* JSWebKitNamespace.h in Headers */,
0FDA7C271883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h in Headers */,
494BD79E0F55C94C00747828 /* JSWebKitPoint.h in Headers */,
- 570A99DB1D41A2F3004EC630 /* JSWebKitSubtleCrypto.h in Headers */,
31C0FF400E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h in Headers */,
5DA5E0FD102B953800088CF9 /* JSWebSocket.h in Headers */,
65DF320609D1CC60000BE325 /* JSWheelEvent.h in Headers */,
7C48A6D1191C9D6500026674 /* WebKitNamespace.h in Headers */,
A5DEBDA416FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h in Headers */,
494BD7950F55C8EE00747828 /* WebKitPoint.h in Headers */,
- 5709E8CF1D413D9A003244AC /* WebKitSubtleCrypto.h in Headers */,
31C0FF250E4CEB6E007D6FE5 /* WebKitTransitionEvent.h in Headers */,
0FCF332F0F2B9A25004B6795 /* WebLayer.h in Headers */,
0709D78F1AE55554004E42F8 /* WebMediaSessionManager.h in Headers */,
57E657E01E71397800F941CA /* CryptoKeyRaw.cpp in Sources */,
57E2336B1DCC262400F28D01 /* CryptoKeyRSA.cpp in Sources */,
E164FAA518315E1A00DB4E61 /* CryptoKeyRSAMac.cpp in Sources */,
- E125F859182C1AA600D84CD9 /* CryptoKeySerializationRaw.cpp in Sources */,
316FE1130E6E1DA700BF6088 /* CSSAnimationController.cpp in Sources */,
31BC742D1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.cpp in Sources */,
CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */,
77D510031ED4F71B00DA4C87 /* JSCredentialUserData.cpp in Sources */,
975CA2A11303679D00E99AD9 /* JSCrypto.cpp in Sources */,
7C9ACAB71F3CF1AE00F3AA09 /* JSCryptoAesKeyAlgorithm.cpp in Sources */,
- E1C657121815F9DD00256CDD /* JSCryptoAlgorithmDictionary.cpp in Sources */,
5739E1311DAC7FD100E14383 /* JSCryptoAlgorithmParameters.cpp in Sources */,
7C9ACAB91F3CF1AE00F3AA09 /* JSCryptoEcKeyAlgorithm.cpp in Sources */,
7C9ACABB1F3CF1AE00F3AA09 /* JSCryptoHmacKeyAlgorithm.cpp in Sources */,
E157A8E01817331C009F821D /* JSCryptoKey.cpp in Sources */,
7C9ACABD1F3CF1AE00F3AA09 /* JSCryptoKeyAlgorithm.cpp in Sources */,
E1F80B8D183172B5007885C3 /* JSCryptoKeyPair.cpp in Sources */,
- E125F85118283A5600D84CD9 /* JSCryptoKeySerializationJWK.cpp in Sources */,
57D0018F1DD5415300ED19D9 /* JSCryptoKeyUsage.cpp in Sources */,
- E125F83D182411E700D84CD9 /* JSCryptoOperationData.cpp in Sources */,
7C9ACABF1F3CF1AF00F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.cpp in Sources */,
7C9ACAC11F3CF1AF00F3AA09 /* JSCryptoRsaKeyAlgorithm.cpp in Sources */,
BC46C1FC0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp in Sources */,
7CC69940191EC5F500AF2270 /* JSWebKitNamespace.cpp in Sources */,
0FDA7C261883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp in Sources */,
494BD79D0F55C94C00747828 /* JSWebKitPoint.cpp in Sources */,
- 570A99DA1D417408004EC630 /* JSWebKitSubtleCrypto.cpp in Sources */,
- 5709E8CE1D413D5B003244AC /* JSWebKitSubtleCryptoCustom.cpp in Sources */,
31C0FF3F0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp in Sources */,
5DA5E0FC102B953800088CF9 /* JSWebSocket.cpp in Sources */,
65DF320509D1CC60000BE325 /* JSWheelEvent.cpp in Sources */,
D7613A501474F13F00DB8606 /* WebKitNamedFlow.cpp in Sources */,
7C48A6D0191C9D6500026674 /* WebKitNamespace.cpp in Sources */,
A5DEBDA316FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp in Sources */,
- 5709E8CD1D413D47003244AC /* WebKitSubtleCrypto.cpp in Sources */,
31C0FF240E4CEB6E007D6FE5 /* WebKitTransitionEvent.cpp in Sources */,
0FCF332E0F2B9A25004B6795 /* WebLayer.mm in Sources */,
0709D78E1AE55554004E42F8 /* WebMediaSessionManager.cpp in Sources */,
+++ /dev/null
-/*
- * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSCryptoAlgorithmDictionary.h"
-
-#if ENABLE(SUBTLE_CRYPTO)
-
-#include "CryptoAlgorithmAesCbcParamsDeprecated.h"
-#include "CryptoAlgorithmAesKeyGenParamsDeprecated.h"
-#include "CryptoAlgorithmHmacKeyParamsDeprecated.h"
-#include "CryptoAlgorithmHmacParamsDeprecated.h"
-#include "CryptoAlgorithmParameters.h"
-#include "CryptoAlgorithmRegistry.h"
-#include "CryptoAlgorithmRsaKeyGenParamsDeprecated.h"
-#include "CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h"
-#include "CryptoAlgorithmRsaOaepParamsDeprecated.h"
-#include "CryptoAlgorithmRsaSsaParamsDeprecated.h"
-#include "JSCryptoOperationData.h"
-#include "JSDOMBinding.h"
-#include "JSDOMConvertBufferSource.h"
-#include "JSDOMConvertNumbers.h"
-#include "JSDOMConvertStrings.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-static inline JSValue getProperty(ExecState& state, JSObject* object, const char* name)
-{
- return object->get(&state, Identifier::fromString(&state, name));
-}
-
-CryptoAlgorithmIdentifier JSCryptoAlgorithmDictionary::parseAlgorithmIdentifier(ExecState& state, ThrowScope& scope, JSValue value)
-{
- // typedef (Algorithm or DOMString) AlgorithmIdentifier;
-
- String algorithmName;
- VM& vm = state.vm();
-
- if (value.isString()) {
- algorithmName = asString(value)->value(&state);
- RETURN_IF_EXCEPTION(scope, { });
- } else if (value.isObject()) {
- if (asObject(value)->inherits(vm, StringObject::info())) {
- algorithmName = asStringObject(value)->internalValue()->value(&state);
- RETURN_IF_EXCEPTION(scope, { });
- } else {
- // FIXME: This doesn't perform some checks mandated by WebIDL for dictionaries:
- // - null and undefined input should be treated as if all elements in the dictionary were undefined;
- // - undefined elements should be treated as having a default value, or as not present if there isn't such;
- // - RegExp and Date objects cannot be converted to dictionaries.
- //
- // This is partially because we don't implement it elsewhere in WebCore yet, and partially because
- // WebCrypto doesn't yet clearly specify what to do with non-present values in most cases anyway.
-
- auto nameValue = getProperty(state, asObject(value), "name");
- RETURN_IF_EXCEPTION(scope, { });
-
- algorithmName = convert<IDLDOMString>(state, nameValue);
- RETURN_IF_EXCEPTION(scope, { });
- }
- }
-
- if (!algorithmName.containsOnlyASCII()) {
- throwSyntaxError(&state, scope);
- return { };
- }
-
- auto identifier = CryptoAlgorithmRegistry::singleton().identifier(algorithmName);
- if (!identifier) {
- throwNotSupportedError(state, scope);
- return { };
- }
-
- return identifier.value();
-}
-
-static std::optional<CryptoAlgorithmIdentifier> optionalHashAlgorithm(ExecState& state, ThrowScope& scope, JSObject* object)
-{
- auto hash = getProperty(state, object, "hash");
- RETURN_IF_EXCEPTION(scope, { });
-
- if (hash.isUndefinedOrNull())
- return std::nullopt;
-
- return JSCryptoAlgorithmDictionary::parseAlgorithmIdentifier(state, scope, hash);
-}
-
-static CryptoAlgorithmIdentifier requiredHashAlgorithm(ExecState& state, ThrowScope& scope, JSObject* object)
-{
- auto result = optionalHashAlgorithm(state, scope, object);
- RETURN_IF_EXCEPTION(scope, { });
-
- if (!result) {
- throwNotSupportedError(state, scope);
- return { };
- }
-
- return result.value();
-}
-
-static RefPtr<CryptoAlgorithmParametersDeprecated> createAesCbcParams(ExecState& state, JSValue value)
-{
- auto scope = DECLARE_THROW_SCOPE(state.vm());
-
- if (!value.isObject()) {
- throwTypeError(&state, scope);
- return nullptr;
- }
-
- auto iv = getProperty(state, asObject(value), "iv");
- RETURN_IF_EXCEPTION(scope, { });
-
- auto result = adoptRef(*new CryptoAlgorithmAesCbcParamsDeprecated);
-
- auto ivData = cryptoOperationDataFromJSValue(state, scope, iv);
- RETURN_IF_EXCEPTION(scope, { });
-
- if (ivData.second != 16) {
- throwException(&state, scope, createError(&state, "AES-CBC initialization data must be 16 bytes"));
- return nullptr;
- }
-
- memcpy(result->iv.data(), ivData.first, ivData.second);
-
- return WTFMove(result);
-}
-
-static RefPtr<CryptoAlgorithmParametersDeprecated> createAesKeyGenParams(ExecState& state, JSValue value)
-{
- auto scope = DECLARE_THROW_SCOPE(state.vm());
-
- if (!value.isObject()) {
- throwTypeError(&state, scope);
- return nullptr;
- }
-
- auto result = adoptRef(*new CryptoAlgorithmAesKeyGenParamsDeprecated);
-
- auto lengthValue = getProperty(state, asObject(value), "length");
- RETURN_IF_EXCEPTION(scope, nullptr);
-
- result->length = convert<IDLEnforceRangeAdaptor<IDLUnsignedShort>>(state, lengthValue);
-
- return WTFMove(result);
-}
-
-static RefPtr<CryptoAlgorithmParametersDeprecated> createHmacParams(ExecState& state, JSValue value)
-{
- auto scope = DECLARE_THROW_SCOPE(state.vm());
-
- if (!value.isObject()) {
- throwTypeError(&state, scope);
- return nullptr;
- }
-
- auto result = adoptRef(*new CryptoAlgorithmHmacParamsDeprecated);
-
- result->hash = requiredHashAlgorithm(state, scope, asObject(value));
- RETURN_IF_EXCEPTION(scope, { });
-
- return WTFMove(result);
-}
-
-static RefPtr<CryptoAlgorithmParametersDeprecated> createHmacKeyParams(ExecState& state, JSValue value)
-{
- auto scope = DECLARE_THROW_SCOPE(state.vm());
-
- if (!value.isObject()) {
- throwTypeError(&state, scope);
- return nullptr;
- }
-
- auto result = adoptRef(*new CryptoAlgorithmHmacKeyParamsDeprecated);
-
- result->hash = requiredHashAlgorithm(state, scope, asObject(value));
- RETURN_IF_EXCEPTION(scope, { });
-
- auto lengthValue = getProperty(state, asObject(value), "length");
- RETURN_IF_EXCEPTION(scope, nullptr);
-
- result->length = convert<IDLUnsignedShort>(state, lengthValue);
- RETURN_IF_EXCEPTION(scope, nullptr);
-
- result->hasLength = true;
-
- return WTFMove(result);
-}
-
-static RefPtr<CryptoAlgorithmParametersDeprecated> createRsaKeyGenParams(ExecState& state, JSValue value)
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- if (!value.isObject()) {
- throwTypeError(&state, scope);
- return nullptr;
- }
-
- auto result = adoptRef(*new CryptoAlgorithmRsaKeyGenParamsDeprecated);
-
- auto modulusLengthValue = getProperty(state, asObject(value), "modulusLength");
- RETURN_IF_EXCEPTION(scope, nullptr);
-
- // FIXME: Why no EnforceRange? Filed as <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23779>.
- result->modulusLength = convert<IDLUnsignedLong>(state, modulusLengthValue);
- RETURN_IF_EXCEPTION(scope, nullptr);
-
- auto publicExponentValue = getProperty(state, asObject(value), "publicExponent");
- RETURN_IF_EXCEPTION(scope, nullptr);
-
- auto publicExponentArray = toUnsharedUint8Array(vm, publicExponentValue);
- if (!publicExponentArray) {
- throwTypeError(&state, scope, ASCIILiteral("Expected a Uint8Array in publicExponent"));
- return nullptr;
- }
- result->publicExponent.append(publicExponentArray->data(), publicExponentArray->byteLength());
-
- if (auto optionalHash = optionalHashAlgorithm(state, scope, asObject(value))) {
- result->hasHash = true;
- result->hash = optionalHash.value();
- }
-
- return WTFMove(result);
-}
-
-static RefPtr<CryptoAlgorithmParametersDeprecated> createRsaKeyParamsWithHash(ExecState&, JSValue)
-{
- // WebCrypto RSA algorithms currently do not take any parameters to importKey.
- return adoptRef(*new CryptoAlgorithmRsaKeyParamsWithHashDeprecated);
-}
-
-static RefPtr<CryptoAlgorithmParametersDeprecated> createRsaOaepParams(ExecState& state, JSValue value)
-{
- auto scope = DECLARE_THROW_SCOPE(state.vm());
-
- if (!value.isObject()) {
- throwTypeError(&state, scope);
- return nullptr;
- }
-
- auto result = adoptRef(*new CryptoAlgorithmRsaOaepParamsDeprecated);
-
- result->hash = requiredHashAlgorithm(state, scope, asObject(value));
- RETURN_IF_EXCEPTION(scope, { });
-
- auto labelValue = getProperty(state, asObject(value), "label");
- RETURN_IF_EXCEPTION(scope, { });
-
- result->hasLabel = !labelValue.isUndefinedOrNull();
- if (!result->hasLabel)
- return WTFMove(result);
-
- auto labelData = cryptoOperationDataFromJSValue(state, scope, labelValue);
- RETURN_IF_EXCEPTION(scope, { });
-
- result->label.append(labelData.first, labelData.second);
-
- return WTFMove(result);
-}
-
-static RefPtr<CryptoAlgorithmParametersDeprecated> createRsaSsaParams(ExecState& state, JSValue value)
-{
- auto scope = DECLARE_THROW_SCOPE(state.vm());
-
- if (!value.isObject()) {
- throwTypeError(&state, scope);
- return nullptr;
- }
-
- auto result = adoptRef(*new CryptoAlgorithmRsaSsaParamsDeprecated);
-
- result->hash = requiredHashAlgorithm(state, scope, asObject(value));
- RETURN_IF_EXCEPTION(scope, { });
-
- return WTFMove(result);
-}
-
-RefPtr<CryptoAlgorithmParametersDeprecated> JSCryptoAlgorithmDictionary::createParametersForEncrypt(ExecState& state, ThrowScope& scope, CryptoAlgorithmIdentifier algorithm, JSValue value)
-{
- switch (algorithm) {
- case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
- return adoptRef(*new CryptoAlgorithmParametersDeprecated);
- case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSA_PSS:
- throwNotSupportedError(state, scope);
- return nullptr;
- case CryptoAlgorithmIdentifier::RSA_OAEP:
- return createRsaOaepParams(state, value);
- case CryptoAlgorithmIdentifier::ECDSA:
- case CryptoAlgorithmIdentifier::ECDH:
- case CryptoAlgorithmIdentifier::AES_CTR:
- throwNotSupportedError(state, scope);
- return nullptr;
- case CryptoAlgorithmIdentifier::AES_CBC:
- return createAesCbcParams(state, value);
- case CryptoAlgorithmIdentifier::AES_GCM:
- case CryptoAlgorithmIdentifier::AES_CFB:
- throwNotSupportedError(state, scope);
- return nullptr;
- case CryptoAlgorithmIdentifier::AES_KW:
- return adoptRef(*new CryptoAlgorithmParametersDeprecated);
- case CryptoAlgorithmIdentifier::HMAC:
- case CryptoAlgorithmIdentifier::SHA_1:
- case CryptoAlgorithmIdentifier::SHA_224:
- case CryptoAlgorithmIdentifier::SHA_256:
- case CryptoAlgorithmIdentifier::SHA_384:
- case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::HKDF:
- case CryptoAlgorithmIdentifier::PBKDF2:
- throwNotSupportedError(state, scope);
- return nullptr;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return nullptr;
-}
-
-RefPtr<CryptoAlgorithmParametersDeprecated> JSCryptoAlgorithmDictionary::createParametersForDecrypt(ExecState& state, ThrowScope& scope, CryptoAlgorithmIdentifier algorithm, JSValue value)
-{
- switch (algorithm) {
- case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
- return adoptRef(*new CryptoAlgorithmParametersDeprecated);
- case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSA_PSS:
- throwNotSupportedError(state, scope);
- return nullptr;
- case CryptoAlgorithmIdentifier::RSA_OAEP:
- return createRsaOaepParams(state, value);
- case CryptoAlgorithmIdentifier::ECDSA:
- case CryptoAlgorithmIdentifier::ECDH:
- case CryptoAlgorithmIdentifier::AES_CTR:
- throwNotSupportedError(state, scope);
- return nullptr;
- case CryptoAlgorithmIdentifier::AES_CBC:
- return createAesCbcParams(state, value);
- case CryptoAlgorithmIdentifier::AES_GCM:
- case CryptoAlgorithmIdentifier::AES_CFB:
- throwNotSupportedError(state, scope);
- return nullptr;
- case CryptoAlgorithmIdentifier::AES_KW:
- return adoptRef(*new CryptoAlgorithmParametersDeprecated);
- case CryptoAlgorithmIdentifier::HMAC:
- case CryptoAlgorithmIdentifier::SHA_1:
- case CryptoAlgorithmIdentifier::SHA_224:
- case CryptoAlgorithmIdentifier::SHA_256:
- case CryptoAlgorithmIdentifier::SHA_384:
- case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::HKDF:
- case CryptoAlgorithmIdentifier::PBKDF2:
- throwNotSupportedError(state, scope);
- return nullptr;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return nullptr;
-}
-
-RefPtr<CryptoAlgorithmParametersDeprecated> JSCryptoAlgorithmDictionary::createParametersForSign(ExecState& state, ThrowScope& scope, CryptoAlgorithmIdentifier algorithm, JSValue value)
-{
- switch (algorithm) {
- case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
- throwNotSupportedError(state, scope);
- return nullptr;
- case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
- return createRsaSsaParams(state, value);
- case CryptoAlgorithmIdentifier::RSA_PSS:
- case CryptoAlgorithmIdentifier::RSA_OAEP:
- case CryptoAlgorithmIdentifier::ECDSA:
- case CryptoAlgorithmIdentifier::ECDH:
- case CryptoAlgorithmIdentifier::AES_CTR:
- case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_GCM:
- case CryptoAlgorithmIdentifier::AES_CFB:
- case CryptoAlgorithmIdentifier::AES_KW:
- throwNotSupportedError(state, scope);
- return nullptr;
- case CryptoAlgorithmIdentifier::HMAC:
- return createHmacParams(state, value);
- case CryptoAlgorithmIdentifier::SHA_1:
- case CryptoAlgorithmIdentifier::SHA_224:
- case CryptoAlgorithmIdentifier::SHA_256:
- case CryptoAlgorithmIdentifier::SHA_384:
- case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::HKDF:
- case CryptoAlgorithmIdentifier::PBKDF2:
- throwNotSupportedError(state, scope);
- return nullptr;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return nullptr;
-}
-
-RefPtr<CryptoAlgorithmParametersDeprecated> JSCryptoAlgorithmDictionary::createParametersForVerify(ExecState& state, ThrowScope& scope, CryptoAlgorithmIdentifier algorithm, JSValue value)
-{
- switch (algorithm) {
- case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
- throwNotSupportedError(state, scope);
- return nullptr;
- case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
- return createRsaSsaParams(state, value);
- case CryptoAlgorithmIdentifier::RSA_PSS:
- case CryptoAlgorithmIdentifier::RSA_OAEP:
- case CryptoAlgorithmIdentifier::ECDSA:
- case CryptoAlgorithmIdentifier::ECDH:
- case CryptoAlgorithmIdentifier::AES_CTR:
- case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_GCM:
- case CryptoAlgorithmIdentifier::AES_CFB:
- case CryptoAlgorithmIdentifier::AES_KW:
- throwNotSupportedError(state, scope);
- return nullptr;
- case CryptoAlgorithmIdentifier::HMAC:
- return createHmacParams(state, value);
- case CryptoAlgorithmIdentifier::SHA_1:
- case CryptoAlgorithmIdentifier::SHA_224:
- case CryptoAlgorithmIdentifier::SHA_256:
- case CryptoAlgorithmIdentifier::SHA_384:
- case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::HKDF:
- case CryptoAlgorithmIdentifier::PBKDF2:
- throwNotSupportedError(state, scope);
- return nullptr;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return nullptr;
-}
-
-RefPtr<CryptoAlgorithmParametersDeprecated> JSCryptoAlgorithmDictionary::createParametersForDigest(ExecState& state, ThrowScope& scope, CryptoAlgorithmIdentifier algorithm, JSValue)
-{
- switch (algorithm) {
- case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSA_PSS:
- case CryptoAlgorithmIdentifier::RSA_OAEP:
- case CryptoAlgorithmIdentifier::ECDSA:
- case CryptoAlgorithmIdentifier::ECDH:
- case CryptoAlgorithmIdentifier::AES_CTR:
- case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_GCM:
- case CryptoAlgorithmIdentifier::AES_CFB:
- case CryptoAlgorithmIdentifier::AES_KW:
- case CryptoAlgorithmIdentifier::HMAC:
- throwNotSupportedError(state, scope);
- return nullptr;
- case CryptoAlgorithmIdentifier::SHA_1:
- case CryptoAlgorithmIdentifier::SHA_224:
- case CryptoAlgorithmIdentifier::SHA_256:
- case CryptoAlgorithmIdentifier::SHA_384:
- case CryptoAlgorithmIdentifier::SHA_512:
- return adoptRef(*new CryptoAlgorithmParametersDeprecated);
- case CryptoAlgorithmIdentifier::HKDF:
- case CryptoAlgorithmIdentifier::PBKDF2:
- throwNotSupportedError(state, scope);
- return nullptr;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return nullptr;
-}
-
-RefPtr<CryptoAlgorithmParametersDeprecated> JSCryptoAlgorithmDictionary::createParametersForGenerateKey(ExecState& state, ThrowScope& scope, CryptoAlgorithmIdentifier algorithm, JSValue value)
-{
- switch (algorithm) {
- case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSA_PSS:
- case CryptoAlgorithmIdentifier::RSA_OAEP:
- return createRsaKeyGenParams(state, value);
- case CryptoAlgorithmIdentifier::ECDSA:
- case CryptoAlgorithmIdentifier::ECDH:
- throwNotSupportedError(state, scope);
- return nullptr;
- case CryptoAlgorithmIdentifier::AES_CTR:
- case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_GCM:
- case CryptoAlgorithmIdentifier::AES_CFB:
- case CryptoAlgorithmIdentifier::AES_KW:
- return createAesKeyGenParams(state, value);
- case CryptoAlgorithmIdentifier::HMAC:
- return createHmacKeyParams(state, value);
- case CryptoAlgorithmIdentifier::SHA_1:
- case CryptoAlgorithmIdentifier::SHA_224:
- case CryptoAlgorithmIdentifier::SHA_256:
- case CryptoAlgorithmIdentifier::SHA_384:
- case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::HKDF:
- case CryptoAlgorithmIdentifier::PBKDF2:
- throwNotSupportedError(state, scope);
- return nullptr;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return nullptr;
-}
-
-RefPtr<CryptoAlgorithmParametersDeprecated> JSCryptoAlgorithmDictionary::createParametersForDeriveKey(ExecState& state, ThrowScope& scope, CryptoAlgorithmIdentifier algorithm, JSValue)
-{
- switch (algorithm) {
- case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSA_PSS:
- case CryptoAlgorithmIdentifier::RSA_OAEP:
- case CryptoAlgorithmIdentifier::ECDSA:
- case CryptoAlgorithmIdentifier::ECDH:
- case CryptoAlgorithmIdentifier::AES_CTR:
- case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_GCM:
- case CryptoAlgorithmIdentifier::AES_CFB:
- case CryptoAlgorithmIdentifier::AES_KW:
- case CryptoAlgorithmIdentifier::HMAC:
- case CryptoAlgorithmIdentifier::SHA_1:
- case CryptoAlgorithmIdentifier::SHA_224:
- case CryptoAlgorithmIdentifier::SHA_256:
- case CryptoAlgorithmIdentifier::SHA_384:
- case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::HKDF:
- case CryptoAlgorithmIdentifier::PBKDF2:
- throwNotSupportedError(state, scope);
- return nullptr;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return nullptr;
-}
-
-RefPtr<CryptoAlgorithmParametersDeprecated> JSCryptoAlgorithmDictionary::createParametersForDeriveBits(ExecState& state, ThrowScope& scope, CryptoAlgorithmIdentifier algorithm, JSValue)
-{
- switch (algorithm) {
- case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSA_PSS:
- case CryptoAlgorithmIdentifier::RSA_OAEP:
- case CryptoAlgorithmIdentifier::ECDSA:
- case CryptoAlgorithmIdentifier::ECDH:
- case CryptoAlgorithmIdentifier::AES_CTR:
- case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_GCM:
- case CryptoAlgorithmIdentifier::AES_CFB:
- case CryptoAlgorithmIdentifier::AES_KW:
- case CryptoAlgorithmIdentifier::HMAC:
- case CryptoAlgorithmIdentifier::SHA_1:
- case CryptoAlgorithmIdentifier::SHA_224:
- case CryptoAlgorithmIdentifier::SHA_256:
- case CryptoAlgorithmIdentifier::SHA_384:
- case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::HKDF:
- case CryptoAlgorithmIdentifier::PBKDF2:
- throwNotSupportedError(state, scope);
- return nullptr;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return nullptr;
-}
-
-RefPtr<CryptoAlgorithmParametersDeprecated> JSCryptoAlgorithmDictionary::createParametersForImportKey(ExecState& state, ThrowScope& scope, CryptoAlgorithmIdentifier algorithm, JSValue value)
-{
- switch (algorithm) {
- case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSA_PSS:
- case CryptoAlgorithmIdentifier::RSA_OAEP:
- return createRsaKeyParamsWithHash(state, value);
- case CryptoAlgorithmIdentifier::ECDSA:
- case CryptoAlgorithmIdentifier::ECDH:
- case CryptoAlgorithmIdentifier::AES_CTR:
- case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_GCM:
- case CryptoAlgorithmIdentifier::AES_CFB:
- case CryptoAlgorithmIdentifier::AES_KW:
- return adoptRef(*new CryptoAlgorithmParametersDeprecated);
- case CryptoAlgorithmIdentifier::HMAC:
- return createHmacParams(state, value);
- case CryptoAlgorithmIdentifier::SHA_1:
- case CryptoAlgorithmIdentifier::SHA_224:
- case CryptoAlgorithmIdentifier::SHA_256:
- case CryptoAlgorithmIdentifier::SHA_384:
- case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::HKDF:
- case CryptoAlgorithmIdentifier::PBKDF2:
- throwNotSupportedError(state, scope);
- return nullptr;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return nullptr;
-}
-
-RefPtr<CryptoAlgorithmParametersDeprecated> JSCryptoAlgorithmDictionary::createParametersForExportKey(ExecState& state, ThrowScope& scope, CryptoAlgorithmIdentifier algorithm, JSValue)
-{
- switch (algorithm) {
- case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
- case CryptoAlgorithmIdentifier::RSA_PSS:
- case CryptoAlgorithmIdentifier::RSA_OAEP:
- case CryptoAlgorithmIdentifier::ECDSA:
- case CryptoAlgorithmIdentifier::ECDH:
- case CryptoAlgorithmIdentifier::AES_CTR:
- case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_GCM:
- case CryptoAlgorithmIdentifier::AES_CFB:
- case CryptoAlgorithmIdentifier::AES_KW:
- case CryptoAlgorithmIdentifier::HMAC:
- return adoptRef(*new CryptoAlgorithmParametersDeprecated);
- case CryptoAlgorithmIdentifier::SHA_1:
- case CryptoAlgorithmIdentifier::SHA_224:
- case CryptoAlgorithmIdentifier::SHA_256:
- case CryptoAlgorithmIdentifier::SHA_384:
- case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::HKDF:
- case CryptoAlgorithmIdentifier::PBKDF2:
- throwNotSupportedError(state, scope);
- return nullptr;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return nullptr;
-}
-
-}
-
-#endif // ENABLE(SUBTLE_CRYPTO)
+++ /dev/null
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(SUBTLE_CRYPTO)
-
-#include "CryptoAlgorithmIdentifier.h"
-#include <wtf/Forward.h>
-
-namespace JSC {
-class ExecState;
-class JSValue;
-class ThrowScope;
-}
-
-namespace WebCore {
-
-class CryptoAlgorithmParametersDeprecated;
-
-class JSCryptoAlgorithmDictionary {
-public:
- static CryptoAlgorithmIdentifier parseAlgorithmIdentifier(JSC::ExecState&, JSC::ThrowScope&, JSC::JSValue);
-
- static RefPtr<CryptoAlgorithmParametersDeprecated> createParametersForEncrypt(JSC::ExecState&, JSC::ThrowScope&, CryptoAlgorithmIdentifier, JSC::JSValue);
- static RefPtr<CryptoAlgorithmParametersDeprecated> createParametersForDecrypt(JSC::ExecState&, JSC::ThrowScope&, CryptoAlgorithmIdentifier, JSC::JSValue);
- static RefPtr<CryptoAlgorithmParametersDeprecated> createParametersForSign(JSC::ExecState&, JSC::ThrowScope&, CryptoAlgorithmIdentifier, JSC::JSValue);
- static RefPtr<CryptoAlgorithmParametersDeprecated> createParametersForVerify(JSC::ExecState&, JSC::ThrowScope&, CryptoAlgorithmIdentifier, JSC::JSValue);
- static RefPtr<CryptoAlgorithmParametersDeprecated> createParametersForDigest(JSC::ExecState&, JSC::ThrowScope&, CryptoAlgorithmIdentifier, JSC::JSValue);
- static RefPtr<CryptoAlgorithmParametersDeprecated> createParametersForGenerateKey(JSC::ExecState&, JSC::ThrowScope&, CryptoAlgorithmIdentifier, JSC::JSValue);
- static RefPtr<CryptoAlgorithmParametersDeprecated> createParametersForDeriveKey(JSC::ExecState&, JSC::ThrowScope&, CryptoAlgorithmIdentifier, JSC::JSValue);
- static RefPtr<CryptoAlgorithmParametersDeprecated> createParametersForDeriveBits(JSC::ExecState&, JSC::ThrowScope&, CryptoAlgorithmIdentifier, JSC::JSValue);
- static RefPtr<CryptoAlgorithmParametersDeprecated> createParametersForImportKey(JSC::ExecState&, JSC::ThrowScope&, CryptoAlgorithmIdentifier, JSC::JSValue);
- static RefPtr<CryptoAlgorithmParametersDeprecated> createParametersForExportKey(JSC::ExecState&, JSC::ThrowScope&, CryptoAlgorithmIdentifier, JSC::JSValue);
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SUBTLE_CRYPTO)
+++ /dev/null
-/*
- * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSCryptoKeySerializationJWK.h"
-
-#if ENABLE(SUBTLE_CRYPTO)
-
-#include "CryptoAlgorithm.h"
-#include "CryptoAlgorithmHmacParamsDeprecated.h"
-#include "CryptoAlgorithmRegistry.h"
-#include "CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h"
-#include "CryptoKey.h"
-#include "CryptoKeyAES.h"
-#include "CryptoKeyDataOctetSequence.h"
-#include "CryptoKeyDataRSAComponents.h"
-#include "CryptoKeyHMAC.h"
-#include "CryptoKeyRSA.h"
-#include "JSDOMBinding.h"
-#include <heap/StrongInlines.h>
-#include <runtime/JSCInlines.h>
-#include <runtime/JSONObject.h>
-#include <runtime/ObjectConstructor.h>
-#include <wtf/text/Base64.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-static bool getJSArrayFromJSON(ExecState* exec, JSObject* json, const char* key, JSArray*& result)
-{
- VM& vm = exec->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- Identifier identifier = Identifier::fromString(exec, key);
- PropertySlot slot(json, PropertySlot::InternalMethodType::Get);
-
- if (!json->getPropertySlot(exec, identifier, slot))
- return false;
-
- JSValue value = slot.getValue(exec, identifier);
- scope.assertNoException();
- if (!isJSArray(value)) {
- throwTypeError(exec, scope, String::format("Expected an array for \"%s\" JSON key", key));
- return false;
- }
-
- result = asArray(value);
-
- return true;
-}
-
-static bool getStringFromJSON(ExecState* exec, JSObject* json, const char* key, String& result)
-{
- VM& vm = exec->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- Identifier identifier = Identifier::fromString(exec, key);
- PropertySlot slot(json, PropertySlot::InternalMethodType::Get);
-
- if (!json->getPropertySlot(exec, identifier, slot))
- return false;
-
- JSValue jsValue = slot.getValue(exec, identifier);
- scope.assertNoException();
- if (!jsValue.getString(exec, result)) {
- // Can get an out of memory exception.
- RETURN_IF_EXCEPTION(scope, false);
- throwTypeError(exec, scope, String::format("Expected a string value for \"%s\" JSON key", key));
- return false;
- }
-
- return true;
-}
-
-static bool getBooleanFromJSON(ExecState* exec, JSObject* json, const char* key, bool& result)
-{
- VM& vm = exec->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- Identifier identifier = Identifier::fromString(exec, key);
- PropertySlot slot(json, PropertySlot::InternalMethodType::Get);
-
- if (!json->getPropertySlot(exec, identifier, slot))
- return false;
-
- JSValue jsValue = slot.getValue(exec, identifier);
- scope.assertNoException();
- if (!jsValue.isBoolean()) {
- throwTypeError(exec, scope, String::format("Expected a boolean value for \"%s\" JSON key", key));
- return false;
- }
-
- result = jsValue.asBoolean();
- return true;
-}
-
-static bool getBigIntegerVectorFromJSON(ExecState* exec, JSObject* json, const char* key, Vector<uint8_t>& result)
-{
- VM& vm = exec->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- String base64urlEncodedNumber;
- if (!getStringFromJSON(exec, json, key, base64urlEncodedNumber))
- return false;
-
- if (!base64URLDecode(base64urlEncodedNumber, result)) {
- throwTypeError(exec, scope, ASCIILiteral("Cannot decode base64url key data in JWK"));
- return false;
- }
-
- if (result[0] == 0) {
- throwTypeError(exec, scope, ASCIILiteral("JWK BigInteger must utilize the minimum number of octets to represent the value"));
- return false;
- }
-
- return true;
-}
-
-JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK(ExecState* exec, const String& jsonString)
- : m_exec(exec)
-{
- VM& vm = exec->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- JSValue jsonValue = JSONParse(exec, jsonString);
- if (UNLIKELY(scope.exception()))
- return;
-
- if (!jsonValue || !jsonValue.isObject()) {
- throwTypeError(exec, scope, ASCIILiteral("Invalid JWK serialization"));
- return;
- }
-
- m_json.set(vm, asObject(jsonValue));
-}
-
-JSCryptoKeySerializationJWK::~JSCryptoKeySerializationJWK()
-{
-}
-
-static Ref<CryptoAlgorithmParametersDeprecated> createHMACParameters(CryptoAlgorithmIdentifier hashFunction)
-{
- auto hmacParameters = adoptRef(*new CryptoAlgorithmHmacParamsDeprecated);
- hmacParameters->hash = hashFunction;
- return WTFMove(hmacParameters);
-}
-
-static Ref<CryptoAlgorithmParametersDeprecated> createRSAKeyParametersWithHash(CryptoAlgorithmIdentifier hashFunction)
-{
- auto rsaKeyParameters = adoptRef(*new CryptoAlgorithmRsaKeyParamsWithHashDeprecated);
- rsaKeyParameters->hasHash = true;
- rsaKeyParameters->hash = hashFunction;
- return WTFMove(rsaKeyParameters);
-}
-
-std::optional<CryptoAlgorithmPair> JSCryptoKeySerializationJWK::reconcileAlgorithm(CryptoAlgorithm* suggestedAlgorithm, CryptoAlgorithmParametersDeprecated* suggestedParameters) const
-{
- VM& vm = m_exec->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- if (!getStringFromJSON(m_exec, m_json.get(), "alg", m_jwkAlgorithmName)) {
- // Algorithm is optional in JWK.
- return CryptoAlgorithmPair { suggestedAlgorithm, suggestedParameters };
- }
-
- auto& algorithmRegisty = CryptoAlgorithmRegistry::singleton();
- RefPtr<CryptoAlgorithm> algorithm;
- RefPtr<CryptoAlgorithmParametersDeprecated> parameters;
- if (m_jwkAlgorithmName == "HS256") {
- algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::HMAC);
- parameters = createHMACParameters(CryptoAlgorithmIdentifier::SHA_256);
- } else if (m_jwkAlgorithmName == "HS384") {
- algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::HMAC);
- parameters = createHMACParameters(CryptoAlgorithmIdentifier::SHA_384);
- } else if (m_jwkAlgorithmName == "HS512") {
- algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::HMAC);
- parameters = createHMACParameters(CryptoAlgorithmIdentifier::SHA_512);
- } else if (m_jwkAlgorithmName == "RS256") {
- algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5);
- parameters = createRSAKeyParametersWithHash(CryptoAlgorithmIdentifier::SHA_256);
- } else if (m_jwkAlgorithmName == "RS384") {
- algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5);
- parameters = createRSAKeyParametersWithHash(CryptoAlgorithmIdentifier::SHA_384);
- } else if (m_jwkAlgorithmName == "RS512") {
- algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5);
- parameters = createRSAKeyParametersWithHash(CryptoAlgorithmIdentifier::SHA_512);
- } else if (m_jwkAlgorithmName == "RSA1_5") {
- algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5);
- parameters = adoptRef(*new CryptoAlgorithmRsaKeyParamsWithHashDeprecated);
- } else if (m_jwkAlgorithmName == "RSA-OAEP") {
- algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::RSA_OAEP);
- parameters = createRSAKeyParametersWithHash(CryptoAlgorithmIdentifier::SHA_1);
- } else if (m_jwkAlgorithmName == "A128CBC") {
- algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::AES_CBC);
- parameters = adoptRef(*new CryptoAlgorithmParametersDeprecated);
- } else if (m_jwkAlgorithmName == "A192CBC") {
- &