Title: [209749] trunk/LayoutTests
Revision
209749
Author
[email protected]
Date
2016-12-12 17:32:56 -0800 (Mon, 12 Dec 2016)

Log Message

[WebCrypto] Migrate some tests from webkitSubtle to subtle
https://bugs.webkit.org/show_bug.cgi?id=165554

Reviewed by Brent Fulgham.

To improve test coverage for subtle.

* crypto/crypto-key-algorithm-gc-expected.txt: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt.
* crypto/crypto-key-algorithm-gc.html: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html.
* crypto/crypto-key-usages-gc-expected.txt: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt.
* crypto/crypto-key-usages-gc.html: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html.
* crypto/subtle/resources/rsa-indexeddb-non-exportable.js: Added.
* crypto/subtle/resources/rsa-indexeddb.js: Added.
* crypto/subtle/rsa-indexeddb-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-non-exportable-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-non-exportable-private.html: Added.
* crypto/subtle/rsa-indexeddb-non-exportable.html: Added.
* crypto/subtle/rsa-indexeddb-private-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-private.html: Added.
* crypto/subtle/rsa-indexeddb.html: Added.
* crypto/subtle/rsa-oaep-plaintext-length-expected.txt: Added.
* crypto/subtle/rsa-oaep-plaintext-length.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html: Added.
* platform/ios-simulator-wk1/TestExpectations:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (209748 => 209749)


--- trunk/LayoutTests/ChangeLog	2016-12-13 01:05:15 UTC (rev 209748)
+++ trunk/LayoutTests/ChangeLog	2016-12-13 01:32:56 UTC (rev 209749)
@@ -1,3 +1,32 @@
+2016-12-07  Jiewen Tan  <[email protected]>
+
+        [WebCrypto] Migrate some tests from webkitSubtle to subtle
+        https://bugs.webkit.org/show_bug.cgi?id=165554
+
+        Reviewed by Brent Fulgham.
+
+        To improve test coverage for subtle.
+
+        * crypto/crypto-key-algorithm-gc-expected.txt: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt.
+        * crypto/crypto-key-algorithm-gc.html: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html.
+        * crypto/crypto-key-usages-gc-expected.txt: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt.
+        * crypto/crypto-key-usages-gc.html: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html.
+        * crypto/subtle/resources/rsa-indexeddb-non-exportable.js: Added.
+        * crypto/subtle/resources/rsa-indexeddb.js: Added.
+        * crypto/subtle/rsa-indexeddb-expected.txt: Added.
+        * crypto/subtle/rsa-indexeddb-non-exportable-expected.txt: Added.
+        * crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt: Added.
+        * crypto/subtle/rsa-indexeddb-non-exportable-private.html: Added.
+        * crypto/subtle/rsa-indexeddb-non-exportable.html: Added.
+        * crypto/subtle/rsa-indexeddb-private-expected.txt: Added.
+        * crypto/subtle/rsa-indexeddb-private.html: Added.
+        * crypto/subtle/rsa-indexeddb.html: Added.
+        * crypto/subtle/rsa-oaep-plaintext-length-expected.txt: Added.
+        * crypto/subtle/rsa-oaep-plaintext-length.html: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html: Added.
+        * platform/ios-simulator-wk1/TestExpectations:
+
 2016-12-12  Matt Baker  <[email protected]>
 
         Unreviewed, follow-up after r209706.

Copied: trunk/LayoutTests/crypto/crypto-key-algorithm-gc-expected.txt (from rev 209748, trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt) (0 => 209749)


--- trunk/LayoutTests/crypto/crypto-key-algorithm-gc-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/crypto/crypto-key-algorithm-gc-expected.txt	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,13 @@
+Test that CryptoKey.algorithm preserves custom properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Generating a HMAC key with default length...
+PASS key.algorithm === key.algorithm is true
+PASS key.algorithm.foo is "bar"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/crypto/crypto-key-algorithm-gc.html (from rev 209748, trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html) (0 => 209749)


--- trunk/LayoutTests/crypto/crypto-key-algorithm-gc.html	                        (rev 0)
+++ trunk/LayoutTests/crypto/crypto-key-algorithm-gc.html	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+<script src=""
+</head>
+<body>
+<script>
+
+description("Test that CryptoKey.algorithm preserves custom properties.");
+jsTestIsAsync = true;
+
+debug("\nGenerating a HMAC key with default length...");
+crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, true, ["sign", "verify"]).then(function(result) {
+    key = result;
+    startTest();
+});
+
+function startTest()
+{
+    shouldBeTrue("key.algorithm === key.algorithm");
+    key.algorithm.foo = "bar";
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBeEqualToString('key.algorithm.foo', 'bar');
+    finishJSTest();
+}
+
+</script>
+<script src=""
+</body>
+</html>

Copied: trunk/LayoutTests/crypto/crypto-key-usages-gc-expected.txt (from rev 209748, trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt) (0 => 209749)


--- trunk/LayoutTests/crypto/crypto-key-usages-gc-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/crypto/crypto-key-usages-gc-expected.txt	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,13 @@
+Test that CryptoKey.usages preserves custom properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Generating a HMAC key with default length...
+PASS key.usages === key.usages is true
+PASS key.usages.foo is "bar"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/crypto/crypto-key-usages-gc.html (from rev 209748, trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html) (0 => 209749)


--- trunk/LayoutTests/crypto/crypto-key-usages-gc.html	                        (rev 0)
+++ trunk/LayoutTests/crypto/crypto-key-usages-gc.html	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+<script src=""
+</head>
+<body>
+<script>
+
+description("Test that CryptoKey.usages preserves custom properties.");
+jsTestIsAsync = true;
+
+debug("\nGenerating a HMAC key with default length...");
+crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, true, ["sign", "verify"]).then(function(result) {
+    key = result;
+    startTest();
+});
+
+function startTest()
+{
+    shouldBeTrue("key.usages === key.usages");
+    key.usages.foo = "bar";
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBeEqualToString('key.usages.foo', 'bar');
+    finishJSTest();
+}
+
+</script>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,62 @@
+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.subtle.importKey("jwk", privateKeyJSON, { name: 'RSASSA-PKCS1-v1_5', hash: "sha-256" }, false, ["sign"]).then(function(key) {
+    var openRequest = indexedDB.open("crypto_subtle");
+    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.algorithm.hash.name", "'SHA-256'");
+            shouldBe("retrievedKey.usages", '["sign"]');
+
+            finishJSTest();
+        }
+    }
+});

Added: trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb.js (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb.js	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb.js	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,62 @@
+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.subtle.importKey("jwk", privateKeyJSON, { name: 'RSASSA-PKCS1-v1_5', hash: "sha-256" }, true, ["sign"]).then(function(key) {
+    var openRequest = indexedDB.open("crypto_subtle");
+    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.algorithm.hash.name", "'SHA-256'");
+            shouldBe("retrievedKey.usages", '["sign"]');
+
+            finishJSTest();
+        }
+    }
+}, failAndFinishJSTest);

Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,16 @@
+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.algorithm.hash.name is 'SHA-256'
+PASS retrievedKey.usages is ["sign"]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,16 @@
+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.algorithm.hash.name is 'SHA-256'
+PASS retrievedKey.usages is ["sign"]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,16 @@
+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.algorithm.hash.name is 'SHA-256'
+PASS retrievedKey.usages is ["sign"]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+enablePrivateBrowsing = true;
+</script>
+<script src=""
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,16 @@
+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.algorithm.hash.name is 'SHA-256'
+PASS retrievedKey.usages is ["sign"]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+enablePrivateBrowsing = true;
+</script>
+<script src=""
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,14 @@
+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
+

Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script src=""
+</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 extractable = true;
+
+debug("Importing RSA keys...");
+crypto.subtle.importKey("jwk", publicKeyJSON, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt"]).then(function(result) {
+    publicKey = result;
+
+    debug("Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...");
+    return crypto.subtle.encrypt("RSA-OAEP", publicKey, new Uint8Array(214));
+}).then(function(result) {
+    testPassed("Succeeded");
+    debug("Encrypting a 215 byte buffer...");
+    return crypto.subtle.encrypt("RSA-OAEP", publicKey, new Uint8Array(215));
+}).then(function(result) {
+    testFailed("Succeeded");
+    finishJSTest();
+}, function(result) {
+    testPassed("Rejected");
+    finishJSTest();
+});
+</script>
+
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,17 @@
+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 keyPair.publicKey.algorithm.hash.name is 'SHA-1'
+PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
+PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html (0 => 209749)


--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html	2016-12-13 01:32:56 UTC (rev 209749)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script src=""
+</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
+    hash: "sha-1",
+};
+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("keyPair.publicKey.algorithm.hash.name", "'SHA-1'");
+    shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
+    shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
+
+    finishJSTest();
+});
+</script>
+
+<script src=""
+</body>
+</html>

Deleted: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt (209748 => 209749)


--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt	2016-12-13 01:05:15 UTC (rev 209748)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt	2016-12-13 01:32:56 UTC (rev 209749)
@@ -1,13 +0,0 @@
-Test that CryptoKey.algorithm preserves custom properties.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Generating a HMAC key with default length...
-PASS key.algorithm === key.algorithm is true
-PASS key.algorithm.foo is "bar"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html (209748 => 209749)


--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html	2016-12-13 01:05:15 UTC (rev 209748)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html	2016-12-13 01:32:56 UTC (rev 209749)
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src=""
-<script src=""
-</head>
-<body>
-<script>
-
-description("Test that CryptoKey.algorithm preserves custom properties.");
-jsTestIsAsync = true;
-
-debug("\nGenerating a HMAC key with default length...");
-crypto.webkitSubtle.generateKey({name: "hmac", hash: "sha-1"}, true, ["sign", "verify"]).then(function(result) {
-    key = result;
-    startTest();
-});
-
-function startTest()
-{
-    shouldBeTrue("key.algorithm === key.algorithm");
-    key.algorithm.foo = "bar";
-    gc();
-    setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
-    gc();
-    setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
-    gc();
-    shouldBeEqualToString('key.algorithm.foo', 'bar');
-    finishJSTest();
-}
-
-</script>
-<script src=""
-</body>
-</html>

Deleted: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt (209748 => 209749)


--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt	2016-12-13 01:05:15 UTC (rev 209748)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt	2016-12-13 01:32:56 UTC (rev 209749)
@@ -1,13 +0,0 @@
-Test that CryptoKey.usages preserves custom properties.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Generating a HMAC key with default length...
-PASS key.usages === key.usages is true
-PASS key.usages.foo is "bar"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html (209748 => 209749)


--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html	2016-12-13 01:05:15 UTC (rev 209748)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html	2016-12-13 01:32:56 UTC (rev 209749)
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src=""
-<script src=""
-</head>
-<body>
-<script>
-
-description("Test that CryptoKey.usages preserves custom properties.");
-jsTestIsAsync = true;
-
-debug("\nGenerating a HMAC key with default length...");
-crypto.webkitSubtle.generateKey({name: "hmac", hash: "sha-1"}, true, ["sign", "verify"]).then(function(result) {
-    key = result;
-    startTest();
-});
-
-function startTest()
-{
-    shouldBeTrue("key.usages === key.usages");
-    key.usages.foo = "bar";
-    gc();
-    setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
-    gc();
-    setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
-    gc();
-    shouldBeEqualToString('key.usages.foo', 'bar');
-    finishJSTest();
-}
-
-</script>
-<script src=""
-</body>
-</html>

Modified: trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations (209748 => 209749)


--- trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations	2016-12-13 01:05:15 UTC (rev 209748)
+++ trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations	2016-12-13 01:32:56 UTC (rev 209749)
@@ -1021,6 +1021,10 @@
 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
+crypto/subtle/rsa-indexeddb-non-exportable.html
+crypto/subtle/rsa-indexeddb-private.html
+crypto/subtle/rsa-indexeddb.html
 
 # ShouldOpenExternalURLs not yet supported in WK1
 loader/navigation-policy [ Skip ]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to