Changeset 208548 in webkit
- Timestamp:
- Nov 10, 2016 10:36:44 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 84 added
- 50 edited
- 25 copied
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r208547 r208548 1 2016-11-04 Jiewen Tan <jiewen_tan@apple.com> 2 3 Update SubtleCrypto::importKey to match the latest spec 4 https://bugs.webkit.org/show_bug.cgi?id=164446 5 <rdar://problem/29123621> 6 7 Reviewed by Brent Fulgham. 8 9 Besides adding test cases for SubtleCrypto::importKey. This patch also corrects a typo: 10 generate-key-malformed-paramters*. 11 12 * crypto/subtle/aes-cbc-import-jwk-key-length-128-expected.txt: Added. 13 * crypto/subtle/aes-cbc-import-jwk-key-length-128.html: Added. 14 * crypto/subtle/aes-cbc-import-jwk-key-length-192-expected.txt: Added. 15 * crypto/subtle/aes-cbc-import-jwk-key-length-192.html: Added. 16 * crypto/subtle/aes-cbc-import-jwk-key-length-256-expected.txt: Added. 17 * crypto/subtle/aes-cbc-import-jwk-key-length-256.html: Added. 18 * crypto/subtle/aes-cbc-import-jwk-key-minimum-expected.txt: Added. 19 * crypto/subtle/aes-cbc-import-jwk-key-minimum.html: Added. 20 * crypto/subtle/aes-cbc-import-jwk-key-non-extractable-expected.txt: Added. 21 * crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html: Added. 22 * crypto/subtle/aes-cbc-import-raw-key-length-128-expected.txt: Added. 23 * crypto/subtle/aes-cbc-import-raw-key-length-128.html: Added. 24 * crypto/subtle/aes-cbc-import-raw-key-length-192-expected.txt: Added. 25 * crypto/subtle/aes-cbc-import-raw-key-length-192.html: Added. 26 * crypto/subtle/aes-cbc-import-raw-key-length-256-expected.txt: Added. 27 * crypto/subtle/aes-cbc-import-raw-key-length-256.html: Added. 28 * crypto/subtle/aes-import-key-malformed-parameters-expected.txt: Added. 29 * crypto/subtle/aes-import-key-malformed-parameters.html: Added. 30 * crypto/subtle/aes-kw-import-jwk-key-length-128-expected.txt: Added. 31 * crypto/subtle/aes-kw-import-jwk-key-length-128.html: Added. 32 * crypto/subtle/aes-kw-import-jwk-key-length-192-expected.txt: Added. 33 * crypto/subtle/aes-kw-import-jwk-key-length-192.html: Added. 34 * crypto/subtle/aes-kw-import-jwk-key-length-256-expected.txt: Added. 35 * crypto/subtle/aes-kw-import-jwk-key-length-256.html: Added. 36 * crypto/subtle/aes-kw-import-raw-key-expected.txt: Added. 37 * crypto/subtle/aes-kw-import-raw-key.html: Added. 38 * crypto/subtle/generate-key-malformed-parameters-expected.txt: Renamed from LayoutTests/crypto/subtle/generate-key-malformed-paramters-expected.txt. 39 * crypto/subtle/generate-key-malformed-parameters.html: Renamed from LayoutTests/crypto/subtle/generate-key-malformed-paramters.html. 40 * crypto/subtle/hmac-generate-key-customized-length-expected.txt: 41 * crypto/subtle/hmac-generate-key-customized-length.html: 42 * crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt: 43 * crypto/subtle/hmac-generate-key-malformed-parameters.html: 44 * crypto/subtle/hmac-import-raw-key-customized-length-expected.txt: 45 * crypto/subtle/hmac-import-raw-key-customized-length.html: 46 * crypto/subtle/hmac-import-jwk-key-minimum-expected.txt: Added. 47 * crypto/subtle/hmac-import-jwk-key-minimum.html: Added. 48 * crypto/subtle/hmac-import-jwk-key-non-extractable-expected.txt: Added. 49 * crypto/subtle/hmac-import-jwk-key-non-extractable.html: Added. 50 * crypto/subtle/hmac-import-jwk-key-sha1-expected.txt: Added. 51 * crypto/subtle/hmac-import-jwk-key-sha1.html: Added. 52 * crypto/subtle/hmac-import-jwk-key-sha224-expected.txt: Added. 53 * crypto/subtle/hmac-import-jwk-key-sha224.html: Added. 54 * crypto/subtle/hmac-import-jwk-key-sha256-expected.txt: Added. 55 * crypto/subtle/hmac-import-jwk-key-sha256.html: Added. 56 * crypto/subtle/hmac-import-jwk-key-sha384-expected.txt: Added. 57 * crypto/subtle/hmac-import-jwk-key-sha384.html: Added. 58 * crypto/subtle/hmac-import-jwk-key-sha512-expected.txt: Added. 59 * crypto/subtle/hmac-import-jwk-key-sha512.html: Added. 60 * crypto/subtle/hmac-import-malformed-parameters-expected.txt: Added. 61 * crypto/subtle/hmac-import-malformed-parameters.html: Added. 62 * crypto/subtle/hmac-import-raw-key-customized-length-expected.txt: Added. 63 * crypto/subtle/hmac-import-raw-key-customized-length.html: Added. 64 * crypto/subtle/hmac-import-raw-key-expected.txt: Added. 65 * crypto/subtle/hmac-import-raw-key.html: Added. 66 * crypto/subtle/import-key-malformed-parameters-expected.txt: Added. 67 * crypto/subtle/import-key-malformed-parameters.html: Added. 68 * crypto/subtle/rsa-import-key-malformed-parameters-expected.txt: Added. 69 * crypto/subtle/rsa-import-key-malformed-parameters.html: Added. 70 * crypto/subtle/rsa-oaep-import-jwk-private-key-expected.txt: Added. 71 * crypto/subtle/rsa-oaep-import-jwk-private-key.html: Added. 72 * crypto/subtle/rsa-oaep-import-jwk-public-key-sha1-expected.txt: Added. 73 * crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html: Added. 74 * crypto/subtle/rsa-oaep-import-jwk-public-key-sha224-expected.txt: Added. 75 * crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html: Added. 76 * crypto/subtle/rsa-oaep-import-jwk-public-key-sha256-expected.txt: Added. 77 * crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html: Added. 78 * crypto/subtle/rsa-oaep-import-jwk-public-key-sha384-expected.txt: Added. 79 * crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html: Added. 80 * crypto/subtle/rsa-oaep-import-jwk-public-key-sha512-expected.txt: Added. 81 * crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html: Added. 82 * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key-expected.txt: Added. 83 * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html: Added. 84 * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-expected.txt: Added. 85 * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero-expected.txt: Added. 86 * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html: Added. 87 * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum-expected.txt: Added. 88 * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html: Added. 89 * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable-expected.txt: Added. 90 * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html: Added. 91 * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html: Added. 92 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key-expected.txt: Added. 93 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html: Added. 94 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1-expected.txt: Added. 95 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html: Added. 96 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224-expected.txt: Added. 97 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html: Added. 98 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256-expected.txt: Added. 99 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html: Added. 100 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384-expected.txt: Added. 101 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html: Added. 102 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512-expected.txt: Added. 103 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html: Added. 104 * crypto/webkitSubtle/hmac-generate-key-expected.txt: 105 * crypto/webkitSubtle/hmac-generate-key.html: 106 * crypto/webkitSubtle/hmac-import-jwk-expected.txt: 107 * crypto/webkitSubtle/hmac-import-jwk.html: 108 * crypto/webkitSubtle/hmac-postMessage-expected.txt: 109 * crypto/webkitSubtle/hmac-postMessage.html: 110 * crypto/webkitSubtle/hmac-sign-verify-expected.txt: 111 * crypto/webkitSubtle/hmac-sign-verify.html: 112 * crypto/workers/subtle/aes-import-jwk-key-expected.txt: Added. 113 * crypto/workers/subtle/aes-import-jwk-key.html: Added. 114 * crypto/workers/subtle/aes-import-raw-key-expected.txt: Added. 115 * crypto/workers/subtle/aes-import-raw-key.html: Added. 116 * crypto/workers/subtle/hmac-import-jwk-key-expected.txt: Added. 117 * crypto/workers/subtle/hmac-import-jwk-key.html: Added. 118 * crypto/workers/subtle/hmac-import-raw-key-expected.txt: Added. 119 * crypto/workers/subtle/hmac-import-raw-key.html: Added. 120 * crypto/workers/subtle/hmac-postMessage-worker-expected.txt: 121 * crypto/workers/subtle/hmac-postMessage-worker.html: 122 * crypto/workers/subtle/resources/aes-import-jwk-key.js: Added. 123 * crypto/workers/subtle/resources/aes-import-raw-key.js: Added. 124 * crypto/workers/subtle/resources/hmac-import-jwk-key.js: Added. 125 * crypto/workers/subtle/resources/hmac-import-raw-key.js: Added. 126 * crypto/workers/subtle/resources/hmac-postMessage-worker.js: 127 * crypto/workers/subtle/resources/rsa-import-jwk-private-key.js: Added. 128 * crypto/workers/subtle/resources/rsa-import-jwk-public-key.js: Added. 129 * crypto/workers/subtle/rsa-import-jwk-private-key-expected.txt: Added. 130 * crypto/workers/subtle/rsa-import-jwk-private-key.html: Added. 131 * crypto/workers/subtle/rsa-import-jwk-public-key-expected.txt: Added. 132 * crypto/workers/subtle/rsa-import-jwk-public-key.html: Added. 133 1 134 2016-11-10 Ryan Haddad <ryanhaddad@apple.com> 2 135 -
trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-128-expected.txt
r208547 r208548 1 Test sending crypto keys via postMessage.1 Test importing a JWK AES-KW key with legnth 128 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Importing a key... 6 7 PASS key.type is 'secret' 7 8 PASS key.extractable is true 8 PASS key.algorithm.name is ' HMAC'9 PASS key.algorithm.length is 1 610 PASS key.usages is [ "sign", "verify"]9 PASS key.algorithm.name is 'AES-KW' 10 PASS key.algorithm.length is 128 11 PASS key.usages is ['unwrapKey', 'wrapKey'] 11 12 PASS successfullyParsed is true 12 13 -
trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-128.html
r208547 r208548 10 10 11 11 <script> 12 description("Test generating a HMAC key with customized length.");12 description("Test importing a JWK AES-KW key with legnth 128"); 13 13 14 14 jsTestIsAsync = true; 15 15 16 var jwkKey = { 17 kty: "oct", 18 k: "YWJjZGVmZ2gxMjM0NTY3OA", 19 alg: "A128KW", 20 }; 16 21 var extractable = true; 17 22 18 debug(" \nGenerating a key...");19 crypto.subtle. generateKey({name: "hmac", hash: "sha-512", length: 111}, extractable, ["sign", "verify"]).then(function(result) {23 debug("Importing a key..."); 24 crypto.subtle.importKey("jwk", jwkKey, "aes-kw", extractable, ["wrapKey", "unwrapKey"]).then(function(result) { 20 25 key = result; 21 26 22 27 shouldBe("key.type", "'secret'"); 23 28 shouldBe("key.extractable", "true"); 24 shouldBe("key.algorithm.name", "'HMAC'"); 25 shouldBe("key.algorithm.length", "111"); 26 shouldBe("key.algorithm.hash.name", "'SHA-512'"); 27 shouldBe("key.usages", '["sign", "verify"]'); 29 shouldBe("key.algorithm.name", "'AES-KW'"); 30 shouldBe("key.algorithm.length", "128"); 31 shouldBe("key.usages", "['unwrapKey', 'wrapKey']"); 28 32 29 33 finishJSTest(); 30 34 }); 35 31 36 </script> 32 37 -
trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-192-expected.txt
r208547 r208548 1 Test sending crypto keys via postMessage.1 Test importing a JWK AES-KW key with legnth 192 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Importing a key... 6 7 PASS key.type is 'secret' 7 8 PASS key.extractable is true 8 PASS key.algorithm.name is ' HMAC'9 PASS key.algorithm.length is 1 610 PASS key.usages is [ "sign", "verify"]9 PASS key.algorithm.name is 'AES-KW' 10 PASS key.algorithm.length is 192 11 PASS key.usages is ['unwrapKey', 'wrapKey'] 11 12 PASS successfullyParsed is true 12 13 -
trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-256-expected.txt
r208547 r208548 1 Test sending crypto keys via postMessage.1 Test importing a JWK AES-KW key with legnth 256 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Importing a key... 6 7 PASS key.type is 'secret' 7 8 PASS key.extractable is true 8 PASS key.algorithm.name is ' HMAC'9 PASS key.algorithm.length is 1610 PASS key.usages is [ "sign", "verify"]9 PASS key.algorithm.name is 'AES-KW' 10 PASS key.algorithm.length is 256 11 PASS key.usages is ['unwrapKey', 'wrapKey'] 11 12 PASS successfullyParsed is true 12 13 -
trunk/LayoutTests/crypto/subtle/aes-kw-import-raw-key-expected.txt
r208547 r208548 1 Test sending crypto keys via postMessage.1 Test importing a raw AES-KW key with legnth 128 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Importing a key... 6 7 PASS key.type is 'secret' 7 8 PASS key.extractable is true 8 PASS key.algorithm.name is ' HMAC'9 PASS key.algorithm.length is 1 610 PASS key.usages is [ "sign", "verify"]9 PASS key.algorithm.name is 'AES-KW' 10 PASS key.algorithm.length is 128 11 PASS key.usages is ['unwrapKey', 'wrapKey'] 11 12 PASS successfullyParsed is true 12 13 -
trunk/LayoutTests/crypto/subtle/aes-kw-import-raw-key.html
r208547 r208548 10 10 11 11 <script> 12 description("Test generating a HMAC key with customized length.");12 description("Test importing a raw AES-KW key with legnth 128"); 13 13 14 14 jsTestIsAsync = true; 15 15 16 var rawKey = asciiToUint8Array("jnOw99oOZFLIEPMr"); 16 17 var extractable = true; 17 18 18 debug(" \nGenerating a key...");19 crypto.subtle. generateKey({name: "hmac", hash: "sha-512", length: 111}, extractable, ["sign", "verify"]).then(function(result) {19 debug("Importing a key..."); 20 crypto.subtle.importKey("raw", rawKey, "aes-kw", extractable, ["wrapKey", "unwrapKey"]).then(function(result) { 20 21 key = result; 21 22 22 23 shouldBe("key.type", "'secret'"); 23 24 shouldBe("key.extractable", "true"); 24 shouldBe("key.algorithm.name", "'HMAC'"); 25 shouldBe("key.algorithm.length", "111"); 26 shouldBe("key.algorithm.hash.name", "'SHA-512'"); 27 shouldBe("key.usages", '["sign", "verify"]'); 25 shouldBe("key.algorithm.name", "'AES-KW'"); 26 shouldBe("key.algorithm.length", "128"); 27 shouldBe("key.usages", "['unwrapKey', 'wrapKey']"); 28 28 29 29 finishJSTest(); 30 30 }); 31 31 32 </script> 32 33 -
trunk/LayoutTests/crypto/subtle/generate-key-malformed-parameters-expected.txt
r208547 r208548 7 7 PASS crypto.subtle.generateKey(1) rejected promise with TypeError: Not enough arguments. 8 8 PASS crypto.subtle.generateKey(1, 2) rejected promise with TypeError: Not enough arguments. 9 PASS crypto.subtle.generateKey(1, 2, 3) rejected promise with TypeError: Invalid AlgorithmIdentifier.10 9 PASS crypto.subtle.generateKey("foo", 2, 3) rejected promise with NotSupportedError (DOM Exception 9): The operation is not supported.. 11 10 PASS crypto.subtle.generateKey({name: 1}, 2, 3) rejected promise with NotSupportedError (DOM Exception 9): The operation is not supported.. … … 19 18 PASS crypto.subtle.generateKey({name: "hmac", hash: 1}, extractable, ["sign", "verify"]) rejected promise with TypeError: Invalid AlgorithmIdentifier. 20 19 PASS crypto.subtle.generateKey({name: "hmac", hash: null}, extractable, ["sign", "verify"]) rejected promise with TypeError: Invalid AlgorithmIdentifier. 21 PASS crypto.subtle.generateKey({name: "hmac", hash: undefined}, extractable, ["sign", "verify"]) rejected promise with TypeError: Member HmacKey GenParams.hash is required and must be an instance of any.20 PASS crypto.subtle.generateKey({name: "hmac", hash: undefined}, extractable, ["sign", "verify"]) rejected promise with TypeError: Member HmacKeyParams.hash is required and must be an instance of any. 22 21 PASS crypto.subtle.generateKey({name: "hmac", hash: Symbol()}, extractable, ["sign", "verify"]) rejected promise with TypeError: Invalid AlgorithmIdentifier. 23 22 PASS crypto.subtle.generateKey({name: "hmac", hash: { }}, extractable, ["sign", "verify"]) rejected promise with TypeError: Member CryptoAlgorithmParameters.name is required and must be an instance of DOMString. … … 41 40 PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, { }) rejected promise with TypeError: Type error. 42 41 PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, "foo") rejected promise with TypeError: Invalid KeyUsages. 42 PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, ["foo"]) rejected promise with TypeError: Invalid KeyUsages. 43 43 PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, [ ]) rejected promise with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range. 44 44 PASS crypto.subtle.generateKey({name: "RSAES-PKCS1-v1_5", modulusLength: 2048, publicExponent: new Uint8Array([0x01, 0x00, 0x01])}, extractable, [ ]) rejected promise with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range. -
trunk/LayoutTests/crypto/subtle/generate-key-malformed-parameters.html
r208547 r208548 20 20 shouldReject('crypto.subtle.generateKey(1)'); 21 21 shouldReject('crypto.subtle.generateKey(1, 2)'); 22 shouldReject('crypto.subtle.generateKey(1, 2, 3)');23 22 // Malformed AlgorithmIdentifiers. 24 23 shouldReject('crypto.subtle.generateKey("foo", 2, 3)'); … … 58 57 shouldReject('crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, { })'); 59 58 shouldReject('crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, "foo")'); 59 shouldReject('crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, ["foo"])'); 60 60 // Syntax error. 61 61 shouldReject('crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, [ ])'); -
trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length-expected.txt
r207809 r208548 9 9 PASS key.extractable is true 10 10 PASS key.algorithm.name is 'HMAC' 11 PASS key.algorithm.length is 1 1111 PASS key.algorithm.length is 120 12 12 PASS key.algorithm.hash.name is 'SHA-512' 13 13 PASS key.usages is ["sign", "verify"] -
trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length.html
r207809 r208548 17 17 18 18 debug("\nGenerating a key..."); 19 crypto.subtle.generateKey({name: "hmac", hash: "sha-512", length: 1 11}, extractable, ["sign", "verify"]).then(function(result) {19 crypto.subtle.generateKey({name: "hmac", hash: "sha-512", length: 120}, extractable, ["sign", "verify"]).then(function(result) { 20 20 key = result; 21 21 … … 23 23 shouldBe("key.extractable", "true"); 24 24 shouldBe("key.algorithm.name", "'HMAC'"); 25 shouldBe("key.algorithm.length", "1 11");25 shouldBe("key.algorithm.length", "120"); 26 26 shouldBe("key.algorithm.hash.name", "'SHA-512'"); 27 27 shouldBe("key.usages", '["sign", "verify"]'); -
trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt
r207809 r208548 4 4 5 5 6 PASS crypto.subtle.generateKey("hmac", extractable, ["sign", "verify"]) rejected promise with TypeError: Member HmacKey GenParams.hash is required and must be an instance of any.7 PASS crypto.subtle.generateKey({name: "hmac"}, extractable, ["sign", "verify"]) rejected promise with TypeError: Member HmacKey GenParams.hash is required and must be an instance of any.6 PASS crypto.subtle.generateKey("hmac", extractable, ["sign", "verify"]) rejected promise with TypeError: Member HmacKeyParams.hash is required and must be an instance of any. 7 PASS crypto.subtle.generateKey({name: "hmac"}, extractable, ["sign", "verify"]) rejected promise with TypeError: Member HmacKeyParams.hash is required and must be an instance of any. 8 8 PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: null}, extractable, ["sign", "verify"]) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason. 9 9 PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: Symbol()}, extractable, ["sign", "verify"]) rejected promise with TypeError: Cannot convert a symbol to a number. … … 17 17 PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["unwrapKey"]) rejected promise with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range. 18 18 PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: 0}, extractable, ["sign", "verify"]) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason. 19 PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: 5}, extractable, ["sign", "verify"]) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason. 19 20 PASS successfullyParsed is true 20 21 -
trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters.html
r207809 r208548 30 30 // Wrong length 31 31 shouldReject('crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: 0}, extractable, ["sign", "verify"])'); 32 shouldReject('crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: 5}, extractable, ["sign", "verify"])'); 32 33 </script> 33 34 -
trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-minimum-expected.txt
r208547 r208548 1 Test sending hmac crypto keys via postMessage to a worker.1 Test importing a JWK HMAC key with minimum JWK information 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 PASS All checks passed in worker 6 Importing a key... 7 7 PASS key.type is 'secret' 8 8 PASS key.extractable is true 9 9 PASS key.algorithm.name is 'HMAC' 10 PASS key.algorithm.length is 1 610 PASS key.algorithm.length is 128 11 11 PASS key.algorithm.hash.name is 'SHA-1' 12 PASS key.usages is [ "sign", "verify"]12 PASS key.usages is ['sign', 'verify'] 13 13 PASS successfullyParsed is true 14 14 -
trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-minimum.html
r208547 r208548 10 10 11 11 <script> 12 description("Test generating a HMAC key with customized length.");12 description("Test importing a JWK HMAC key with minimum JWK information"); 13 13 14 14 jsTestIsAsync = true; 15 15 16 var jwkKey = { 17 kty: "oct", 18 k: "YWJjZGVmZ2gxMjM0NTY3OA", 19 }; 16 20 var extractable = true; 17 21 18 debug(" \nGenerating a key...");19 crypto.subtle. generateKey({name: "hmac", hash: "sha-512", length: 111}, extractable, ["sign", "verify"]).then(function(result) {22 debug("Importing a key..."); 23 crypto.subtle.importKey("jwk", jwkKey, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]).then(function(result) { 20 24 key = result; 21 25 … … 23 27 shouldBe("key.extractable", "true"); 24 28 shouldBe("key.algorithm.name", "'HMAC'"); 25 shouldBe("key.algorithm.length", "1 11");26 shouldBe("key.algorithm.hash.name", "'SHA- 512'");27 shouldBe("key.usages", '["sign", "verify"]');29 shouldBe("key.algorithm.length", "128"); 30 shouldBe("key.algorithm.hash.name", "'SHA-1'"); 31 shouldBe("key.usages", "['sign', 'verify']"); 28 32 29 33 finishJSTest(); 30 34 }); 35 31 36 </script> 32 37 -
trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-non-extractable-expected.txt
r208547 r208548 1 Test sending hmac crypto keys via postMessage to a worker.1 Test importing a non-extractable JWK HMAC key 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 PASS All checks passed in worker 6 Importing a key... 7 7 PASS key.type is 'secret' 8 PASS key.extractable is true8 PASS key.extractable is false 9 9 PASS key.algorithm.name is 'HMAC' 10 PASS key.algorithm.length is 1 610 PASS key.algorithm.length is 128 11 11 PASS key.algorithm.hash.name is 'SHA-1' 12 PASS key.usages is [ "sign", "verify"]12 PASS key.usages is ['sign', 'verify'] 13 13 PASS successfullyParsed is true 14 14 -
trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha1-expected.txt
r208547 r208548 1 Test sending hmac crypto keys via postMessage to a worker.1 Test importing a JWK HMAC key with SHA-1 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 PASS All checks passed in worker 6 Importing a key... 7 7 PASS key.type is 'secret' 8 8 PASS key.extractable is true 9 9 PASS key.algorithm.name is 'HMAC' 10 PASS key.algorithm.length is 1 610 PASS key.algorithm.length is 128 11 11 PASS key.algorithm.hash.name is 'SHA-1' 12 PASS key.usages is [ "sign", "verify"]12 PASS key.usages is ['sign', 'verify'] 13 13 PASS successfullyParsed is true 14 14 -
trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha224-expected.txt
r208547 r208548 1 Test sending crypto keys via postMessage.1 Test importing a JWK HMAC key with SHA-224 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Importing a key... 6 7 PASS key.type is 'secret' 7 8 PASS key.extractable is true 8 9 PASS key.algorithm.name is 'HMAC' 9 PASS key.algorithm.length is 16 10 PASS key.usages is ["sign", "verify"] 10 PASS key.algorithm.length is 128 11 PASS key.algorithm.hash.name is 'SHA-224' 12 PASS key.usages is ['sign', 'verify'] 11 13 PASS successfullyParsed is true 12 14 -
trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha256-expected.txt
r208547 r208548 1 Test sending crypto keys via postMessage.1 Test importing a JWK HMAC key with SHA-256 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Importing a key... 6 7 PASS key.type is 'secret' 7 8 PASS key.extractable is true 8 9 PASS key.algorithm.name is 'HMAC' 9 PASS key.algorithm.length is 16 10 PASS key.usages is ["sign", "verify"] 10 PASS key.algorithm.length is 128 11 PASS key.algorithm.hash.name is 'SHA-256' 12 PASS key.usages is ['sign', 'verify'] 11 13 PASS successfullyParsed is true 12 14 -
trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha384-expected.txt
r208547 r208548 1 Test sending crypto keys via postMessage.1 Test importing a JWK HMAC key with SHA-384 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Importing a key... 6 7 PASS key.type is 'secret' 7 8 PASS key.extractable is true 8 9 PASS key.algorithm.name is 'HMAC' 9 PASS key.algorithm.length is 16 10 PASS key.usages is ["sign", "verify"] 10 PASS key.algorithm.length is 128 11 PASS key.algorithm.hash.name is 'SHA-384' 12 PASS key.usages is ['sign', 'verify'] 11 13 PASS successfullyParsed is true 12 14 -
trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha512-expected.txt
r208547 r208548 1 Test generating a HMAC key with customized length.1 Test importing a JWK HMAC key with SHA-512 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 7 Generating a key... 6 Importing a key... 8 7 PASS key.type is 'secret' 9 8 PASS key.extractable is true 10 9 PASS key.algorithm.name is 'HMAC' 11 PASS key.algorithm.length is 1 1110 PASS key.algorithm.length is 128 12 11 PASS key.algorithm.hash.name is 'SHA-512' 13 PASS key.usages is [ "sign", "verify"]12 PASS key.usages is ['sign', 'verify'] 14 13 PASS successfullyParsed is true 15 14 -
trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha512.html
r208547 r208548 10 10 11 11 <script> 12 description("Test generating a HMAC key with customized length.");12 description("Test importing a JWK HMAC key with SHA-512"); 13 13 14 14 jsTestIsAsync = true; 15 15 16 var jwkKey = { 17 kty: "oct", 18 k: "YWJjZGVmZ2gxMjM0NTY3OA", 19 alg: "HS512", 20 use: "sig", 21 key_ops: ["sign", "verify"], 22 ext: true, 23 }; 16 24 var extractable = true; 17 25 18 debug(" \nGenerating a key...");19 crypto.subtle. generateKey({name: "hmac", hash: "sha-512", length: 111}, extractable, ["sign", "verify"]).then(function(result) {26 debug("Importing a key..."); 27 crypto.subtle.importKey("jwk", jwkKey, {name: "hmac", hash: "sha-512"}, extractable, ["sign", "verify"]).then(function(result) { 20 28 key = result; 21 29 … … 23 31 shouldBe("key.extractable", "true"); 24 32 shouldBe("key.algorithm.name", "'HMAC'"); 25 shouldBe("key.algorithm.length", "1 11");33 shouldBe("key.algorithm.length", "128"); 26 34 shouldBe("key.algorithm.hash.name", "'SHA-512'"); 27 shouldBe("key.usages", '["sign", "verify"]');35 shouldBe("key.usages", "['sign', 'verify']"); 28 36 29 37 finishJSTest(); 30 38 }); 39 31 40 </script> 32 41 -
trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-customized-length-expected.txt
r208547 r208548 1 Test sending hmac crypto keys via postMessage to a worker.1 Test importing a raw HMAC key with customized length 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 PASS All checks passed in worker 6 Importing a key... 7 7 PASS key.type is 'secret' 8 8 PASS key.extractable is true 9 9 PASS key.algorithm.name is 'HMAC' 10 PASS key.algorithm.length is 1 610 PASS key.algorithm.length is 128 11 11 PASS key.algorithm.hash.name is 'SHA-1' 12 PASS key.usages is [ "sign", "verify"]12 PASS key.usages is ['sign', 'verify'] 13 13 PASS successfullyParsed is true 14 14 -
trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-customized-length.html
r208547 r208548 10 10 11 11 <script> 12 description("Test generating a HMAC key with customized length.");12 description("Test importing a raw HMAC key with customized length"); 13 13 14 14 jsTestIsAsync = true; 15 15 16 var rawKey = asciiToUint8Array("jnOw99oOZFLIEPMr"); 16 17 var extractable = true; 17 18 18 debug(" \nGenerating a key...");19 crypto.subtle. generateKey({name: "hmac", hash: "sha-512", length: 111}, extractable, ["sign", "verify"]).then(function(result) {19 debug("Importing a key..."); 20 crypto.subtle.importKey("raw", rawKey, {name: "hmac", hash: "sha-1", length: 128}, extractable, ["sign", "verify"]).then(function(result) { 20 21 key = result; 21 22 … … 23 24 shouldBe("key.extractable", "true"); 24 25 shouldBe("key.algorithm.name", "'HMAC'"); 25 shouldBe("key.algorithm.length", "1 11");26 shouldBe("key.algorithm.hash.name", "'SHA- 512'");27 shouldBe("key.usages", '["sign", "verify"]');26 shouldBe("key.algorithm.length", "128"); 27 shouldBe("key.algorithm.hash.name", "'SHA-1'"); 28 shouldBe("key.usages", "['sign', 'verify']"); 28 29 29 30 finishJSTest(); 30 31 }); 32 31 33 </script> 32 34 -
trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-expected.txt
r208547 r208548 1 Test sending hmac crypto keys via postMessage to a worker.1 Test importing a raw HMAC key 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 PASS All checks passed in worker 6 Importing a key... 7 7 PASS key.type is 'secret' 8 8 PASS key.extractable is true 9 9 PASS key.algorithm.name is 'HMAC' 10 PASS key.algorithm.length is 1 610 PASS key.algorithm.length is 128 11 11 PASS key.algorithm.hash.name is 'SHA-1' 12 PASS key.usages is [ "sign", "verify"]12 PASS key.usages is ['sign', 'verify'] 13 13 PASS successfullyParsed is true 14 14 -
trunk/LayoutTests/crypto/subtle/hmac-import-raw-key.html
r208547 r208548 10 10 11 11 <script> 12 description("Test generating a HMAC key with customized length.");12 description("Test importing a raw HMAC key"); 13 13 14 14 jsTestIsAsync = true; 15 15 16 var rawKey = asciiToUint8Array("jnOw99oOZFLIEPMr"); 16 17 var extractable = true; 17 18 18 debug(" \nGenerating a key...");19 crypto.subtle. generateKey({name: "hmac", hash: "sha-512", length: 111}, extractable, ["sign", "verify"]).then(function(result) {19 debug("Importing a key..."); 20 crypto.subtle.importKey("raw", rawKey, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]).then(function(result) { 20 21 key = result; 21 22 … … 23 24 shouldBe("key.extractable", "true"); 24 25 shouldBe("key.algorithm.name", "'HMAC'"); 25 shouldBe("key.algorithm.length", "1 11");26 shouldBe("key.algorithm.hash.name", "'SHA- 512'");27 shouldBe("key.usages", '["sign", "verify"]');26 shouldBe("key.algorithm.length", "128"); 27 shouldBe("key.algorithm.hash.name", "'SHA-1'"); 28 shouldBe("key.usages", "['sign', 'verify']"); 28 29 29 30 finishJSTest(); 30 31 }); 32 31 33 </script> 32 34 -
trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key-expected.txt
r207809 r208548 21 21 PASS key.extractable is true 22 22 PASS key.algorithm.name is 'HMAC' 23 PASS key.algorithm.length is 523 PASS key.algorithm.length is 8 24 24 PASS key.algorithm.hash.name is 'SHA-1' 25 25 PASS key.usages is ["sign"] -
trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key.html
r207809 r208548 33 33 34 34 debug("\nGenerating a key with custom length..."); 35 return crypto.webkitSubtle.generateKey({name: "hmac", hash: "sha-1", length: 5}, extractable, ["sign"]);35 return crypto.webkitSubtle.generateKey({name: "hmac", hash: "sha-1", length: 8}, extractable, ["sign"]); 36 36 }).then(function(result) { 37 37 key = result; … … 40 40 shouldBe("key.extractable", "true"); 41 41 shouldBe("key.algorithm.name", "'HMAC'"); 42 shouldBe("key.algorithm.length", " 5");42 shouldBe("key.algorithm.length", "8"); 43 43 shouldBe("key.algorithm.hash.name", "'SHA-1'"); 44 44 shouldBe("key.usages", '["sign"]'); -
trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk-expected.txt
r206883 r208548 9 9 PASS key.extractable is false 10 10 PASS key.algorithm.name is 'HMAC' 11 PASS key.algorithm.length is 3211 PASS key.algorithm.length is 256 12 12 PASS key.usages is ["sign", "verify"] 13 13 -
trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk.html
r206883 r208548 33 33 shouldBe("key.extractable", "false"); 34 34 shouldBe("key.algorithm.name", "'HMAC'"); 35 shouldBe("key.algorithm.length", " 32");35 shouldBe("key.algorithm.length", "256"); 36 36 shouldBe("key.usages", '["sign", "verify"]'); 37 37 -
trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt
r206883 r208548 7 7 PASS key.extractable is true 8 8 PASS key.algorithm.name is 'HMAC' 9 PASS key.algorithm.length is 1 69 PASS key.algorithm.length is 128 10 10 PASS key.usages is ["sign", "verify"] 11 11 PASS successfullyParsed is true -
trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage.html
r206883 r208548 18 18 shouldBe("key.extractable", "true"); 19 19 shouldBe("key.algorithm.name", "'HMAC'"); 20 shouldBe("key.algorithm.length", "1 6");20 shouldBe("key.algorithm.length", "128"); 21 21 shouldBe("key.usages", '["sign", "verify"]'); 22 22 -
trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-expected.txt
r206883 r208548 8 8 PASS key.extractable is true 9 9 PASS key.algorithm.name is 'HMAC' 10 PASS key.algorithm.length is 110 PASS key.algorithm.length is 8 11 11 PASS key.algorithm.hash.name is 'SHA-1' 12 12 PASS key.usages is ['sign', 'verify'] -
trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify.html
r206883 r208548 23 23 shouldBe("key.extractable", "true"); 24 24 shouldBe("key.algorithm.name", "'HMAC'"); 25 shouldBe("key.algorithm.length", " 1"); // See <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098>.25 shouldBe("key.algorithm.length", "8"); // See <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098>. 26 26 shouldBe("key.algorithm.hash.name", "'SHA-1'"); 27 27 shouldBe("key.usages", "['sign', 'verify']"); -
trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt
r206883 r208548 8 8 PASS key.extractable is true 9 9 PASS key.algorithm.name is 'HMAC' 10 PASS key.algorithm.length is 1 610 PASS key.algorithm.length is 128 11 11 PASS key.algorithm.hash.name is 'SHA-1' 12 12 PASS key.usages is ["sign", "verify"] -
trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker.html
r206883 r208548 24 24 shouldBe("key.extractable", "true"); 25 25 shouldBe("key.algorithm.name", "'HMAC'"); 26 shouldBe("key.algorithm.length", "1 6");26 shouldBe("key.algorithm.length", "128"); 27 27 shouldBe("key.algorithm.hash.name", "'SHA-1'"); 28 28 shouldBe("key.usages", '["sign", "verify"]'); -
trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js
r206883 r208548 10 10 else if (key.algorithm.name != "HMAC") 11 11 postMessage({ result:false, message:'key.algorithm.name should be "HMAC"' }); 12 else if (key.algorithm.length != 1 6)13 postMessage({ result:false, message:'key.algorithm.length should be 1 6' });12 else if (key.algorithm.length != 128) 13 postMessage({ result:false, message:'key.algorithm.length should be 128' }); 14 14 else if (key.algorithm.hash.name != "SHA-1") 15 15 postMessage({ result:false, message:'key.algorithm.hash.name should be "SHA-1"' }); -
trunk/LayoutTests/imported/w3c/ChangeLog
r208539 r208548 1 2016-11-05 Jiewen Tan <jiewen_tan@apple.com> 2 3 Update SubtleCrypto::importKey to match the latest spec 4 https://bugs.webkit.org/show_bug.cgi?id=164446 5 <rdar://problem/29123621> 6 7 Reviewed by Brent Fulgham. 8 9 * WebCryptoAPI/idlharness-expected.txt: 10 1 11 2016-11-10 Zan Dobersek <zdobersek@igalia.com> 2 12 -
trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt
r207809 r208548 60 60 FAIL SubtleCrypto interface: crypto.subtle must inherit property "deriveBits" with the proper type (7) assert_inherits: property "deriveBits" not found in prototype chain 61 61 FAIL SubtleCrypto interface: calling deriveBits(AlgorithmIdentifier,CryptoKey,unsigned long) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "deriveBits" not found in prototype chain 62 FAIL SubtleCrypto interface: crypto.subtle must inherit property "importKey" with the proper type (8) assert_inherits: property "importKey" not found in prototype chain 63 FAIL SubtleCrypto interface: calling importKey(KeyFormat,[object Object],[object Object],AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "importKey" not found in prototype chain 62 PASS SubtleCrypto interface: crypto.subtle must inherit property "importKey" with the proper type (8) 63 PASS SubtleCrypto interface: calling importKey(KeyFormat,[object Object],[object Object],AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError 64 64 FAIL SubtleCrypto interface: crypto.subtle must inherit property "exportKey" with the proper type (9) assert_inherits: property "exportKey" not found in prototype chain 65 65 FAIL SubtleCrypto interface: calling exportKey(KeyFormat,CryptoKey) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "exportKey" not found in prototype chain -
trunk/Source/WebCore/CMakeLists.txt
r208539 r208548 328 328 crypto/CryptoKey.idl 329 329 crypto/CryptoKeyPair.idl 330 crypto/JsonWebKey.idl 331 crypto/RsaOtherPrimesInfo.idl 330 332 crypto/SubtleCrypto.idl 331 333 crypto/WebKitSubtleCrypto.idl 332 334 333 335 crypto/parameters/AesKeyGenParams.idl 334 crypto/parameters/HmacKeyGenParams.idl 336 crypto/parameters/HmacKeyParams.idl 337 crypto/parameters/RsaHashedImportParams.idl 335 338 crypto/parameters/RsaHashedKeyGenParams.idl 336 339 crypto/parameters/RsaKeyGenParams.idl -
trunk/Source/WebCore/ChangeLog
r208545 r208548 1 2016-11-04 Jiewen Tan <jiewen_tan@apple.com> 2 3 Update SubtleCrypto::importKey to match the latest spec 4 https://bugs.webkit.org/show_bug.cgi?id=164446 5 <rdar://problem/29123621> 6 7 Reviewed by Brent Fulgham. 8 9 This patch does following few things: 10 1. It updates the SubtleCrypto::importKey method to match the latest spec: 11 https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey. 12 It also refers to the latest Editor's Draft at a certain degree: 13 https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-importKey. 14 2. It implements importKey operations of following algorithms: AES-CBC, AES-KW, 15 HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP. 16 3. It fixes some minor problems of SubtleCrypto::generateKey. 17 4. It addes move constructors for CryptoKeyAES, CryptoKeyHMAC, CryptoKeyRSA and 18 CryptoKeyDataRSAComponents. 19 5. It renames HmacKeyGenParams to HmacKeyParams to serve the purpose of both 20 HmacKeyGenParams and HmacImportParams which are essentially the same. 21 6. It enforces the key length in bits of CryptoKeyHMAC to be multiples of 8. 22 7. It also fixes the following bugs: 23 https://bugs.webkit.org/show_bug.cgi?id=126033, 24 https://bugs.webkit.org/show_bug.cgi?id=126034, 25 https://bugs.webkit.org/show_bug.cgi?id=151308. 26 P.S. We currently only support Raw and Jwk key format. 27 28 Tests: crypto/subtle/aes-cbc-import-jwk-key-length-128.html 29 crypto/subtle/aes-cbc-import-jwk-key-length-192.html 30 crypto/subtle/aes-cbc-import-jwk-key-length-256.html 31 crypto/subtle/aes-cbc-import-jwk-key-minimum.html 32 crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html 33 crypto/subtle/aes-cbc-import-raw-key-length-128.html 34 crypto/subtle/aes-cbc-import-raw-key-length-192.html 35 crypto/subtle/aes-cbc-import-raw-key-length-256.html 36 crypto/subtle/aes-import-key-malformed-parameters.html 37 crypto/subtle/aes-kw-import-jwk-key-length-128.html 38 crypto/subtle/aes-kw-import-jwk-key-length-192.html 39 crypto/subtle/aes-kw-import-jwk-key-length-256.html 40 crypto/subtle/aes-kw-import-raw-key.html 41 crypto/subtle/generate-key-malformed-parameters.html 42 crypto/subtle/hmac-import-jwk-key-minimum.html 43 crypto/subtle/hmac-import-jwk-key-non-extractable.html 44 crypto/subtle/hmac-import-jwk-key-sha1.html 45 crypto/subtle/hmac-import-jwk-key-sha224.html 46 crypto/subtle/hmac-import-jwk-key-sha256.html 47 crypto/subtle/hmac-import-jwk-key-sha384.html 48 crypto/subtle/hmac-import-jwk-key-sha512.html 49 crypto/subtle/hmac-import-malformed-parameters.html 50 crypto/subtle/hmac-import-raw-key-customized-length.html 51 crypto/subtle/hmac-import-raw-key.html 52 crypto/subtle/import-key-malformed-parameters.html 53 crypto/subtle/rsa-import-key-malformed-parameters.html 54 crypto/subtle/rsa-oaep-import-jwk-private-key.html 55 crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html 56 crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html 57 crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html 58 crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html 59 crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html 60 crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html 61 crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html 62 crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html 63 crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html 64 crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html 65 crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html 66 crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html 67 crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html 68 crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html 69 crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html 70 crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html 71 crypto/workers/subtle/aes-import-jwk-key.html 72 crypto/workers/subtle/aes-import-raw-key.html 73 crypto/workers/subtle/hmac-import-jwk-key.html 74 crypto/workers/subtle/hmac-import-raw-key.html 75 crypto/workers/subtle/rsa-import-jwk-private-key.html 76 crypto/workers/subtle/rsa-import-jwk-public-key.html 77 78 * CMakeLists.txt: 79 * DerivedSources.make: 80 * PlatformEfl.cmake: 81 * PlatformGTK.cmake: 82 * PlatformMac.cmake: 83 * WebCore.xcodeproj/project.pbxproj: 84 * bindings/js/JSSubtleCryptoCustom.cpp: 85 (WebCore::normalizeCryptoAlgorithmParameters): 86 (WebCore::cryptoKeyUsageFromString): 87 (WebCore::cryptoKeyUsagesFromJSValue): 88 (WebCore::toKeyData): 89 (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise): 90 (WebCore::jsSubtleCryptoFunctionImportKeyPromise): 91 (WebCore::JSSubtleCrypto::importKey): 92 * crypto/CryptoAlgorithm.cpp: 93 (WebCore::CryptoAlgorithm::importKey): 94 * crypto/CryptoAlgorithm.h: 95 * crypto/CryptoAlgorithmParameters.h: 96 * crypto/JsonWebKey.h: Added. 97 * crypto/JsonWebKey.idl: Added. 98 * crypto/RsaOtherPrimesInfo.h: Added. 99 * crypto/RsaOtherPrimesInfo.idl: Added. 100 * crypto/SubtleCrypto.h: 101 * crypto/SubtleCrypto.idl: 102 * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp: 103 (WebCore::CryptoAlgorithmAES_CBC::generateKey): 104 (WebCore::CryptoAlgorithmAES_CBC::importKey): 105 * crypto/algorithms/CryptoAlgorithmAES_CBC.h: 106 * crypto/algorithms/CryptoAlgorithmAES_KW.cpp: 107 (WebCore::CryptoAlgorithmAES_KW::generateKey): 108 (WebCore::CryptoAlgorithmAES_KW::importKey): 109 * crypto/algorithms/CryptoAlgorithmAES_KW.h: 110 * crypto/algorithms/CryptoAlgorithmHMAC.cpp: 111 (WebCore::CryptoAlgorithmHMAC::generateKey): 112 (WebCore::CryptoAlgorithmHMAC::importKey): 113 * crypto/algorithms/CryptoAlgorithmHMAC.h: 114 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp: 115 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey): 116 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h: 117 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: 118 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey): 119 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: 120 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp: 121 (WebCore::CryptoAlgorithmRSA_OAEP::importKey): 122 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h: 123 * crypto/keys/CryptoKeyAES.cpp: 124 (WebCore::CryptoKeyAES::CryptoKeyAES): 125 (WebCore::CryptoKeyAES::generate): 126 (WebCore::CryptoKeyAES::importRaw): 127 (WebCore::CryptoKeyAES::importJwk): 128 * crypto/keys/CryptoKeyAES.h: 129 * crypto/keys/CryptoKeyDataRSAComponents.cpp: 130 (WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents): 131 * crypto/keys/CryptoKeyDataRSAComponents.h: 132 * crypto/keys/CryptoKeyHMAC.cpp: 133 (WebCore::CryptoKeyHMAC::CryptoKeyHMAC): 134 (WebCore::CryptoKeyHMAC::generate): 135 (WebCore::CryptoKeyHMAC::importRaw): 136 (WebCore::CryptoKeyHMAC::importJwk): 137 (WebCore::CryptoKeyHMAC::buildAlgorithm): 138 * crypto/keys/CryptoKeyHMAC.h: 139 * crypto/keys/CryptoKeyRSA.cpp: Added. 140 (WebCore::CryptoKeyRSA::importJwk): 141 * crypto/keys/CryptoKeyRSA.h: 142 * crypto/parameters/CryptoAlgorithmHmacKeyParams.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h. 143 * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h: Added. 144 * crypto/parameters/HmacKeyParams.idl: Renamed from Source/WebCore/crypto/parameters/HmacKeyGenParams.idl. 145 * crypto/parameters/RsaHashedImportParams.idl: Added. 146 1 147 2016-11-10 Brady Eidson <beidson@apple.com> 2 148 -
trunk/Source/WebCore/DerivedSources.make
r208539 r208548 253 253 $(WebCore)/crypto/CryptoKey.idl \ 254 254 $(WebCore)/crypto/CryptoKeyPair.idl \ 255 $(WebCore)/crypto/JsonWebKey.idl \ 255 256 $(WebCore)/crypto/parameters/AesKeyGenParams.idl \ 256 $(WebCore)/crypto/parameters/HmacKeyGenParams.idl \ 257 $(WebCore)/crypto/parameters/HmacKeyParams.idl \ 258 $(WebCore)/crypto/parameters/RsaHashedImportParams.idl \ 257 259 $(WebCore)/crypto/parameters/RsaHashedKeyGenParams.idl \ 258 260 $(WebCore)/crypto/parameters/RsaKeyGenParams.idl \ 261 $(WebCore)/crypto/RsaOtherPrimesInfo.idl \ 259 262 $(WebCore)/crypto/SubtleCrypto.idl \ 260 263 $(WebCore)/crypto/WebKitSubtleCrypto.idl \ -
trunk/Source/WebCore/PlatformEfl.cmake
r208440 r208548 439 439 crypto/keys/CryptoKeyDataRSAComponents.cpp 440 440 crypto/keys/CryptoKeyHMAC.cpp 441 crypto/keys/CryptoKeyRSA.cpp 441 442 crypto/keys/CryptoKeySerializationRaw.cpp 442 443 ) -
trunk/Source/WebCore/PlatformGTK.cmake
r208297 r208548 436 436 crypto/keys/CryptoKeyDataRSAComponents.cpp 437 437 crypto/keys/CryptoKeyHMAC.cpp 438 crypto/keys/CryptoKeyRSA.cpp 438 439 crypto/keys/CryptoKeySerializationRaw.cpp 439 440 ) -
trunk/Source/WebCore/PlatformMac.cmake
r208534 r208548 201 201 crypto/keys/CryptoKeyDataRSAComponents.cpp 202 202 crypto/keys/CryptoKeyHMAC.cpp 203 crypto/keys/CryptoKeyRSA.cpp 203 204 crypto/keys/CryptoKeySerializationRaw.cpp 204 205 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r208539 r208548 2375 2375 577483141DAEC2EB00716EF9 /* JSAesKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 577483131DAEC2EA00716EF9 /* JSAesKeyGenParams.h */; }; 2376 2376 577483161DAEC32300716EF9 /* JSAesKeyGenParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 577483151DAEC32200716EF9 /* JSAesKeyGenParams.cpp */; }; 2377 577483191DB4491F00716EF9 /* CryptoAlgorithmHmacKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyGenParams.h */; }; 2378 5774831B1DB459BA00716EF9 /* JSHmacKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5774831A1DB459BA00716EF9 /* JSHmacKeyGenParams.h */; }; 2379 5774831D1DB459DE00716EF9 /* JSHmacKeyGenParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5774831C1DB459DE00716EF9 /* JSHmacKeyGenParams.cpp */; }; 2377 577483191DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h */; }; 2380 2378 5778BD821DA4806C009E3009 /* SubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 5778BD811DA4802C009E3009 /* SubtleCrypto.h */; }; 2381 2379 5778BD841DA4817B009E3009 /* SubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */; }; 2380 579F6E051DCD7EE400546D80 /* CryptoAlgorithmRsaHashedKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E233741DCD6D3B00F28D01 /* CryptoAlgorithmRsaHashedKeyGenParams.h */; }; 2382 2381 57A9C88E1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57A9C88D1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp */; }; 2382 57E2335B1DC7D5E500F28D01 /* JSJsonWebKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E2335A1DC7D5E500F28D01 /* JSJsonWebKey.h */; }; 2383 57E2335D1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E2335C1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h */; }; 2384 57E2335F1DC7D67B00F28D01 /* JSJsonWebKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57E2335E1DC7D67B00F28D01 /* JSJsonWebKey.cpp */; }; 2385 57E233611DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57E233601DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp */; }; 2386 57E233631DC7DA2400F28D01 /* RsaOtherPrimesInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E233621DC7DA2400F28D01 /* RsaOtherPrimesInfo.h */; }; 2387 57E233651DC7DB1F00F28D01 /* JsonWebKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E233641DC7DB1F00F28D01 /* JsonWebKey.h */; }; 2388 57E233671DCAB21C00F28D01 /* JSHmacKeyParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E233661DCAB21C00F28D01 /* JSHmacKeyParams.h */; }; 2389 57E233691DCAB24300F28D01 /* JSHmacKeyParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57E233681DCAB24300F28D01 /* JSHmacKeyParams.cpp */; }; 2390 57E2336B1DCC262400F28D01 /* CryptoKeyRSA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57E2336A1DCC262400F28D01 /* CryptoKeyRSA.cpp */; }; 2391 57E2336E1DCD43FD00F28D01 /* CryptoAlgorithmRsaHashedImportParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E2336D1DCD43FD00F28D01 /* CryptoAlgorithmRsaHashedImportParams.h */; }; 2392 57E233711DCD468F00F28D01 /* JSRsaHashedImportParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E233701DCD468F00F28D01 /* JSRsaHashedImportParams.h */; }; 2393 57E233731DCD46B600F28D01 /* JSRsaHashedImportParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57E233721DCD46B600F28D01 /* JSRsaHashedImportParams.cpp */; }; 2383 2394 57EF5E601D20C83900171E60 /* TextCodecReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 57EF5E5F1D20C83900171E60 /* TextCodecReplacement.h */; }; 2384 2395 57EF5E621D20D28700171E60 /* TextCodecReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57EF5E611D20D28700171E60 /* TextCodecReplacement.cpp */; }; 2385 57F8273B1DB72D64009D2BF4 /* CryptoAlgorithmRsaHashedKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57F8273A1DB72D64009D2BF4 /* CryptoAlgorithmRsaHashedKeyGenParams.h */; };2386 2396 57FEDD3F1DB6D59200EB96F5 /* CryptoAlgorithmRsaKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57FEDD3E1DB6D59200EB96F5 /* CryptoAlgorithmRsaKeyGenParams.h */; }; 2387 2397 57FEDD411DB6D73A00EB96F5 /* JSRsaKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57FEDD401DB6D73A00EB96F5 /* JSRsaKeyGenParams.h */; }; … … 9588 9598 577483131DAEC2EA00716EF9 /* JSAesKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAesKeyGenParams.h; sourceTree = "<group>"; }; 9589 9599 577483151DAEC32200716EF9 /* JSAesKeyGenParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAesKeyGenParams.cpp; sourceTree = "<group>"; }; 9590 577483171DB1FE8900716EF9 /* HmacKeyGenParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HmacKeyGenParams.idl; sourceTree = "<group>"; }; 9591 577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmHmacKeyGenParams.h; sourceTree = "<group>"; }; 9592 5774831A1DB459BA00716EF9 /* JSHmacKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHmacKeyGenParams.h; sourceTree = "<group>"; }; 9593 5774831C1DB459DE00716EF9 /* JSHmacKeyGenParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHmacKeyGenParams.cpp; sourceTree = "<group>"; }; 9600 577483171DB1FE8900716EF9 /* HmacKeyParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HmacKeyParams.idl; sourceTree = "<group>"; }; 9601 577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmHmacKeyParams.h; sourceTree = "<group>"; }; 9594 9602 5778BD801DA4733E009E3009 /* SubtleCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SubtleCrypto.idl; sourceTree = "<group>"; }; 9595 9603 5778BD811DA4802C009E3009 /* SubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtleCrypto.h; sourceTree = "<group>"; }; 9596 9604 5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtleCrypto.cpp; sourceTree = "<group>"; }; 9597 9605 57A9C88D1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCryptoCustom.cpp; sourceTree = "<group>"; }; 9606 57E233571DC7D24800F28D01 /* JsonWebKey.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = JsonWebKey.idl; sourceTree = "<group>"; }; 9607 57E233591DC7D37200F28D01 /* RsaOtherPrimesInfo.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RsaOtherPrimesInfo.idl; sourceTree = "<group>"; }; 9608 57E2335A1DC7D5E500F28D01 /* JSJsonWebKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSJsonWebKey.h; sourceTree = "<group>"; }; 9609 57E2335C1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRsaOtherPrimesInfo.h; sourceTree = "<group>"; }; 9610 57E2335E1DC7D67B00F28D01 /* JSJsonWebKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSJsonWebKey.cpp; sourceTree = "<group>"; }; 9611 57E233601DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRsaOtherPrimesInfo.cpp; sourceTree = "<group>"; }; 9612 57E233621DC7DA2400F28D01 /* RsaOtherPrimesInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RsaOtherPrimesInfo.h; sourceTree = "<group>"; }; 9613 57E233641DC7DB1F00F28D01 /* JsonWebKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JsonWebKey.h; sourceTree = "<group>"; }; 9614 57E233661DCAB21C00F28D01 /* JSHmacKeyParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHmacKeyParams.h; sourceTree = "<group>"; }; 9615 57E233681DCAB24300F28D01 /* JSHmacKeyParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHmacKeyParams.cpp; sourceTree = "<group>"; }; 9616 57E2336A1DCC262400F28D01 /* CryptoKeyRSA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyRSA.cpp; sourceTree = "<group>"; }; 9617 57E2336C1DCD437000F28D01 /* RsaHashedImportParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RsaHashedImportParams.idl; sourceTree = "<group>"; }; 9618 57E2336D1DCD43FD00F28D01 /* CryptoAlgorithmRsaHashedImportParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaHashedImportParams.h; sourceTree = "<group>"; }; 9619 57E233701DCD468F00F28D01 /* JSRsaHashedImportParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRsaHashedImportParams.h; sourceTree = "<group>"; }; 9620 57E233721DCD46B600F28D01 /* JSRsaHashedImportParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRsaHashedImportParams.cpp; sourceTree = "<group>"; }; 9621 57E233741DCD6D3B00F28D01 /* CryptoAlgorithmRsaHashedKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaHashedKeyGenParams.h; sourceTree = "<group>"; }; 9598 9622 57EF5E5F1D20C83900171E60 /* TextCodecReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCodecReplacement.h; sourceTree = "<group>"; }; 9599 9623 57EF5E611D20D28700171E60 /* TextCodecReplacement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextCodecReplacement.cpp; sourceTree = "<group>"; }; 9600 9624 57F827391DB72C22009D2BF4 /* RsaHashedKeyGenParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RsaHashedKeyGenParams.idl; sourceTree = "<group>"; }; 9601 57F8273A1DB72D64009D2BF4 /* CryptoAlgorithmRsaHashedKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaHashedKeyGenParams.h; sourceTree = "<group>"; };9602 9625 57FEDD3D1DB6D47F00EB96F5 /* RsaKeyGenParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RsaKeyGenParams.idl; sourceTree = "<group>"; }; 9603 9626 57FEDD3E1DB6D59200EB96F5 /* CryptoAlgorithmRsaKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaKeyGenParams.h; sourceTree = "<group>"; }; … … 16511 16534 148B4FFF1B6904C500C954E4 /* CountQueuingStrategy.idl */, 16512 16535 9908B0EE1BCACF9100ED0F65 /* CountQueuingStrategy.js */, 16513 9908B0F11BCACF9100ED3F64 /* ReadableByteStreamInternals.js */,16514 16536 41189EF71AD8232800B93F64 /* ReadableByteStreamController.idl */, 16515 16537 9908B0F01BCACF9100ED3F64 /* ReadableByteStreamController.js */, 16538 9908B0F11BCACF9100ED3F64 /* ReadableByteStreamInternals.js */, 16516 16539 41A023ED1A39DB7900F722CF /* ReadableStream.idl */, 16517 16540 9908B0EF1BCACF9100ED0F65 /* ReadableStream.js */, … … 17804 17827 BC94D1510C275C8B006BC617 /* History.h */, 17805 17828 BC94D1520C275C8B006BC617 /* History.idl */, 17829 0F4710D51DB6FE22002DCEC3 /* IntersectionObserver.cpp */, 17806 17830 0F4710D61DB6FE22002DCEC3 /* IntersectionObserver.h */, 17807 0F4710D51DB6FE22002DCEC3 /* IntersectionObserver.cpp */,17808 17831 0F4710D71DB6FE22002DCEC3 /* IntersectionObserver.idl */, 17809 17832 0F8B45711DC3FBA300443C3F /* IntersectionObserverCallback.h */, … … 18034 18057 isa = PBXGroup; 18035 18058 children = ( 18036 714131481DC9D6EF00336107 /* js-files */,18037 71D02D901DB55C4E00DD5CF5 /* main.js */,18038 18059 716FA0D71DB26591007323CC /* controls */, 18039 18060 71D6AA6F1DA4EAF700B23969 /* images */, 18061 714131481DC9D6EF00336107 /* js-files */, 18040 18062 71D02D911DB55C4E00DD5CF5 /* media */, 18063 71D02D901DB55C4E00DD5CF5 /* main.js */, 18041 18064 ); 18042 18065 path = "modern-media-controls"; … … 22868 22891 E125F8331822F18A00D84CD9 /* CryptoKeyHMAC.cpp */, 22869 22892 E125F8341822F18A00D84CD9 /* CryptoKeyHMAC.h */, 22893 57E2336A1DCC262400F28D01 /* CryptoKeyRSA.cpp */, 22870 22894 E164FAA218315BF400DB4E61 /* CryptoKeyRSA.h */, 22871 22895 E125F857182C1AA600D84CD9 /* CryptoKeySerializationRaw.cpp */, … … 22882 22906 577483111DADC55D00716EF9 /* CryptoAlgorithmAesKeyGenParams.h */, 22883 22907 E19AC3F61824E5D100349426 /* CryptoAlgorithmAesKeyGenParamsDeprecated.h */, 22884 577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKey GenParams.h */,22908 577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h */, 22885 22909 E19DA29B18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParamsDeprecated.h */, 22886 22910 E1C6571E1816E50300256CDD /* CryptoAlgorithmHmacParamsDeprecated.h */, 22887 57F8273A1DB72D64009D2BF4 /* CryptoAlgorithmRsaHashedKeyGenParams.h */, 22911 57E2336D1DCD43FD00F28D01 /* CryptoAlgorithmRsaHashedImportParams.h */, 22912 57E233741DCD6D3B00F28D01 /* CryptoAlgorithmRsaHashedKeyGenParams.h */, 22888 22913 57FEDD3E1DB6D59200EB96F5 /* CryptoAlgorithmRsaKeyGenParams.h */, 22889 22914 E1BD331D182D8F4200C05D9F /* CryptoAlgorithmRsaKeyGenParamsDeprecated.h */, … … 22891 22916 E1FE1376184D1E3300892F13 /* CryptoAlgorithmRsaOaepParamsDeprecated.h */, 22892 22917 E1BD331B182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h */, 22893 577483171DB1FE8900716EF9 /* HmacKeyGenParams.idl */, 22918 577483171DB1FE8900716EF9 /* HmacKeyParams.idl */, 22919 57E2336C1DCD437000F28D01 /* RsaHashedImportParams.idl */, 22894 22920 57F827391DB72C22009D2BF4 /* RsaHashedKeyGenParams.idl */, 22895 22921 57FEDD3D1DB6D47F00EB96F5 /* RsaKeyGenParams.idl */, … … 23029 23055 E19727151820549E00592D51 /* CryptoKeyType.h */, 23030 23056 E172AF6F180F289500FBADB9 /* CryptoKeyUsage.h */, 23057 57E233641DC7DB1F00F28D01 /* JsonWebKey.h */, 23058 57E233571DC7D24800F28D01 /* JsonWebKey.idl */, 23059 57E233621DC7DA2400F28D01 /* RsaOtherPrimesInfo.h */, 23060 57E233591DC7D37200F28D01 /* RsaOtherPrimesInfo.idl */, 23031 23061 E18DF33418AAF12C00773E59 /* SerializedCryptoKeyWrap.h */, 23032 23062 5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */, … … 23051 23081 E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */, 23052 23082 E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */, 23053 5774831C1DB459DE00716EF9 /* JSHmacKeyGenParams.cpp */, 23054 5774831A1DB459BA00716EF9 /* JSHmacKeyGenParams.h */, 23083 57E233681DCAB24300F28D01 /* JSHmacKeyParams.cpp */, 23084 57E233661DCAB21C00F28D01 /* JSHmacKeyParams.h */, 23085 57E2335E1DC7D67B00F28D01 /* JSJsonWebKey.cpp */, 23086 57E2335A1DC7D5E500F28D01 /* JSJsonWebKey.h */, 23087 57E233721DCD46B600F28D01 /* JSRsaHashedImportParams.cpp */, 23088 57E233701DCD468F00F28D01 /* JSRsaHashedImportParams.h */, 23055 23089 5768E4351DB7527300D0A4F7 /* JSRsaHashedKeyGenParams.cpp */, 23056 23090 5768E4331DB7524500D0A4F7 /* JSRsaHashedKeyGenParams.h */, 23057 23091 57FEDD421DB6D76000EB96F5 /* JSRsaKeyGenParams.cpp */, 23058 23092 57FEDD401DB6D73A00EB96F5 /* JSRsaKeyGenParams.h */, 23093 57E233601DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp */, 23094 57E2335C1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h */, 23059 23095 571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */, 23060 23096 571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */, … … 24645 24681 7CD0BA051B8F79C9005CEBBE /* ActiveDOMCallbackMicrotask.h in Headers */, 24646 24682 E1C4DE690EA75C1E0023CCD6 /* ActiveDOMObject.h in Headers */, 24683 724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */, 24684 724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */, 24647 24685 BCF7E491137CD7C7001DDAE7 /* AdjustViewSizeOrNot.h in Headers */, 24648 24686 84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */, … … 24977 25015 E19AC3F71824E5D100349426 /* CryptoAlgorithmAesKeyGenParamsDeprecated.h in Headers */, 24978 25016 E125F8321822F11B00D84CD9 /* CryptoAlgorithmHMAC.h in Headers */, 24979 577483191DB4491F00716EF9 /* CryptoAlgorithmHmacKey GenParams.h in Headers */,25017 577483191DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h in Headers */, 24980 25018 E19DA29C18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParamsDeprecated.h in Headers */, 24981 25019 E1C6571F1816E50300256CDD /* CryptoAlgorithmHmacParamsDeprecated.h in Headers */, … … 24986 25024 E1FE136B183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.h in Headers */, 24987 25025 E1233F0D185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h in Headers */, 25026 57E2336E1DCD43FD00F28D01 /* CryptoAlgorithmRsaHashedImportParams.h in Headers */, 24988 25027 57F8273B1DB72D64009D2BF4 /* CryptoAlgorithmRsaHashedKeyGenParams.h in Headers */, 24989 25028 57FEDD3F1DB6D59200EB96F5 /* CryptoAlgorithmRsaKeyGenParams.h in Headers */, … … 25018 25057 BC274B2F140EBEB200EADFA6 /* CSSBorderImageSliceValue.h in Headers */, 25019 25058 49AE2D8F134EE50C0072920A /* CSSCalculationValue.h in Headers */, 25020 519DBC6F1DC011A700329BF5 /* IDBGetAllRecordsData.h in Headers */,25021 25059 BC6049CC0DB560C200204739 /* CSSCanvasValue.h in Headers */, 25022 25060 BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */, … … 25240 25278 A8185F3B09765766005826D9 /* DOMImplementation.h in Headers */, 25241 25279 E3150EA71DA7219300194012 /* DOMJITHelpers.h in Headers */, 25280 E3C99A091DC3D41C00794AD3 /* DOMJITCheckDOM.h in Headers */, 25281 E3A776671DC85D2800B690D8 /* DOMJITIDLConvert.h in Headers */, 25282 E3A776681DC85D2800B690D8 /* DOMJITIDLType.h in Headers */, 25283 E35802B61DC8435D00A9773C /* DOMJITIDLTypeFilter.h in Headers */, 25242 25284 A9C6E4E40D745E05006442E9 /* DOMMimeType.h in Headers */, 25243 25285 A9C6E4E80D745E18006442E9 /* DOMMimeTypeArray.h in Headers */, … … 25673 25715 5185FC8B1BB4C4E80012898F /* IDBEventDispatcher.h in Headers */, 25674 25716 5185FC8D1BB4C4E80012898F /* IDBFactory.h in Headers */, 25717 519DBC6F1DC011A700329BF5 /* IDBGetAllRecordsData.h in Headers */, 25718 519DBC721DC10F5200329BF5 /* IDBGetAllResult.h in Headers */, 25675 25719 5105F0691D4BA9D900FB80BC /* IDBGetRecordData.h in Headers */, 25676 25720 5185FC8F1BB4C4E80012898F /* IDBGetResult.h in Headers */, … … 25793 25837 F3ABFE0C130E9DA000E7F7D1 /* InstrumentingAgents.h in Headers */, 25794 25838 0F4710DC1DB6FE22002DCEC3 /* IntersectionObserver.h in Headers */, 25839 0F8B45721DC3FBA300443C3F /* IntersectionObserverCallback.h in Headers */, 25795 25840 0F4710DF1DB6FE22002DCEC3 /* IntersectionObserverEntry.h in Headers */, 25796 25841 B27535720B053814002CE64F /* IntPoint.h in Headers */, … … 25941 25986 BCBFB53D0DCD29CF0019B3E5 /* JSDOMWindowShell.h in Headers */, 25942 25987 65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */, 25943 E3 A776671DC85D2800B690D8 /* DOMJITIDLConvert.h in Headers */,25988 E318039D1DC40099009932C2 /* JSDynamicDowncast.h in Headers */, 25944 25989 FD7868BA136B999200D403DF /* JSDynamicsCompressorNode.h in Headers */, 25945 25990 65DF31FA09D1CC60000BE325 /* JSElement.h in Headers */, … … 25971 26016 C280833F1C6DC26F001451B6 /* JSFontFace.h in Headers */, 25972 26017 1C24EEA91C72A7B40080F8FC /* JSFontFaceSet.h in Headers */, 25973 0F8B45721DC3FBA300443C3F /* IntersectionObserverCallback.h in Headers */,25974 26018 FDA15EAC12B03EE1003A583A /* JSGainNode.h in Headers */, 25975 26019 518F5002194CAC3A0081BAAE /* JSGamepad.h in Headers */, … … 25980 26024 8482B7521198CB6B00BFB005 /* JSHashChangeEvent.h in Headers */, 25981 26025 BC94D14F0C275C68006BC617 /* JSHistory.h in Headers */, 25982 57 74831B1DB459BA00716EF9 /* JSHmacKeyGenParams.h in Headers */,26026 57E233671DCAB21C00F28D01 /* JSHmacKeyParams.h in Headers */, 25983 26027 BC97E413109154FA0010D361 /* JSHTMLAllCollection.h in Headers */, 25984 26028 1A4A2DF00A1B852A00C807F8 /* JSHTMLAnchorElement.h in Headers */, … … 26077 26121 7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */, 26078 26122 0F4710E61DB700C7002DCEC3 /* JSIntersectionObserver.h in Headers */, 26123 0F8B45761DC41DBA00443C3F /* JSIntersectionObserverCallback.h in Headers */, 26079 26124 0F4710E81DB700C7002DCEC3 /* JSIntersectionObserverEntry.h in Headers */, 26125 57E2335B1DC7D5E500F28D01 /* JSJsonWebKey.h in Headers */, 26080 26126 A86629D309DA2B48009633A5 /* JSKeyboardEvent.h in Headers */, 26081 26127 12A253E11C8FFF6600C22295 /* JSKeyframeEffect.h in Headers */, … … 26143 26189 FDF6BAF9134A4C9800822920 /* JSOfflineAudioCompletionEvent.h in Headers */, 26144 26190 FDA9326716703BA9008982DC /* JSOfflineAudioContext.h in Headers */, 26191 57E233651DC7DB1F00F28D01 /* JsonWebKey.h in Headers */, 26145 26192 FDEA6243152102E200479DF0 /* JSOscillatorNode.h in Headers */, 26146 26193 0704A40C1D6DFC690086DCDB /* JSOverconstrainedError.h in Headers */, … … 26174 26221 4998AECE13F9D6C90090B1AA /* JSRequestAnimationFrameCallback.h in Headers */, 26175 26222 BC74DA491013F468007987AD /* JSRGBColor.h in Headers */, 26223 57E233711DCD468F00F28D01 /* JSRsaHashedImportParams.h in Headers */, 26176 26224 5768E4341DB7524500D0A4F7 /* JSRsaHashedKeyGenParams.h in Headers */, 26177 26225 57FEDD411DB6D73A00EB96F5 /* JSRsaKeyGenParams.h in Headers */, 26226 57E2335D1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h in Headers */, 26178 26227 073794E619EE2FF200E5A045 /* JSRTCConfiguration.h in Headers */, 26179 26228 07969DAC17D14151007FF842 /* JSRTCDataChannel.h in Headers */, … … 26495 26544 FFDBC047183D27B700407109 /* LineWidth.h in Headers */, 26496 26545 A7AD2F880EC89D07008AB002 /* LinkHash.h in Headers */, 26497 519DBC721DC10F5200329BF5 /* IDBGetAllResult.h in Headers */,26498 26546 1A4DA4221CDD3A8300F4473C /* LinkIconCollector.h in Headers */, 26499 26547 1A250E0D1CDD632000D0BE63 /* LinkIconType.h in Headers */, … … 26606 26654 CD8ACA8F1D23971900ECC59E /* MediaRemoteSoftLink.h in Headers */, 26607 26655 CD8ACA8B1D23946400ECC59E /* MediaRemoteSPI.h in Headers */, 26608 724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */,26609 26656 CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */, 26610 26657 1BF9DB3C1D3973AD0026AEB7 /* MediaSample.h in Headers */, … … 26612 26659 CDBEAEAD19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h in Headers */, 26613 26660 C9027F421B1D0AD200BFBFEF /* MediaSession.h in Headers */, 26614 83C45B8E1DC2B68A008871BA /* ValidationBubble.h in Headers */,26615 26661 C9F87CFE1B28F40E00979B83 /* MediaSessionEvents.h in Headers */, 26616 26662 C96F5EC81B5872260091EA9D /* MediaSessionInterruptionProvider.h in Headers */, … … 27174 27220 49E911C90EF86D47009D0CAF /* RotateTransformOperation.h in Headers */, 27175 27221 A73F95FF12C97BFE0031AAF9 /* RoundedRect.h in Headers */, 27222 57E233631DC7DA2400F28D01 /* RsaOtherPrimesInfo.h in Headers */, 27176 27223 07AB996918DA3C010018771E /* RTCConfiguration.h in Headers */, 27177 27224 07AB996F18DA3C740018771E /* RTCConfigurationPrivate.h in Headers */, … … 27517 27564 084DB59B128008CC002A6D64 /* SVGAnimatedString.h in Headers */, 27518 27565 08250939128BD4D800E2ED8E /* SVGAnimatedTransformList.h in Headers */, 27519 E3A776681DC85D2800B690D8 /* DOMJITIDLType.h in Headers */,27520 27566 085A15931289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h in Headers */, 27521 27567 439D334313A6911C00C20F4F /* SVGAnimatedType.h in Headers */, … … 27667 27713 B2227A910D00BF220071B782 /* SVGPolygonElement.h in Headers */, 27668 27714 B2227A940D00BF220071B782 /* SVGPolylineElement.h in Headers */, 27669 E3C99A091DC3D41C00794AD3 /* DOMJITCheckDOM.h in Headers */,27670 27715 B2227A970D00BF220071B782 /* SVGPreserveAspectRatio.h in Headers */, 27671 27716 088A0E0A126EF1DB00978F7A /* SVGProperty.h in Headers */, … … 27759 27804 B2C3DA420D006C1D00EF6F26 /* TextCodecUTF16.h in Headers */, 27760 27805 9343CB8212F25E510033C5EE /* TextCodecUTF8.h in Headers */, 27761 0F8B45761DC41DBA00443C3F /* JSIntersectionObserverCallback.h in Headers */,27762 27806 142B97CA13138943008BEF4B /* TextControlInnerElements.h in Headers */, 27763 27807 582DE3251C30C85400BE02A8 /* TextDecorationPainter.h in Headers */, … … 27868 27912 5C6E65431D5CEFBF00F7862E /* URLParser.h in Headers */, 27869 27913 7CC289DF1AA0FE5D009A9CE3 /* URLRegistry.h in Headers */, 27870 E318039D1DC40099009932C2 /* JSDynamicDowncast.h in Headers */,27871 27914 93D437A21D57B3FE00AB85EA /* URLUtils.h in Headers */, 27872 27915 A72763BF16689BFB002FCACB /* UserActionElementSet.h in Headers */, … … 27896 27939 1FAFBF1915A5FA7400083A20 /* UTIUtilities.h in Headers */, 27897 27940 2E3BBF081162DA1100B9409A /* UUID.h in Headers */, 27941 83C45B8E1DC2B68A008871BA /* ValidationBubble.h in Headers */, 27898 27942 F5A154281279534D00D0B0C0 /* ValidationMessage.h in Headers */, 27899 27943 F513A3EA15FF4841001526DB /* ValidationMessageClient.h in Headers */, … … 28056 28100 4A5A2ADC161E7E00005889DD /* WebSocketExtensionParser.h in Headers */, 28057 28101 97AABD2414FA09D5007457AE /* WebSocketExtensionProcessor.h in Headers */, 28058 E35802B61DC8435D00A9773C /* DOMJITIDLTypeFilter.h in Headers */,28059 28102 97AABD2514FA09D5007457AE /* WebSocketFrame.h in Headers */, 28060 28103 97AABD2714FA09D5007457AE /* WebSocketHandshake.h in Headers */, … … 28075 28118 B10B6982140C174000BC1C26 /* WebVTTTokenizer.h in Headers */, 28076 28119 CD8203101395ACE700F956C6 /* WebWindowAnimation.h in Headers */, 28077 724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */,28078 28120 F55B3DE01251F12D003EF269 /* WeekInputType.h in Headers */, 28079 28121 85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */, … … 28523 28565 31A795C81888BCB500382F90 /* ANGLEInstancedArrays.cpp in Sources */, 28524 28566 490707E61219C04300D90E51 /* ANGLEWebKitBridge.cpp in Sources */, 28525 0F8B45751DC41DBA00443C3F /* JSIntersectionObserverCallback.cpp in Sources */,28526 28567 49E912AA0EFAC906009D0CAF /* Animation.cpp in Sources */, 28527 28568 316FE1110E6E1DA700BF6088 /* AnimationBase.cpp in Sources */, … … 28713 28754 CDEA76341460B56F008B31F1 /* ClockGeneric.cpp in Sources */, 28714 28755 9BD8A95A18BEFC7600987E9A /* CollectionIndexCache.cpp in Sources */, 28715 519DBC6E1DC011A200329BF5 /* IDBGetAllRecordsData.cpp in Sources */,28716 28756 B27535660B053814002CE64F /* Color.cpp in Sources */, 28717 28757 0FCF33240F2B9715004B6795 /* ColorCG.cpp in Sources */, … … 28811 28851 E19AC3F9182566F700349426 /* CryptoKeyMac.cpp in Sources */, 28812 28852 E1F80B8718317252007885C3 /* CryptoKeyPair.cpp in Sources */, 28853 57E2336B1DCC262400F28D01 /* CryptoKeyRSA.cpp in Sources */, 28813 28854 E164FAA518315E1A00DB4E61 /* CryptoKeyRSAMac.cpp in Sources */, 28814 28855 E125F859182C1AA600D84CD9 /* CryptoKeySerializationRaw.cpp in Sources */, … … 28816 28857 CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */, 28817 28858 94DE5C811D7F3A1400164F2A /* CSSAtRuleID.cpp in Sources */, 28818 41E408391DCB748900EFCE19 /* PeerConnectionBackend.cpp in Sources */,28819 28859 FBD6AF8B15EF25E5008B7110 /* CSSBasicShapes.cpp in Sources */, 28820 28860 E16A84F914C85CCC002977DF /* CSSBorderImage.cpp in Sources */, … … 29008 29048 2ED609BC1145B07100C8684E /* DOMFormData.cpp in Sources */, 29009 29049 A8185F3E09765766005826D9 /* DOMImplementation.cpp in Sources */, 29050 E398FC241DC32A20003C4684 /* DOMJITHelpers.cpp in Sources */, 29010 29051 A9C6E4E30D745E05006442E9 /* DOMMimeType.cpp in Sources */, 29011 29052 A9C6E4E70D745E18006442E9 /* DOMMimeTypeArray.cpp in Sources */, … … 29298 29339 A8EA7D310A19385500A8EF5F /* HTMLImageElement.cpp in Sources */, 29299 29340 A8EA7D300A19385500A8EF5F /* HTMLImageLoader.cpp in Sources */, 29300 E3B7C0631DC34160001FB0B8 /* JSDocumentDOMJIT.cpp in Sources */,29301 29341 A81369CD097374F600D74463 /* HTMLInputElement.cpp in Sources */, 29302 29342 93309DE5099E64920056E581 /* HTMLInterchange.cpp in Sources */, … … 29309 29349 A8EA7CAC0A192B9C00A8EF5F /* HTMLMarqueeElement.cpp in Sources */, 29310 29350 E44613A40CD6331000FADA75 /* HTMLMediaElement.cpp in Sources */, 29311 519DBC731DC10F5600329BF5 /* IDBGetAllResult.cpp in Sources */,29312 29351 C968B2E81B1E778100EF1F81 /* HTMLMediaElementMediaSession.cpp in Sources */, 29313 29352 0779BF0D18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp in Sources */, … … 29393 29432 5185FC8A1BB4C4E80012898F /* IDBEventDispatcher.cpp in Sources */, 29394 29433 5185FC8C1BB4C4E80012898F /* IDBFactory.cpp in Sources */, 29434 519DBC6E1DC011A200329BF5 /* IDBGetAllRecordsData.cpp in Sources */, 29435 519DBC731DC10F5600329BF5 /* IDBGetAllResult.cpp in Sources */, 29395 29436 5105F06B1D4BB12700FB80BC /* IDBGetRecordData.cpp in Sources */, 29396 29437 512F1A781C07EB6600908239 /* IDBGetResult.cpp in Sources */, … … 29516 29557 FDA15EC912B03F50003A583A /* JSAnalyserNode.cpp in Sources */, 29517 29558 31A795C61888BADC00382F90 /* JSANGLEInstancedArrays.cpp in Sources */, 29518 83C45B8C1DC2B667008871BA /* ValidationBubbleMac.mm in Sources */,29519 29559 12A253E21C8FFF6600C22295 /* JSAnimatable.cpp in Sources */, 29520 29560 120DE3FE1C87E18800B6D4DD /* JSAnimationEffect.cpp in Sources */, … … 29611 29651 9BE6710B1D5AEB2100345514 /* JSCustomElementRegistry.cpp in Sources */, 29612 29652 9BC5F9E01D5AAF6B002B749D /* JSCustomElementRegistryCustom.cpp in Sources */, 29613 E398FC241DC32A20003C4684 /* DOMJITHelpers.cpp in Sources */,29614 29653 E4778B7F115A581A00B5D372 /* JSCustomEvent.cpp in Sources */, 29615 29654 DEC297611B4F2F8D005F5945 /* JSCustomEventCustom.cpp in Sources */, … … 29633 29672 1221E05D1C02B444006A1A00 /* JSDocumentAnimation.cpp in Sources */, 29634 29673 49C7BA8D1042F5B10009D447 /* JSDocumentCustom.cpp in Sources */, 29674 E3B7C0631DC34160001FB0B8 /* JSDocumentDOMJIT.cpp in Sources */, 29635 29675 1A494EDE0A123F4C00FDAFC1 /* JSDocumentFragment.cpp in Sources */, 29636 29676 7C33F3621B4A050400502CAF /* JSDocumentFragmentCustom.cpp in Sources */, … … 29724 29764 BC94D14E0C275C68006BC617 /* JSHistory.cpp in Sources */, 29725 29765 BCE7B1930D4E86960075A539 /* JSHistoryCustom.cpp in Sources */, 29726 57 74831D1DB459DE00716EF9 /* JSHmacKeyGenParams.cpp in Sources */,29766 57E233691DCAB24300F28D01 /* JSHmacKeyParams.cpp in Sources */, 29727 29767 BC97E412109154FA0010D361 /* JSHTMLAllCollection.cpp in Sources */, 29728 29768 BC97E42C10915B060010D361 /* JSHTMLAllCollectionCustom.cpp in Sources */, … … 29735 29775 A80E7B120A19D606007FB8C5 /* JSHTMLBaseElement.cpp in Sources */, 29736 29776 1AE2AA220A1CDAB400B42B25 /* JSHTMLBodyElement.cpp in Sources */, 29737 837B7D201DC3F55000D051FC /* ValidationBubbleIOS.mm in Sources */,29738 29777 1AE2AA240A1CDAB400B42B25 /* JSHTMLBRElement.cpp in Sources */, 29739 29778 A80E7EA00A1A83E3007FB8C5 /* JSHTMLButtonElement.cpp in Sources */, … … 29846 29885 7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */, 29847 29886 0F4710E51DB700C7002DCEC3 /* JSIntersectionObserver.cpp in Sources */, 29887 0F8B45751DC41DBA00443C3F /* JSIntersectionObserverCallback.cpp in Sources */, 29848 29888 0F4710E71DB700C7002DCEC3 /* JSIntersectionObserverEntry.cpp in Sources */, 29889 57E2335F1DC7D67B00F28D01 /* JSJsonWebKey.cpp in Sources */, 29849 29890 A86629D409DA2B48009633A5 /* JSKeyboardEvent.cpp in Sources */, 29850 29891 12A253E01C8FFF6600C22295 /* JSKeyframeEffect.cpp in Sources */, … … 29960 30001 4998AECD13F9D6C90090B1AA /* JSRequestAnimationFrameCallback.cpp in Sources */, 29961 30002 BC74DA481013F468007987AD /* JSRGBColor.cpp in Sources */, 30003 57E233731DCD46B600F28D01 /* JSRsaHashedImportParams.cpp in Sources */, 29962 30004 5768E4361DB7527400D0A4F7 /* JSRsaHashedKeyGenParams.cpp in Sources */, 29963 30005 57FEDD431DB6D76000EB96F5 /* JSRsaKeyGenParams.cpp in Sources */, 30006 57E233611DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp in Sources */, 29964 30007 073794E519EE2FF200E5A045 /* JSRTCConfiguration.cpp in Sources */, 29965 30008 07969DAB17D14151007FF842 /* JSRTCDataChannel.cpp in Sources */, … … 30591 30634 B27535640B053814002CE64F /* PDFDocumentImage.cpp in Sources */, 30592 30635 2D6E468417D660F500ECF8BB /* PDFDocumentImageMac.mm in Sources */, 30636 41E408391DCB748900EFCE19 /* PeerConnectionBackend.cpp in Sources */, 30593 30637 8A7CC97012076F8A001D4588 /* PendingScript.cpp in Sources */, 30594 30638 E526AF3F1727F8F200E41781 /* Performance.cpp in Sources */, … … 31408 31452 1FAFBF1815A5FA6E00083A20 /* UTIUtilities.mm in Sources */, 31409 31453 2E3BBF071162DA1100B9409A /* UUID.cpp in Sources */, 31454 837B7D201DC3F55000D051FC /* ValidationBubbleIOS.mm in Sources */, 31455 83C45B8C1DC2B667008871BA /* ValidationBubbleMac.mm in Sources */, 31410 31456 F5A154271279534D00D0B0C0 /* ValidationMessage.cpp in Sources */, 31411 31457 FD3160AE12B026F700C1A359 /* VectorMath.cpp in Sources */, -
trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp
r207809 r208548 36 36 #include "JSCryptoKeyPair.h" 37 37 #include "JSDOMPromise.h" 38 #include "JSHmacKeyGenParams.h" 38 #include "JSHmacKeyParams.h" 39 #include "JSJsonWebKey.h" 40 #include "JSRsaHashedImportParams.h" 39 41 #include "JSRsaHashedKeyGenParams.h" 40 42 #include "JSRsaKeyGenParams.h" … … 48 50 49 51 enum class Operations { 52 Digest, 50 53 GenerateKey, 51 Digest,54 ImportKey, 52 55 }; 53 56 … … 87 90 std::unique_ptr<CryptoAlgorithmParameters> result; 88 91 switch (operation) { 89 case Operations::GenerateKey:90 switch (identifier) {91 case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5: {92 auto params = convertDictionary<CryptoAlgorithmRsaKeyGenParams>(state, value);93 RETURN_IF_EXCEPTION(scope, nullptr);94 result = std::make_unique<CryptoAlgorithmRsaKeyGenParams>(params);95 break;96 }97 case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:98 case CryptoAlgorithmIdentifier::RSA_PSS:99 case CryptoAlgorithmIdentifier::RSA_OAEP: {100 auto params = convertDictionary<CryptoAlgorithmRsaHashedKeyGenParams>(state, value);101 RETURN_IF_EXCEPTION(scope, nullptr);102 params.hashIdentifier = toHashIdentifier(state, params.hash);103 RETURN_IF_EXCEPTION(scope, nullptr);104 result = std::make_unique<CryptoAlgorithmRsaHashedKeyGenParams>(params);105 break;106 }107 case CryptoAlgorithmIdentifier::AES_CTR:108 case CryptoAlgorithmIdentifier::AES_CBC:109 case CryptoAlgorithmIdentifier::AES_CMAC:110 case CryptoAlgorithmIdentifier::AES_GCM:111 case CryptoAlgorithmIdentifier::AES_CFB:112 case CryptoAlgorithmIdentifier::AES_KW: {113 auto params = convertDictionary<CryptoAlgorithmAesKeyGenParams>(state, value);114 RETURN_IF_EXCEPTION(scope, nullptr);115 result = std::make_unique<CryptoAlgorithmAesKeyGenParams>(params);116 break;117 }118 case CryptoAlgorithmIdentifier::HMAC: {119 auto params = convertDictionary<CryptoAlgorithmHmacKeyGenParams>(state, value);120 RETURN_IF_EXCEPTION(scope, nullptr);121 params.hashIdentifier = toHashIdentifier(state, params.hash);122 RETURN_IF_EXCEPTION(scope, nullptr);123 result = std::make_unique<CryptoAlgorithmHmacKeyGenParams>(params);124 break;125 }126 default:127 setDOMException(&state, NOT_SUPPORTED_ERR);128 return nullptr;129 }130 break;131 92 case Operations::Digest: 132 93 switch (identifier) { … … 143 104 } 144 105 break; 106 case Operations::GenerateKey: 107 switch (identifier) { 108 case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5: { 109 auto params = convertDictionary<CryptoAlgorithmRsaKeyGenParams>(state, value); 110 RETURN_IF_EXCEPTION(scope, nullptr); 111 result = std::make_unique<CryptoAlgorithmRsaKeyGenParams>(params); 112 break; 113 } 114 case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5: 115 case CryptoAlgorithmIdentifier::RSA_PSS: 116 case CryptoAlgorithmIdentifier::RSA_OAEP: { 117 auto params = convertDictionary<CryptoAlgorithmRsaHashedKeyGenParams>(state, value); 118 RETURN_IF_EXCEPTION(scope, nullptr); 119 params.hashIdentifier = toHashIdentifier(state, params.hash); 120 RETURN_IF_EXCEPTION(scope, nullptr); 121 result = std::make_unique<CryptoAlgorithmRsaHashedKeyGenParams>(params); 122 break; 123 } 124 case CryptoAlgorithmIdentifier::AES_CTR: 125 case CryptoAlgorithmIdentifier::AES_CBC: 126 case CryptoAlgorithmIdentifier::AES_CMAC: 127 case CryptoAlgorithmIdentifier::AES_GCM: 128 case CryptoAlgorithmIdentifier::AES_CFB: 129 case CryptoAlgorithmIdentifier::AES_KW: { 130 auto params = convertDictionary<CryptoAlgorithmAesKeyGenParams>(state, value); 131 RETURN_IF_EXCEPTION(scope, nullptr); 132 result = std::make_unique<CryptoAlgorithmAesKeyGenParams>(params); 133 break; 134 } 135 case CryptoAlgorithmIdentifier::HMAC: { 136 auto params = convertDictionary<CryptoAlgorithmHmacKeyParams>(state, value); 137 RETURN_IF_EXCEPTION(scope, nullptr); 138 params.hashIdentifier = toHashIdentifier(state, params.hash); 139 RETURN_IF_EXCEPTION(scope, nullptr); 140 result = std::make_unique<CryptoAlgorithmHmacKeyParams>(params); 141 break; 142 } 143 default: 144 setDOMException(&state, NOT_SUPPORTED_ERR); 145 return nullptr; 146 } 147 break; 148 case Operations::ImportKey: 149 switch (identifier) { 150 case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5: 151 result = std::make_unique<CryptoAlgorithmParameters>(params); 152 break; 153 case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5: 154 case CryptoAlgorithmIdentifier::RSA_PSS: 155 case CryptoAlgorithmIdentifier::RSA_OAEP: { 156 auto params = convertDictionary<CryptoAlgorithmRsaHashedImportParams>(state, value); 157 RETURN_IF_EXCEPTION(scope, nullptr); 158 params.hashIdentifier = toHashIdentifier(state, params.hash); 159 RETURN_IF_EXCEPTION(scope, nullptr); 160 result = std::make_unique<CryptoAlgorithmRsaHashedImportParams>(params); 161 break; 162 } 163 case CryptoAlgorithmIdentifier::AES_CTR: 164 case CryptoAlgorithmIdentifier::AES_CBC: 165 case CryptoAlgorithmIdentifier::AES_CMAC: 166 case CryptoAlgorithmIdentifier::AES_GCM: 167 case CryptoAlgorithmIdentifier::AES_CFB: 168 case CryptoAlgorithmIdentifier::AES_KW: 169 result = std::make_unique<CryptoAlgorithmParameters>(params); 170 break; 171 case CryptoAlgorithmIdentifier::HMAC: { 172 auto params = convertDictionary<CryptoAlgorithmHmacKeyParams>(state, value); 173 RETURN_IF_EXCEPTION(scope, nullptr); 174 params.hashIdentifier = toHashIdentifier(state, params.hash); 175 RETURN_IF_EXCEPTION(scope, nullptr); 176 result = std::make_unique<CryptoAlgorithmHmacKeyParams>(params); 177 break; 178 } 179 default: 180 setDOMException(&state, NOT_SUPPORTED_ERR); 181 return nullptr; 182 } 183 break; 145 184 default: 146 185 ASSERT_NOT_REACHED(); … … 156 195 } 157 196 197 static CryptoKeyUsage cryptoKeyUsageFromString(const String& usageString) 198 { 199 CryptoKeyUsage result = 0; 200 if (usageString == "encrypt") 201 result = CryptoKeyUsageEncrypt; 202 else if (usageString == "decrypt") 203 result = CryptoKeyUsageDecrypt; 204 else if (usageString == "sign") 205 result = CryptoKeyUsageSign; 206 else if (usageString == "verify") 207 result = CryptoKeyUsageVerify; 208 else if (usageString == "deriveKey") 209 result = CryptoKeyUsageDeriveKey; 210 else if (usageString == "deriveBits") 211 result = CryptoKeyUsageDeriveBits; 212 else if (usageString == "wrapKey") 213 result = CryptoKeyUsageWrapKey; 214 else if (usageString == "unwrapKey") 215 result = CryptoKeyUsageUnwrapKey; 216 217 return result; 218 } 219 158 220 static CryptoKeyUsage cryptoKeyUsagesFromJSValue(ExecState& state, JSValue iterable) 159 221 { … … 167 229 String usageString = nextItem.toWTFString(state); 168 230 RETURN_IF_EXCEPTION(scope, void()); 169 if (usageString == "encrypt") 170 result |= CryptoKeyUsageEncrypt; 171 else if (usageString == "decrypt") 172 result |= CryptoKeyUsageDecrypt; 173 else if (usageString == "sign") 174 result |= CryptoKeyUsageSign; 175 else if (usageString == "verify") 176 result |= CryptoKeyUsageVerify; 177 else if (usageString == "deriveKey") 178 result |= CryptoKeyUsageDeriveKey; 179 else if (usageString == "deriveBits") 180 result |= CryptoKeyUsageDeriveBits; 181 else if (usageString == "wrapKey") 182 result |= CryptoKeyUsageWrapKey; 183 else if (usageString == "unwrapKey") 184 result |= CryptoKeyUsageUnwrapKey; 185 else 231 CryptoKeyUsage usage = cryptoKeyUsageFromString(usageString); 232 if (!usage) 186 233 throwTypeError(state, scope, ASCIILiteral("Invalid KeyUsages")); 234 235 // Maybe we shouldn't silently bypass duplicated usages? 236 result |= usage; 187 237 }); 188 238 RETURN_IF_EXCEPTION(scope, 0); … … 227 277 } 228 278 279 static KeyData toKeyData(ExecState& state, SubtleCrypto::KeyFormat format, JSValue value) 280 { 281 VM& vm = state.vm(); 282 auto scope = DECLARE_THROW_SCOPE(vm); 283 284 KeyData result; 285 switch (format) { 286 case SubtleCrypto::KeyFormat::Spki: 287 case SubtleCrypto::KeyFormat::Pkcs8: 288 setDOMException(&state, NOT_SUPPORTED_ERR); 289 return result; 290 case SubtleCrypto::KeyFormat::Raw: { 291 BufferSource bufferSource = convert<IDLBufferSource>(state, value); 292 RETURN_IF_EXCEPTION(scope, result); 293 Vector<uint8_t> vector; 294 vector.append(bufferSource.data(), bufferSource.length()); 295 result = WTFMove(vector); 296 return result; 297 } 298 case SubtleCrypto::KeyFormat::Jwk: { 299 result = convertDictionary<JsonWebKey>(state, value); 300 RETURN_IF_EXCEPTION(scope, result); 301 CryptoKeyUsage usages = 0; 302 if (WTF::get<JsonWebKey>(result).key_ops) { 303 for (auto usageString : WTF::get<JsonWebKey>(result).key_ops.value()) { 304 CryptoKeyUsage usage = cryptoKeyUsageFromString(usageString); 305 if (!usage) 306 throwTypeError(&state, scope, ASCIILiteral("Invalid key_ops")); 307 // Maybe we shouldn't silently bypass duplicated usages? 308 usages |= cryptoKeyUsageFromString(usageString); 309 } 310 } 311 WTF::get<JsonWebKey>(result).usages = usages; 312 return result; 313 } 314 } 315 ASSERT_NOT_REACHED(); 316 return result; 317 } 318 229 319 static void jsSubtleCryptoFunctionGenerateKeyPromise(ExecState& state, Ref<DeferredPromise>&& promise) 230 320 { … … 243 333 RETURN_IF_EXCEPTION(scope, void()); 244 334 245 auto keyUsages = cryptoKeyUsagesFromJSValue(state, state. argument(2));335 auto keyUsages = cryptoKeyUsagesFromJSValue(state, state.uncheckedArgument(2)); 246 336 RETURN_IF_EXCEPTION(scope, void()); 247 337 … … 276 366 } 277 367 368 static void jsSubtleCryptoFunctionImportKeyPromise(ExecState& state, Ref<DeferredPromise>&& promise) 369 { 370 VM& vm = state.vm(); 371 auto scope = DECLARE_THROW_SCOPE(vm); 372 373 if (UNLIKELY(state.argumentCount() < 5)) { 374 promise->reject<JSValue>(createNotEnoughArgumentsError(&state)); 375 return; 376 } 377 378 auto format = convertEnumeration<SubtleCrypto::KeyFormat>(state, state.uncheckedArgument(0)); 379 RETURN_IF_EXCEPTION(scope, void()); 380 381 auto keyData = toKeyData(state, format, state.uncheckedArgument(1)); 382 RETURN_IF_EXCEPTION(scope, void()); 383 384 auto params = normalizeCryptoAlgorithmParameters(state, state.uncheckedArgument(2), Operations::ImportKey); 385 RETURN_IF_EXCEPTION(scope, void()); 386 387 auto extractable = state.uncheckedArgument(3).toBoolean(&state); 388 RETURN_IF_EXCEPTION(scope, void()); 389 390 auto keyUsages = cryptoKeyUsagesFromJSValue(state, state.uncheckedArgument(4)); 391 RETURN_IF_EXCEPTION(scope, void()); 392 393 auto algorithm = createAlgorithm(state, params->identifier); 394 RETURN_IF_EXCEPTION(scope, void()); 395 396 auto callback = [capturedPromise = promise.copyRef()](CryptoKey& key) mutable { 397 if ((key.type() == CryptoKeyType::Private || key.type() == CryptoKeyType::Secret) && !key.usagesBitmap()) { 398 rejectWithException(WTFMove(capturedPromise), SYNTAX_ERR); 399 return; 400 } 401 capturedPromise->resolve(key); 402 }; 403 auto exceptionCallback = [capturedPromise = promise.copyRef()](ExceptionCode ec) mutable { 404 rejectWithException(WTFMove(capturedPromise), ec); 405 }; 406 407 // The spec suggests we should perform the following task asynchronously as of 11 December 2014: 408 // https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey 409 // That's simply not necessary. Therefore, we perform it synchronously. 410 algorithm->importKey(format, WTFMove(keyData), WTFMove(params), extractable, keyUsages, WTFMove(callback), WTFMove(exceptionCallback)); 411 } 412 278 413 JSValue JSSubtleCrypto::generateKey(ExecState& state) 279 414 { … … 281 416 } 282 417 418 JSValue JSSubtleCrypto::importKey(ExecState& state) 419 { 420 return callPromiseFunction<jsSubtleCryptoFunctionImportKeyPromise, PromiseExecutionScope::WindowOrWorker>(state); 421 } 422 283 423 } // namespace WebCore 284 424 -
trunk/Source/WebCore/crypto/CryptoAlgorithm.cpp
r207809 r208548 42 42 43 43 void CryptoAlgorithm::generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool, CryptoKeyUsage, KeyOrKeyPairCallback&&, ExceptionCallback&& exceptionCallback, ScriptExecutionContext*) 44 { 45 exceptionCallback(NOT_SUPPORTED_ERR); 46 } 47 48 void CryptoAlgorithm::importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool, CryptoKeyUsage, KeyCallback&&, ExceptionCallback&& exceptionCallback) 44 49 { 45 50 exceptionCallback(NOT_SUPPORTED_ERR); -
trunk/Source/WebCore/crypto/CryptoAlgorithm.h
r207809 r208548 29 29 #include "CryptoAlgorithmIdentifier.h" 30 30 #include "CryptoKeyUsage.h" 31 #include "JsonWebKey.h" 32 #include "SubtleCrypto.h" 31 33 #include <wtf/Function.h> 32 34 #include <wtf/Noncopyable.h> 33 35 #include <wtf/RefCounted.h> 36 #include <wtf/Variant.h> 34 37 #include <wtf/Vector.h> 35 38 … … 50 53 typedef std::pair<const uint8_t*, size_t> CryptoOperationData; 51 54 55 using KeyData = Variant<Vector<uint8_t>, JsonWebKey>; 56 52 57 class CryptoAlgorithm : public RefCounted<CryptoAlgorithm> { 53 58 public: … … 64 69 65 70 virtual void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext*); 71 virtual void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyCallback&&, ExceptionCallback&&); 66 72 67 73 // The following will be deprecated. -
trunk/Source/WebCore/crypto/CryptoAlgorithmParameters.h
r207809 r208548 39 39 None, 40 40 AesKeyGenParams, 41 HmacKey GenParams,41 HmacKeyParams, 42 42 RsaHashedKeyGenParams, 43 RsaHashedImportParams, 43 44 RsaKeyGenParams, 44 45 }; -
trunk/Source/WebCore/crypto/JsonWebKey.h
r208547 r208548 26 26 #pragma once 27 27 28 #include "CryptoAlgorithmParameters.h" 29 #include <runtime/JSCJSValue.h> 28 #include "CryptoKeyUsage.h" 29 #include "RsaOtherPrimesInfo.h" 30 #include <wtf/Vector.h> 30 31 31 32 #if ENABLE(SUBTLE_CRYPTO) … … 33 34 namespace WebCore { 34 35 35 class CryptoAlgorithmHmacKeyGenParams final : public CryptoAlgorithmParameters { 36 public: 37 // FIXME: Consider merging hash and hashIdentifier. 38 JSC::JSValue hash; 39 CryptoAlgorithmIdentifier hashIdentifier; 40 Optional<unsigned long> length; 36 struct JsonWebKey { 37 String kty; 38 Optional<String> use; 39 // FIXME: Consider merging key_ops and usages. 40 Optional<Vector<String>> key_ops; 41 CryptoKeyUsage usages; 42 Optional<String> alg; 41 43 42 Class parametersClass() const final { return Class::HmacKeyGenParams; } 44 Optional<bool> ext; 45 46 Optional<String> crv; 47 Optional<String> x; 48 Optional<String> y; 49 Optional<String> d; 50 Optional<String> n; 51 Optional<String> e; 52 Optional<String> p; 53 Optional<String> q; 54 Optional<String> dp; 55 Optional<String> dq; 56 Optional<String> qi; 57 Optional<Vector<RsaOtherPrimesInfo>> oth; 58 Optional<String> k; 43 59 }; 44 60 45 61 } // namespace WebCore 46 62 47 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(HmacKeyGenParams)48 49 63 #endif // ENABLE(SUBTLE_CRYPTO) -
trunk/Source/WebCore/crypto/JsonWebKey.idl
r208547 r208548 26 26 [ 27 27 Conditional=SUBTLE_CRYPTO, 28 ImplementedAs=CryptoAlgorithmHmacKeyGenParams 29 ] dictionary HmacKeyGenParams : CryptoAlgorithmParameters { 30 // The inner hash function to use. 31 required any hash; 32 // The length (in bits) of the key to generate. If unspecified, the 33 // recommended length will be used, which is the size of the associated hash function's block 34 // size. 35 [EnforceRange] unsigned long length; 28 ] dictionary JsonWebKey { 29 // The following fields are defined in Section 3.1 of JSON Web Key 30 required DOMString kty; 31 DOMString use; 32 sequence<DOMString> key_ops; 33 DOMString alg; 34 35 // The following fields are defined in JSON Web Key Parameters Registration 36 boolean ext; 37 38 // The following fields are defined in Section 6 of JSON Web Algorithms 39 DOMString crv; 40 DOMString x; 41 DOMString y; 42 DOMString d; 43 DOMString n; 44 DOMString e; 45 DOMString p; 46 DOMString q; 47 DOMString dp; 48 DOMString dq; 49 DOMString qi; 50 sequence<RsaOtherPrimesInfo> oth; 51 DOMString k; 36 52 }; -
trunk/Source/WebCore/crypto/RsaOtherPrimesInfo.h
r208547 r208548 26 26 #pragma once 27 27 28 #include "ContextDestructionObserver.h" 29 #include <wtf/Ref.h> 30 #include <wtf/RefCounted.h> 28 #include <wtf/text/WTFString.h> 31 29 32 30 #if ENABLE(SUBTLE_CRYPTO) … … 34 32 namespace WebCore { 35 33 36 class SubtleCrypto : public ContextDestructionObserver, public RefCounted<SubtleCrypto> { 37 public: 38 static Ref<SubtleCrypto> create(ScriptExecutionContext& context) { return adoptRef(*new SubtleCrypto(context)); } 39 40 private: 41 SubtleCrypto(ScriptExecutionContext&); 34 struct RsaOtherPrimesInfo { 35 String r; 36 String d; 37 String t; 42 38 }; 43 39 44 } 40 } // namespace WebCore 45 41 46 #endif 42 #endif // ENABLE(SUBTLE_CRYPTO) -
trunk/Source/WebCore/crypto/RsaOtherPrimesInfo.idl
r208547 r208548 26 26 [ 27 27 Conditional=SUBTLE_CRYPTO, 28 Exposed=(Window,Worker), 29 GenerateIsReachable=ImplScriptExecutionContext, 30 NoInterfaceObject, 31 ] interface SubtleCrypto { 32 // FIXME: Should this return a Promise<(CryptoKey or CryptoKeyPair)>? 33 [Custom] Promise<any> generateKey(AlgorithmIdentifier algorithm, boolean extractable, sequence<KeyUsage> keyUsages); 28 ] dictionary RsaOtherPrimesInfo { 29 // The following fields are defined in Section 6.3.2.7 of JSON Web Algorithms 30 required DOMString r; 31 required DOMString d; 32 required DOMString t; 34 33 }; -
trunk/Source/WebCore/crypto/SubtleCrypto.h
r206883 r208548 36 36 class SubtleCrypto : public ContextDestructionObserver, public RefCounted<SubtleCrypto> { 37 37 public: 38 enum class KeyFormat { Raw, Spki, Pkcs8, Jwk }; 39 38 40 static Ref<SubtleCrypto> create(ScriptExecutionContext& context) { return adoptRef(*new SubtleCrypto(context)); } 39 41 -
trunk/Source/WebCore/crypto/SubtleCrypto.idl
r208474 r208548 24 24 */ 25 25 26 enum KeyFormat { "raw", "spki", "pkcs8", "jwk" }; 27 26 28 [ 27 29 Conditional=SUBTLE_CRYPTO, … … 32 34 // FIXME: Should this return a Promise<(CryptoKey or CryptoKeyPair)>? 33 35 [Custom] Promise<any> generateKey(AlgorithmIdentifier algorithm, boolean extractable, sequence<KeyUsage> keyUsages); 36 [Custom] Promise<CryptoKey> importKey(KeyFormat format, (BufferSource or JsonWebKey) keyData, AlgorithmIdentifier algorithm, boolen extractable, sequence<KeyUsage> keyUsages); 34 37 }; -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
r207809 r208548 40 40 const char* const CryptoAlgorithmAES_CBC::s_name = "AES-CBC"; 41 41 42 static inline bool usagesAreInvalidForCryptoAlgorithmAES_CBC(CryptoKeyUsage usages) 43 { 44 return usages & (CryptoKeyUsageSign | CryptoKeyUsageVerify | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits); 45 } 46 42 47 CryptoAlgorithmAES_CBC::CryptoAlgorithmAES_CBC() 43 48 { … … 71 76 const auto& aesParameters = downcast<CryptoAlgorithmAesKeyGenParams>(*parameters); 72 77 73 if (usages & (CryptoKeyUsageSign | CryptoKeyUsageVerify | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits)) {78 if (usagesAreInvalidForCryptoAlgorithmAES_CBC(usages)) { 74 79 exceptionCallback(SYNTAX_ERR); 75 80 return; … … 83 88 84 89 callback(result.get(), nullptr); 90 } 91 92 void CryptoAlgorithmAES_CBC::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsage usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) 93 { 94 if (usagesAreInvalidForCryptoAlgorithmAES_CBC(usages)) { 95 exceptionCallback(SYNTAX_ERR); 96 return; 97 } 98 99 RefPtr<CryptoKeyAES> result; 100 switch (format) { 101 case SubtleCrypto::KeyFormat::Raw: 102 result = CryptoKeyAES::importRaw(parameters->identifier, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages); 103 break; 104 case SubtleCrypto::KeyFormat::Jwk: { 105 auto checkAlgCallback = [](size_t length, const Optional<String>& alg) -> bool { 106 switch (length) { 107 case CryptoKeyAES::s_length128: 108 return !alg || alg.value() == "A128CBC"; 109 case CryptoKeyAES::s_length192: 110 return !alg || alg.value() == "A192CBC"; 111 case CryptoKeyAES::s_length256: 112 return !alg || alg.value() == "A256CBC"; 113 } 114 return false; 115 }; 116 result = CryptoKeyAES::importJwk(parameters->identifier, WTFMove(WTF::get<JsonWebKey>(data)), extractable, usages, WTFMove(checkAlgCallback)); 117 break; 118 } 119 default: 120 exceptionCallback(NOT_SUPPORTED_ERR); 121 return; 122 } 123 if (!result) { 124 exceptionCallback(DataError); 125 return; 126 } 127 128 callback(*result); 85 129 } 86 130 -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.h
r207809 r208548 46 46 47 47 void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext*) final; 48 void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyCallback&&, ExceptionCallback&&) final; 48 49 49 50 // The following will be deprecated. -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp
r207809 r208548 39 39 const char* const CryptoAlgorithmAES_KW::s_name = "AES-KW"; 40 40 41 static inline bool usagesAreInvalidForCryptoAlgorithmAES_KW(CryptoKeyUsage usages) 42 { 43 return usages & (CryptoKeyUsageSign | CryptoKeyUsageVerify | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits | CryptoKeyUsageEncrypt | CryptoKeyUsageDecrypt); 44 } 45 41 46 CryptoAlgorithmAES_KW::CryptoAlgorithmAES_KW() 42 47 { … … 70 75 const auto& aesParameters = downcast<CryptoAlgorithmAesKeyGenParams>(*parameters); 71 76 72 if (usages & (CryptoKeyUsageSign | CryptoKeyUsageVerify | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits | CryptoKeyUsageEncrypt | CryptoKeyUsageDecrypt)) {77 if (usagesAreInvalidForCryptoAlgorithmAES_KW(usages)) { 73 78 exceptionCallback(SYNTAX_ERR); 74 79 return; … … 82 87 83 88 callback(result.get(), nullptr); 89 } 90 91 void CryptoAlgorithmAES_KW::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsage usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) 92 { 93 if (usagesAreInvalidForCryptoAlgorithmAES_KW(usages)) { 94 exceptionCallback(SYNTAX_ERR); 95 return; 96 } 97 98 RefPtr<CryptoKeyAES> result; 99 switch (format) { 100 case SubtleCrypto::KeyFormat::Raw: 101 result = CryptoKeyAES::importRaw(parameters->identifier, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages); 102 break; 103 case SubtleCrypto::KeyFormat::Jwk: { 104 auto checkAlgCallback = [](size_t length, const Optional<String>& alg) -> bool { 105 switch (length) { 106 case CryptoKeyAES::s_length128: 107 return !alg || alg.value() == "A128KW"; 108 case CryptoKeyAES::s_length192: 109 return !alg || alg.value() == "A192KW"; 110 case CryptoKeyAES::s_length256: 111 return !alg || alg.value() == "A256KW"; 112 } 113 return false; 114 }; 115 result = CryptoKeyAES::importJwk(parameters->identifier, WTFMove(WTF::get<JsonWebKey>(data)), extractable, usages, WTFMove(checkAlgCallback)); 116 break; 117 } 118 default: 119 exceptionCallback(NOT_SUPPORTED_ERR); 120 return; 121 } 122 if (!result) { 123 exceptionCallback(DataError); 124 return; 125 } 126 127 callback(*result); 84 128 } 85 129 -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.h
r207809 r208548 45 45 46 46 void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext*) final; 47 void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyCallback&&, ExceptionCallback&&) final; 47 48 48 49 // The following will be deprecated. -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp
r207809 r208548 29 29 #if ENABLE(SUBTLE_CRYPTO) 30 30 31 #include "CryptoAlgorithmHmacKey GenParams.h"31 #include "CryptoAlgorithmHmacKeyParams.h" 32 32 #include "CryptoAlgorithmHmacKeyParamsDeprecated.h" 33 33 #include "CryptoAlgorithmHmacParamsDeprecated.h" … … 39 39 40 40 const char* const CryptoAlgorithmHMAC::s_name = "HMAC"; 41 42 static inline bool usagesAreInvalidForCryptoAlgorithmHMAC(CryptoKeyUsage usages) 43 { 44 return usages & (CryptoKeyUsageEncrypt | CryptoKeyUsageDecrypt | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits | CryptoKeyUsageWrapKey | CryptoKeyUsageUnwrapKey); 45 } 41 46 42 47 CryptoAlgorithmHMAC::CryptoAlgorithmHMAC() … … 71 76 void CryptoAlgorithmHMAC::generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsage usages, KeyOrKeyPairCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext*) 72 77 { 73 const auto& hmacParameters = downcast<CryptoAlgorithmHmacKey GenParams>(*parameters);78 const auto& hmacParameters = downcast<CryptoAlgorithmHmacKeyParams>(*parameters); 74 79 75 if (usages & (CryptoKeyUsageEncrypt | CryptoKeyUsageDecrypt | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits | CryptoKeyUsageWrapKey | CryptoKeyUsageUnwrapKey)) {80 if (usagesAreInvalidForCryptoAlgorithmHMAC(usages)) { 76 81 exceptionCallback(SYNTAX_ERR); 77 82 return; … … 90 95 91 96 callback(result.get(), nullptr); 97 } 98 99 void CryptoAlgorithmHMAC::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsage usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) 100 { 101 const auto& hmacParameters = downcast<CryptoAlgorithmHmacKeyParams>(*parameters); 102 103 if (usagesAreInvalidForCryptoAlgorithmHMAC(usages)) { 104 exceptionCallback(SYNTAX_ERR); 105 return; 106 } 107 108 RefPtr<CryptoKeyHMAC> result; 109 switch (format) { 110 case SubtleCrypto::KeyFormat::Raw: 111 result = CryptoKeyHMAC::importRaw(hmacParameters.length.valueOr(0), hmacParameters.hashIdentifier, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages); 112 break; 113 case SubtleCrypto::KeyFormat::Jwk: { 114 auto checkAlgCallback = [](CryptoAlgorithmIdentifier hash, const Optional<String>& alg) -> bool { 115 switch (hash) { 116 case CryptoAlgorithmIdentifier::SHA_1: 117 return !alg || alg.value() == "HS1"; 118 case CryptoAlgorithmIdentifier::SHA_224: 119 return !alg || alg.value() == "HS224"; 120 case CryptoAlgorithmIdentifier::SHA_256: 121 return !alg || alg.value() == "HS256"; 122 case CryptoAlgorithmIdentifier::SHA_384: 123 return !alg || alg.value() == "HS384"; 124 case CryptoAlgorithmIdentifier::SHA_512: 125 return !alg || alg.value() == "HS512"; 126 default: 127 return false; 128 } 129 return false; 130 }; 131 result = CryptoKeyHMAC::importJwk(hmacParameters.length.valueOr(0), hmacParameters.hashIdentifier, WTFMove(WTF::get<JsonWebKey>(data)), extractable, usages, WTFMove(checkAlgCallback)); 132 break; 133 } 134 default: 135 exceptionCallback(NOT_SUPPORTED_ERR); 136 return; 137 } 138 if (!result) { 139 exceptionCallback(DataError); 140 return; 141 } 142 143 callback(*result); 92 144 } 93 145 -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.h
r207809 r208548 46 46 47 47 void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext*) final; 48 void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyCallback&&, ExceptionCallback&&) final; 48 49 49 50 // The following will be deprecated. -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
r207809 r208548 89 89 } 90 90 91 void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsage usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) 92 { 93 RefPtr<CryptoKeyRSA> result; 94 switch (format) { 95 case SubtleCrypto::KeyFormat::Jwk: { 96 JsonWebKey key = WTFMove(WTF::get<JsonWebKey>(data)); 97 if ((key.d && (usages ^ CryptoKeyUsageDecrypt)) || (!key.d && (usages ^ CryptoKeyUsageEncrypt))) { 98 exceptionCallback(SYNTAX_ERR); 99 return; 100 } 101 if (usages && key.use && key.use.value() != "enc") { 102 exceptionCallback(DataError); 103 return; 104 } 105 if (key.alg && key.alg.value() != "RSA1_5") { 106 exceptionCallback(DataError); 107 return; 108 } 109 result = CryptoKeyRSA::importJwk(parameters->identifier, Nullopt, WTFMove(key), extractable, usages); 110 break; 111 } 112 default: 113 exceptionCallback(NOT_SUPPORTED_ERR); 114 return; 115 } 116 if (!result) { 117 exceptionCallback(DataError); 118 return; 119 } 120 121 callback(*result); 122 } 123 91 124 void CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt(const CryptoAlgorithmParametersDeprecated&, const CryptoKey& key, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback, ExceptionCode& ec) 92 125 { -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h
r207809 r208548 46 46 47 47 void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext*) final; 48 void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyCallback&&, ExceptionCallback&&) final; 48 49 49 50 // The following will be deprecated. -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
r207809 r208548 29 29 #if ENABLE(SUBTLE_CRYPTO) 30 30 31 #include "CryptoAlgorithmRsaHashedImportParams.h" 31 32 #include "CryptoAlgorithmRsaHashedKeyGenParams.h" 32 33 #include "CryptoAlgorithmRsaKeyGenParamsDeprecated.h" … … 92 93 } 93 94 95 void CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsage usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) 96 { 97 const auto& rsaParameters = downcast<CryptoAlgorithmRsaHashedImportParams>(*parameters); 98 99 RefPtr<CryptoKeyRSA> result; 100 switch (format) { 101 case SubtleCrypto::KeyFormat::Jwk: { 102 JsonWebKey key = WTFMove(WTF::get<JsonWebKey>(data)); 103 104 if ((key.d && (usages ^ CryptoKeyUsageSign)) || (!key.d && (usages ^ CryptoKeyUsageVerify))) { 105 exceptionCallback(SYNTAX_ERR); 106 return; 107 } 108 if (usages && key.use && key.use.value() != "sig") { 109 exceptionCallback(DataError); 110 return; 111 } 112 113 bool isMatched = false; 114 switch (rsaParameters.hashIdentifier) { 115 case CryptoAlgorithmIdentifier::SHA_1: 116 isMatched = !key.alg || key.alg.value() == "RS1"; 117 break; 118 case CryptoAlgorithmIdentifier::SHA_224: 119 isMatched = !key.alg || key.alg.value() == "RS224"; 120 break; 121 case CryptoAlgorithmIdentifier::SHA_256: 122 isMatched = !key.alg || key.alg.value() == "RS256"; 123 break; 124 case CryptoAlgorithmIdentifier::SHA_384: 125 isMatched = !key.alg || key.alg.value() == "RS384"; 126 break; 127 case CryptoAlgorithmIdentifier::SHA_512: 128 isMatched = !key.alg || key.alg.value() == "RS512"; 129 break; 130 default: 131 break; 132 } 133 if (!isMatched) { 134 exceptionCallback(DataError); 135 return; 136 } 137 138 result = CryptoKeyRSA::importJwk(rsaParameters.identifier, rsaParameters.hashIdentifier, WTFMove(key), extractable, usages); 139 break; 140 } 141 default: 142 exceptionCallback(NOT_SUPPORTED_ERR); 143 return; 144 } 145 if (!result) { 146 exceptionCallback(DataError); 147 return; 148 } 149 150 callback(*result); 151 } 152 94 153 void CryptoAlgorithmRSASSA_PKCS1_v1_5::sign(const CryptoAlgorithmParametersDeprecated& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback, ExceptionCode& ec) 95 154 { -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h
r207809 r208548 46 46 47 47 void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext*) final; 48 void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyCallback&&, ExceptionCallback&&) final; 48 49 49 50 // The following will be deprecated. -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
r207809 r208548 29 29 #if ENABLE(SUBTLE_CRYPTO) 30 30 31 #include "CryptoAlgorithmRsaHashedImportParams.h" 31 32 #include "CryptoAlgorithmRsaHashedKeyGenParams.h" 32 33 #include "CryptoAlgorithmRsaKeyGenParamsDeprecated.h" … … 92 93 } 93 94 95 void CryptoAlgorithmRSA_OAEP::importKey(SubtleCrypto::KeyFormat format, KeyData&& data, const std::unique_ptr<CryptoAlgorithmParameters>&& parameters, bool extractable, CryptoKeyUsage usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) 96 { 97 const auto& rsaParameters = downcast<CryptoAlgorithmRsaHashedImportParams>(*parameters); 98 99 RefPtr<CryptoKeyRSA> result; 100 switch (format) { 101 case SubtleCrypto::KeyFormat::Jwk: { 102 JsonWebKey key = WTFMove(WTF::get<JsonWebKey>(data)); 103 104 bool isUsagesAllowed = false; 105 if (key.d) { 106 isUsagesAllowed = isUsagesAllowed || !(usages ^ CryptoKeyUsageDecrypt); 107 isUsagesAllowed = isUsagesAllowed || !(usages ^ CryptoKeyUsageUnwrapKey); 108 isUsagesAllowed = isUsagesAllowed || !(usages ^ (CryptoKeyUsageDecrypt | CryptoKeyUsageUnwrapKey)); 109 } else { 110 isUsagesAllowed = isUsagesAllowed || !(usages ^ CryptoKeyUsageEncrypt); 111 isUsagesAllowed = isUsagesAllowed || !(usages ^ CryptoKeyUsageWrapKey); 112 isUsagesAllowed = isUsagesAllowed || !(usages ^ (CryptoKeyUsageEncrypt | CryptoKeyUsageWrapKey)); 113 } 114 if (!isUsagesAllowed) { 115 exceptionCallback(SYNTAX_ERR); 116 return; 117 } 118 119 if (usages && key.use && key.use.value() != "enc") { 120 exceptionCallback(DataError); 121 return; 122 } 123 124 bool isMatched = false; 125 switch (rsaParameters.hashIdentifier) { 126 case CryptoAlgorithmIdentifier::SHA_1: 127 isMatched = !key.alg || key.alg.value() == "RSA-OAEP"; 128 break; 129 case CryptoAlgorithmIdentifier::SHA_224: 130 isMatched = !key.alg || key.alg.value() == "RSA-OAEP-224"; 131 break; 132 case CryptoAlgorithmIdentifier::SHA_256: 133 isMatched = !key.alg || key.alg.value() == "RSA-OAEP-256"; 134 break; 135 case CryptoAlgorithmIdentifier::SHA_384: 136 isMatched = !key.alg || key.alg.value() == "RSA-OAEP-384"; 137 break; 138 case CryptoAlgorithmIdentifier::SHA_512: 139 isMatched = !key.alg || key.alg.value() == "RSA-OAEP-512"; 140 break; 141 default: 142 break; 143 } 144 if (!isMatched) { 145 exceptionCallback(DataError); 146 return; 147 } 148 149 result = CryptoKeyRSA::importJwk(rsaParameters.identifier, rsaParameters.hashIdentifier, WTFMove(key), extractable, usages); 150 break; 151 } 152 default: 153 exceptionCallback(NOT_SUPPORTED_ERR); 154 return; 155 } 156 if (!result) { 157 exceptionCallback(DataError); 158 return; 159 } 160 161 callback(*result); 162 } 163 94 164 void CryptoAlgorithmRSA_OAEP::encrypt(const CryptoAlgorithmParametersDeprecated& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback, ExceptionCode& ec) 95 165 { -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.h
r207809 r208548 46 46 47 47 void generateKey(const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&&, ExceptionCallback&&, ScriptExecutionContext*) final; 48 void importKey(SubtleCrypto::KeyFormat, KeyData&&, const std::unique_ptr<CryptoAlgorithmParameters>&&, bool extractable, CryptoKeyUsage, KeyCallback&&, ExceptionCallback&&) final; 48 49 49 50 // The following will be deprecated. -
trunk/Source/WebCore/crypto/keys/CryptoKeyAES.cpp
r207809 r208548 31 31 #include "CryptoAlgorithmRegistry.h" 32 32 #include "CryptoKeyDataOctetSequence.h" 33 #include "JsonWebKey.h" 34 #include <wtf/text/Base64.h> 33 35 #include <wtf/text/WTFString.h> 34 36 35 37 namespace WebCore { 36 38 39 static inline bool lengthIsValid(size_t length) 40 { 41 return (length == CryptoKeyAES::s_length128) || (length == CryptoKeyAES::s_length192) || (length == CryptoKeyAES::s_length256); 42 } 43 37 44 CryptoKeyAES::CryptoKeyAES(CryptoAlgorithmIdentifier algorithm, const Vector<uint8_t>& key, bool extractable, CryptoKeyUsage usage) 38 45 : CryptoKey(algorithm, CryptoKeyType::Secret, extractable, usage) 39 46 , m_key(key) 47 { 48 ASSERT(isValidAESAlgorithm(algorithm)); 49 } 50 51 CryptoKeyAES::CryptoKeyAES(CryptoAlgorithmIdentifier algorithm, Vector<uint8_t>&& key, bool extractable, CryptoKeyUsage usage) 52 : CryptoKey(algorithm, CryptoKeyType::Secret, extractable, usage) 53 , m_key(WTFMove(key)) 40 54 { 41 55 ASSERT(isValidAESAlgorithm(algorithm)); … … 58 72 RefPtr<CryptoKeyAES> CryptoKeyAES::generate(CryptoAlgorithmIdentifier algorithm, size_t lengthBits, bool extractable, CryptoKeyUsage usages) 59 73 { 60 if ( (lengthBits != 128) && (lengthBits != 192) && (lengthBits != 256))74 if (!lengthIsValid(lengthBits)) 61 75 return nullptr; 62 76 return adoptRef(new CryptoKeyAES(algorithm, randomData(lengthBits / 8), extractable, usages)); 77 } 78 79 RefPtr<CryptoKeyAES> CryptoKeyAES::importRaw(CryptoAlgorithmIdentifier algorithm, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsage usages) 80 { 81 if (!lengthIsValid(keyData.size() * 8)) 82 return nullptr; 83 return adoptRef(new CryptoKeyAES(algorithm, WTFMove(keyData), extractable, usages)); 84 } 85 86 RefPtr<CryptoKeyAES> CryptoKeyAES::importJwk(CryptoAlgorithmIdentifier algorithm, JsonWebKey&& keyData, bool extractable, CryptoKeyUsage usages, CheckAlgCallback&& callback) 87 { 88 if (keyData.kty != "oct") 89 return nullptr; 90 if (!keyData.k) 91 return nullptr; 92 Vector<uint8_t> octetSequence; 93 if (!base64URLDecode(keyData.k.value(), octetSequence)) 94 return nullptr; 95 if (!callback(octetSequence.size() * 8, keyData.alg)) 96 return nullptr; 97 if (usages && keyData.use && keyData.use.value() != "enc") 98 return nullptr; 99 if (keyData.usages && ((keyData.usages & usages) != usages)) 100 return nullptr; 101 if (keyData.ext && !keyData.ext.value() && extractable) 102 return nullptr; 103 104 return adoptRef(new CryptoKeyAES(algorithm, WTFMove(octetSequence), extractable, usages)); 63 105 } 64 106 -
trunk/Source/WebCore/crypto/keys/CryptoKeyAES.h
r205941 r208548 29 29 #include "CryptoAlgorithmIdentifier.h" 30 30 #include "CryptoKey.h" 31 #include <wtf/Function.h> 31 32 #include <wtf/Vector.h> 32 33 … … 34 35 35 36 namespace WebCore { 37 38 struct JsonWebKey; 36 39 37 40 class AesKeyAlgorithm final : public KeyAlgorithm { … … 53 56 class CryptoKeyAES final : public CryptoKey { 54 57 public: 58 static const int s_length128 = 128; 59 static const int s_length192 = 192; 60 static const int s_length256 = 256; 61 55 62 static Ref<CryptoKeyAES> create(CryptoAlgorithmIdentifier algorithm, const Vector<uint8_t>& key, bool extractable, CryptoKeyUsage usage) 56 63 { … … 62 69 63 70 static RefPtr<CryptoKeyAES> generate(CryptoAlgorithmIdentifier, size_t lengthBits, bool extractable, CryptoKeyUsage); 71 static RefPtr<CryptoKeyAES> importRaw(CryptoAlgorithmIdentifier, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsage); 72 using CheckAlgCallback = WTF::Function<bool(size_t, const Optional<String>&)>; 73 static RefPtr<CryptoKeyAES> importJwk(CryptoAlgorithmIdentifier, JsonWebKey&&, bool extractable, CryptoKeyUsage, CheckAlgCallback&&); 64 74 65 75 CryptoKeyClass keyClass() const final { return CryptoKeyClass::AES; } … … 69 79 private: 70 80 CryptoKeyAES(CryptoAlgorithmIdentifier, const Vector<uint8_t>& key, bool extractable, CryptoKeyUsage); 81 CryptoKeyAES(CryptoAlgorithmIdentifier, Vector<uint8_t>&& key, bool extractable, CryptoKeyUsage); 71 82 72 83 std::unique_ptr<KeyAlgorithm> buildAlgorithm() const final; -
trunk/Source/WebCore/crypto/keys/CryptoKeyDataRSAComponents.cpp
r159390 r208548 39 39 } 40 40 41 CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents(Vector<uint8_t>&& modulus, Vector<uint8_t>&& exponent) 42 : CryptoKeyData(CryptoKeyData::Format::RSAComponents) 43 , m_type(Type::Public) 44 , m_modulus(WTFMove(modulus)) 45 , m_exponent(WTFMove(exponent)) 46 { 47 } 48 41 49 CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents(const Vector<uint8_t>& modulus, const Vector<uint8_t>& exponent, const Vector<uint8_t>& privateExponent) 42 50 : CryptoKeyData(CryptoKeyData::Format::RSAComponents) … … 45 53 , m_exponent(exponent) 46 54 , m_privateExponent(privateExponent) 55 , m_hasAdditionalPrivateKeyParameters(false) 56 { 57 } 58 59 CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents(Vector<uint8_t>&& modulus, Vector<uint8_t>&& exponent, Vector<uint8_t>&& privateExponent) 60 : CryptoKeyData(CryptoKeyData::Format::RSAComponents) 61 , m_type(Type::Private) 62 , m_modulus(WTFMove(modulus)) 63 , m_exponent(WTFMove(exponent)) 64 , m_privateExponent(WTFMove(privateExponent)) 47 65 , m_hasAdditionalPrivateKeyParameters(false) 48 66 { … … 62 80 } 63 81 82 CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents(Vector<uint8_t>&& modulus, Vector<uint8_t>&& exponent, Vector<uint8_t>&& privateExponent, PrimeInfo&& firstPrimeInfo, PrimeInfo&& secondPrimeInfo, Vector<PrimeInfo>&& otherPrimeInfos) 83 : CryptoKeyData(CryptoKeyData::Format::RSAComponents) 84 , m_type(Type::Private) 85 , m_modulus(WTFMove(modulus)) 86 , m_exponent(WTFMove(exponent)) 87 , m_privateExponent(WTFMove(privateExponent)) 88 , m_hasAdditionalPrivateKeyParameters(true) 89 , m_firstPrimeInfo(WTFMove(firstPrimeInfo)) 90 , m_secondPrimeInfo(WTFMove(secondPrimeInfo)) 91 , m_otherPrimeInfos(WTFMove(otherPrimeInfos)) 92 { 93 } 94 64 95 CryptoKeyDataRSAComponents::~CryptoKeyDataRSAComponents() 65 96 { -
trunk/Source/WebCore/crypto/keys/CryptoKeyDataRSAComponents.h
r174337 r208548 51 51 return std::unique_ptr<CryptoKeyDataRSAComponents>(new CryptoKeyDataRSAComponents(modulus, exponent)); 52 52 } 53 static std::unique_ptr<CryptoKeyDataRSAComponents> createPublic(Vector<uint8_t>&& modulus, Vector<uint8_t>&& exponent) 54 { 55 return std::unique_ptr<CryptoKeyDataRSAComponents>(new CryptoKeyDataRSAComponents(WTFMove(modulus), WTFMove(exponent))); 56 } 53 57 54 58 static std::unique_ptr<CryptoKeyDataRSAComponents> createPrivate(const Vector<uint8_t>& modulus, const Vector<uint8_t>& exponent, const Vector<uint8_t>& privateExponent) … … 56 60 return std::unique_ptr<CryptoKeyDataRSAComponents>(new CryptoKeyDataRSAComponents(modulus, exponent, privateExponent)); 57 61 } 62 static std::unique_ptr<CryptoKeyDataRSAComponents> createPrivate(Vector<uint8_t>&& modulus, Vector<uint8_t>&& exponent, Vector<uint8_t>&& privateExponent) 63 { 64 return std::unique_ptr<CryptoKeyDataRSAComponents>(new CryptoKeyDataRSAComponents(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent))); 65 } 58 66 59 67 static std::unique_ptr<CryptoKeyDataRSAComponents> createPrivateWithAdditionalData(const Vector<uint8_t>& modulus, const Vector<uint8_t>& exponent, const Vector<uint8_t>& privateExponent, const PrimeInfo& firstPrimeInfo, const PrimeInfo& secondPrimeInfo, const Vector<PrimeInfo>& otherPrimeInfos) 60 68 { 61 69 return std::unique_ptr<CryptoKeyDataRSAComponents>(new CryptoKeyDataRSAComponents(modulus, exponent, privateExponent, firstPrimeInfo, secondPrimeInfo, otherPrimeInfos)); 70 } 71 static std::unique_ptr<CryptoKeyDataRSAComponents> createPrivateWithAdditionalData(Vector<uint8_t>&& modulus, Vector<uint8_t>&& exponent, Vector<uint8_t>&& privateExponent, PrimeInfo&& firstPrimeInfo, PrimeInfo&& secondPrimeInfo, Vector<PrimeInfo>&& otherPrimeInfos) 72 { 73 return std::unique_ptr<CryptoKeyDataRSAComponents>(new CryptoKeyDataRSAComponents(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent), WTFMove(firstPrimeInfo), WTFMove(secondPrimeInfo), WTFMove(otherPrimeInfos))); 62 74 } 63 75 … … 79 91 private: 80 92 CryptoKeyDataRSAComponents(const Vector<uint8_t>& modulus, const Vector<uint8_t>& exponent); 93 CryptoKeyDataRSAComponents(Vector<uint8_t>&& modulus, Vector<uint8_t>&& exponent); 94 81 95 CryptoKeyDataRSAComponents(const Vector<uint8_t>& modulus, const Vector<uint8_t>& exponent, const Vector<uint8_t>& privateExponent); 96 CryptoKeyDataRSAComponents(Vector<uint8_t>&& modulus, Vector<uint8_t>&& exponent, Vector<uint8_t>&& privateExponent); 97 82 98 CryptoKeyDataRSAComponents(const Vector<uint8_t>& modulus, const Vector<uint8_t>& exponent, const Vector<uint8_t>& privateExponent, const PrimeInfo& firstPrimeInfo, const PrimeInfo& secondPrimeInfo, const Vector<PrimeInfo>& otherPrimeInfos); 99 CryptoKeyDataRSAComponents(Vector<uint8_t>&& modulus, Vector<uint8_t>&& exponent, Vector<uint8_t>&& privateExponent, PrimeInfo&& firstPrimeInfo, PrimeInfo&& secondPrimeInfo, Vector<PrimeInfo>&& otherPrimeInfos); 83 100 84 101 Type m_type; -
trunk/Source/WebCore/crypto/keys/CryptoKeyHMAC.cpp
r207809 r208548 29 29 #if ENABLE(SUBTLE_CRYPTO) 30 30 31 #include "CryptoAlgorithmHmacKeyParams.h" 31 32 #include "CryptoAlgorithmRegistry.h" 32 33 #include "CryptoKeyDataOctetSequence.h" 34 #include "JsonWebKey.h" 35 #include <wtf/text/Base64.h> 33 36 #include <wtf/text/WTFString.h> 34 37 … … 39 42 , m_hash(hash) 40 43 , m_key(key) 44 { 45 } 46 47 CryptoKeyHMAC::CryptoKeyHMAC(Vector<uint8_t>&& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsage usage) 48 : CryptoKey(CryptoAlgorithmIdentifier::HMAC, CryptoKeyType::Secret, extractable, usage) 49 , m_hash(hash) 50 , m_key(WTFMove(key)) 41 51 { 42 52 } … … 63 73 } 64 74 } 75 // CommonHMAC only supports key length that is a multiple of 8. Therefore, here we are a little bit different 76 // from the spec as of 11 December 2014: https://www.w3.org/TR/WebCryptoAPI/#hmac-operations 77 if (lengthBits % 8) 78 return nullptr; 65 79 66 return adoptRef(new CryptoKeyHMAC(randomData(lengthBits), hash, extractable, usages)); 80 return adoptRef(new CryptoKeyHMAC(randomData(lengthBits / 8), hash, extractable, usages)); 81 } 82 83 RefPtr<CryptoKeyHMAC> CryptoKeyHMAC::importRaw(size_t lengthBits, CryptoAlgorithmIdentifier hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsage usages) 84 { 85 size_t length = keyData.size() * 8; 86 if (!length) 87 return nullptr; 88 // CommonHMAC only supports key length that is a multiple of 8. Therefore, here we are a little bit different 89 // from the spec as of 11 December 2014: https://www.w3.org/TR/WebCryptoAPI/#hmac-operations 90 if (lengthBits && lengthBits != length) 91 return nullptr; 92 93 return adoptRef(new CryptoKeyHMAC(WTFMove(keyData), hash, extractable, usages)); 94 } 95 96 RefPtr<CryptoKeyHMAC> CryptoKeyHMAC::importJwk(size_t lengthBits, CryptoAlgorithmIdentifier hash, JsonWebKey&& keyData, bool extractable, CryptoKeyUsage usages, CheckAlgCallback&& callback) 97 { 98 if (keyData.kty != "oct") 99 return nullptr; 100 if (!keyData.k) 101 return nullptr; 102 Vector<uint8_t> octetSequence; 103 if (!base64URLDecode(keyData.k.value(), octetSequence)) 104 return nullptr; 105 if (!callback(hash, keyData.alg)) 106 return nullptr; 107 if (usages && keyData.use && keyData.use.value() != "sig") 108 return nullptr; 109 if (keyData.usages && ((keyData.usages & usages) != usages)) 110 return nullptr; 111 if (keyData.ext && !keyData.ext.value() && extractable) 112 return nullptr; 113 114 return CryptoKeyHMAC::importRaw(lengthBits, hash, WTFMove(octetSequence), extractable, usages); 67 115 } 68 116 … … 70 118 { 71 119 return std::make_unique<HmacKeyAlgorithm>(CryptoAlgorithmRegistry::singleton().nameForIdentifier(algorithmIdentifier()), 72 CryptoAlgorithmRegistry::singleton().nameForIdentifier(m_hash), m_key.size() );120 CryptoAlgorithmRegistry::singleton().nameForIdentifier(m_hash), m_key.size() * 8); 73 121 } 74 122 -
trunk/Source/WebCore/crypto/keys/CryptoKeyHMAC.h
r205941 r208548 28 28 29 29 #include "CryptoKey.h" 30 #include <wtf/Function.h> 30 31 #include <wtf/Vector.h> 31 32 … … 33 34 34 35 namespace WebCore { 36 37 struct JsonWebKey; 35 38 36 39 class HmacKeyAlgorithm final : public KeyAlgorithm { … … 61 64 virtual ~CryptoKeyHMAC(); 62 65 63 // If lengthBytes is 0, a recommended length is used, which is the size of the associated hash function's block size. 64 static RefPtr<CryptoKeyHMAC> generate(size_t lengthBytes, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsage); 66 static RefPtr<CryptoKeyHMAC> generate(size_t lengthBits, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsage); 67 static RefPtr<CryptoKeyHMAC> importRaw(size_t lengthBits, CryptoAlgorithmIdentifier hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsage); 68 using CheckAlgCallback = WTF::Function<bool(CryptoAlgorithmIdentifier, const Optional<String>&)>; 69 static RefPtr<CryptoKeyHMAC> importJwk(size_t lengthBits, CryptoAlgorithmIdentifier hash, JsonWebKey&&, bool extractable, CryptoKeyUsage, CheckAlgCallback&&); 65 70 66 71 CryptoKeyClass keyClass() const final { return CryptoKeyClass::HMAC; } … … 72 77 private: 73 78 CryptoKeyHMAC(const Vector<uint8_t>& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsage); 79 CryptoKeyHMAC(Vector<uint8_t>&& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsage); 74 80 75 81 std::unique_ptr<KeyAlgorithm> buildAlgorithm() const final; -
trunk/Source/WebCore/crypto/keys/CryptoKeyRSA.h
r207809 r208548 48 48 class PromiseWrapper; 49 49 class ScriptExecutionContext; 50 51 struct JsonWebKey; 50 52 51 53 class RsaKeyAlgorithm : public KeyAlgorithm { … … 100 102 using VoidCallback = WTF::Function<void()>; 101 103 static void generatePair(CryptoAlgorithmIdentifier, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsage, KeyPairCallback, VoidCallback failureCallback, ScriptExecutionContext*); 104 static RefPtr<CryptoKeyRSA> importJwk(CryptoAlgorithmIdentifier, Optional<CryptoAlgorithmIdentifier> hash, JsonWebKey&&, bool extractable, CryptoKeyUsage); 102 105 103 106 PlatformRSAKey platformKey() const { return m_platformKey; } -
trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h
r208547 r208548 33 33 namespace WebCore { 34 34 35 class CryptoAlgorithmHmacKey GenParams final : public CryptoAlgorithmParameters {35 class CryptoAlgorithmHmacKeyParams final : public CryptoAlgorithmParameters { 36 36 public: 37 37 // FIXME: Consider merging hash and hashIdentifier. … … 40 40 Optional<unsigned long> length; 41 41 42 Class parametersClass() const final { return Class::HmacKey GenParams; }42 Class parametersClass() const final { return Class::HmacKeyParams; } 43 43 }; 44 44 45 45 } // namespace WebCore 46 46 47 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(HmacKey GenParams)47 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(HmacKeyParams) 48 48 49 49 #endif // ENABLE(SUBTLE_CRYPTO) -
trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h
r208547 r208548 33 33 namespace WebCore { 34 34 35 class CryptoAlgorithm HmacKeyGenParams final : public CryptoAlgorithmParameters {35 class CryptoAlgorithmRsaHashedImportParams final : public CryptoAlgorithmParameters { 36 36 public: 37 37 // FIXME: Consider merging hash and hashIdentifier. 38 38 JSC::JSValue hash; 39 39 CryptoAlgorithmIdentifier hashIdentifier; 40 Optional<unsigned long> length;41 40 42 Class parametersClass() const final { return Class:: HmacKeyGenParams; }41 Class parametersClass() const final { return Class::RsaHashedImportParams; } 43 42 }; 44 43 45 44 } // namespace WebCore 46 45 47 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS( HmacKeyGenParams)46 SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaHashedImportParams) 48 47 49 48 #endif // ENABLE(SUBTLE_CRYPTO) -
trunk/Source/WebCore/crypto/parameters/HmacKeyParams.idl
r208547 r208548 24 24 */ 25 25 26 // This is a unified dictionary for HmacImportParams and HmacKeyGenParams. 27 // https://www.w3.org/TR/WebCryptoAPI/#hmac-importparams, and 28 // https://www.w3.org/TR/WebCryptoAPI/#hmac-keygen-params 26 29 [ 27 30 Conditional=SUBTLE_CRYPTO, 28 ImplementedAs=CryptoAlgorithmHmacKey GenParams29 ] dictionary HmacKey GenParams : CryptoAlgorithmParameters {31 ImplementedAs=CryptoAlgorithmHmacKeyParams 32 ] dictionary HmacKeyParams : CryptoAlgorithmParameters { 30 33 // The inner hash function to use. 31 34 required any hash; -
trunk/Source/WebCore/crypto/parameters/RsaHashedImportParams.idl
r208547 r208548 6 6 * are met: 7 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer.8 * notice, this list of conditions and the following disclaimer. 9 9 * 2. Redistributions in binary form must reproduce the above copyright 10 10 * notice, this list of conditions and the following disclaimer in the … … 26 26 [ 27 27 Conditional=SUBTLE_CRYPTO, 28 Exposed=(Window,Worker), 29 GenerateIsReachable=ImplScriptExecutionContext, 30 NoInterfaceObject, 31 ] interface SubtleCrypto { 32 // FIXME: Should this return a Promise<(CryptoKey or CryptoKeyPair)>? 33 [Custom] Promise<any> generateKey(AlgorithmIdentifier algorithm, boolean extractable, sequence<KeyUsage> keyUsages); 28 ImplementedAs=CryptoAlgorithmRsaHashedImportParams 29 ] dictionary RsaHashedImportParams : CryptoAlgorithmParameters { 30 // The hash algorithm to use 31 required any hash; 34 32 };
Note: See TracChangeset
for help on using the changeset viewer.