+2016-09-09 Jiewen Tan <jiewen_tan@apple.com>
+
+ Rename Key to CryptoKey
+ https://bugs.webkit.org/show_bug.cgi?id=161665
+ <rdar://problem/28083391>
+
+ Reviewed by Brent Fulgham.
+
+ * crypto/subtle/aes-cbc-unwrap-rsa-expected.txt:
+ * crypto/subtle/aes-cbc-unwrap-rsa.html:
+ * crypto/subtle/aes-kw-key-manipulation-expected.txt:
+ * crypto/subtle/aes-kw-key-manipulation.html:
+ * crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt:
+ * crypto/subtle/aes-kw-wrap-unwrap-aes.html:
+ * crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt:
+ * crypto/subtle/rsa-oaep-wrap-unwrap-aes.html:
+ * crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt:
+ * crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html:
+ * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt:
+ * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html:
+ * platform/mac/js/dom/global-constructors-attributes-expected.txt:
+ * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
+
2016-09-09 Youenn Fablet <youenn@apple.com>
TextTrackLoader should use FetchOptions::mode according its crossOrigin attribute
Importing an unwrapping key...
PASS unwrappingKey.algorithm.name is 'AES-CBC'
Unwrapping a key...
-PASS unwrappedKey.toString() is '[object Key]'
+PASS unwrappedKey.toString() is '[object CryptoKey]'
PASS unwrappedKey.type is 'public'
PASS unwrappedKey.usages is ['sign','verify']
PASS unwrappedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
}).then(function(result) {
unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object Key]'");
+ shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
shouldBe("unwrappedKey.type", "'public'");
shouldBe("unwrappedKey.usages", "['sign','verify']");
shouldBe("unwrappedKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
Generating a key...
-PASS key.toString() is '[object Key]'
+PASS key.toString() is '[object CryptoKey]'
PASS key.type is 'secret'
PASS key.algorithm.name is 'AES-KW'
PASS key.algorithm.length is 256
Exporting the key to raw...
PASS exportedKey.toString() is '[object ArrayBuffer]'
Importing it back...
-PASS importedKey.toString() is '[object Key]'
+PASS importedKey.toString() is '[object CryptoKey]'
PASS importedKey.type is 'secret'
PASS importedKey.algorithm.name is 'AES-KW'
PASS importedKey.algorithm.length is 256
debug("Generating a key...");
crypto.subtle.generateKey({name: "aes-kw", length: 256}, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(result) {
key = result;
- shouldBe("key.toString()", "'[object Key]'");
+ shouldBe("key.toString()", "'[object CryptoKey]'");
shouldBe("key.type", "'secret'");
shouldBe("key.algorithm.name", "'AES-KW'");
shouldBe("key.algorithm.length", "256");
}).then(function(result) {
importedKey = result;
- shouldBe("importedKey.toString()", "'[object Key]'");
+ shouldBe("importedKey.toString()", "'[object CryptoKey]'");
shouldBe("importedKey.type", "'secret'");
shouldBe("importedKey.algorithm.name", "'AES-KW'");
shouldBe("importedKey.algorithm.length", "256");
Wrapping it...
PASS bytesToHexString(wrappedKey) is '1fa68b0a8112b447aef34bd8fb5a7b829d3e862371d2cfe5'
Unwrapping it...
-PASS unwrappedKey.toString() is '[object Key]'
+PASS unwrappedKey.toString() is '[object CryptoKey]'
PASS unwrappedKey.type is 'secret'
PASS unwrappedKey.extractable is true
PASS unwrappedKey.algorithm.name is 'AES-CBC'
return crypto.subtle.unwrapKey("raw", wrappedKey, kek, "aes-kw", "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
}).then(function(result) {
unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object Key]'");
+ shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
shouldBe("unwrappedKey.type", "'secret'");
shouldBe("unwrappedKey.extractable", "true");
shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
Wrapping it...
PASS wrappedKey.toString() is '[object ArrayBuffer]'
Unwrapping it...
-PASS unwrappedKey.toString() is '[object Key]'
+PASS unwrappedKey.toString() is '[object CryptoKey]'
PASS unwrappedKey.type is 'secret'
PASS unwrappedKey.extractable is true
PASS unwrappedKey.algorithm.name is 'AES-CBC'
Wrapping the same key as JWK...
PASS wrappedKey.toString() is '[object ArrayBuffer]'
Unwrapping it...
-PASS unwrappedKey.toString() is '[object Key]'
+PASS unwrappedKey.toString() is '[object CryptoKey]'
PASS unwrappedKey.type is 'secret'
PASS unwrappedKey.extractable is true
PASS unwrappedKey.algorithm.name is 'AES-CBC'
return crypto.subtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
}).then(function(result) {
unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object Key]'");
+ shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
shouldBe("unwrappedKey.type", "'secret'");
shouldBe("unwrappedKey.extractable", "true");
shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
return crypto.subtle.unwrapKey("jwk", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
}).then(function(result) {
unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object Key]'");
+ shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
shouldBe("unwrappedKey.type", "'secret'");
shouldBe("unwrappedKey.extractable", "true");
shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
Wrapping it...
PASS wrappedKey.toString() is '[object ArrayBuffer]'
Unwrapping it...
-PASS unwrappedKey.toString() is '[object Key]'
+PASS unwrappedKey.toString() is '[object CryptoKey]'
PASS unwrappedKey.type is 'secret'
PASS unwrappedKey.extractable is true
PASS unwrappedKey.algorithm.name is 'AES-CBC'
Wrapping the same key as JWK...
PASS wrappedKey.toString() is '[object ArrayBuffer]'
Unwrapping it...
-PASS unwrappedKey.toString() is '[object Key]'
+PASS unwrappedKey.toString() is '[object CryptoKey]'
PASS unwrappedKey.type is 'secret'
PASS unwrappedKey.extractable is true
PASS unwrappedKey.algorithm.name is 'AES-CBC'
return crypto.subtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
}).then(function(result) {
unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object Key]'");
+ shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
shouldBe("unwrappedKey.type", "'secret'");
shouldBe("unwrappedKey.extractable", "true");
shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
return crypto.subtle.unwrapKey("jwk", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
}).then(function(result) {
unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object Key]'");
+ shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
shouldBe("unwrappedKey.type", "'secret'");
shouldBe("unwrappedKey.extractable", "true");
shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
Importing a public key...
-PASS publicKey.toString() is '[object Key]'
+PASS publicKey.toString() is '[object CryptoKey]'
PASS publicKey.type is 'public'
PASS publicKey.usages is ['sign','verify']
PASS publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
PASS publicKey.algorithm.hash.name is 'SHA-256'
Importing a private key...
-PASS privateKey.toString() is '[object Key]'
+PASS privateKey.toString() is '[object CryptoKey]'
PASS privateKey.type is 'private'
PASS privateKey.usages is ['sign','verify']
PASS privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
debug("Importing a public key...");
crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"]).then(function(result) {
publicKey = result;
- shouldBe("publicKey.toString()", "'[object Key]'");
+ shouldBe("publicKey.toString()", "'[object CryptoKey]'");
shouldBe("publicKey.type", "'public'");
shouldBe("publicKey.usages", "['sign','verify']");
shouldBe("publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
return crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"]);
}).then(function(result) {
privateKey = result;
- shouldBe("privateKey.toString()", "'[object Key]'");
+ shouldBe("privateKey.toString()", "'[object CryptoKey]'");
shouldBe("privateKey.type", "'private'");
shouldBe("privateKey.usages", "['sign','verify']");
shouldBe("privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+2016-09-09 Jiewen Tan <jiewen_tan@apple.com>
+
+ Rename Key to CryptoKey
+ https://bugs.webkit.org/show_bug.cgi?id=161665
+ <rdar://problem/28083391>
+
+ Reviewed by Brent Fulgham.
+
+ * WebCryptoAPI/idlharness-expected.txt:
+
2016-09-09 Youenn Fablet <youenn@apple.com>
TextTrackLoader should use FetchOptions::mode according its crossOrigin attribute
FAIL Crypto interface: crypto must inherit property "subtle" with the proper type (0) assert_inherits: property "subtle" not found in prototype chain
PASS Crypto interface: crypto must inherit property "getRandomValues" with the proper type (1)
PASS Crypto interface: calling getRandomValues(ArrayBufferView) on crypto with too few arguments must throw TypeError
-FAIL CryptoKey interface: existence and properties of interface object assert_own_property: self does not have own property "CryptoKey" expected property "CryptoKey" missing
-FAIL CryptoKey interface object length assert_own_property: self does not have own property "CryptoKey" expected property "CryptoKey" missing
-FAIL CryptoKey interface object name assert_own_property: self does not have own property "CryptoKey" expected property "CryptoKey" missing
-FAIL CryptoKey interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CryptoKey" expected property "CryptoKey" missing
-FAIL CryptoKey interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CryptoKey" expected property "CryptoKey" missing
-FAIL CryptoKey interface: attribute type assert_own_property: self does not have own property "CryptoKey" expected property "CryptoKey" missing
-FAIL CryptoKey interface: attribute extractable assert_own_property: self does not have own property "CryptoKey" expected property "CryptoKey" missing
-FAIL CryptoKey interface: attribute algorithm assert_own_property: self does not have own property "CryptoKey" expected property "CryptoKey" missing
-FAIL CryptoKey interface: attribute usages assert_own_property: self does not have own property "CryptoKey" expected property "CryptoKey" missing
+PASS CryptoKey interface: existence and properties of interface object
+PASS CryptoKey interface object length
+PASS CryptoKey interface object name
+PASS CryptoKey interface: existence and properties of interface prototype object
+PASS CryptoKey interface: existence and properties of interface prototype object's "constructor" property
+PASS CryptoKey interface: attribute type
+PASS CryptoKey interface: attribute extractable
+PASS CryptoKey interface: attribute algorithm
+PASS CryptoKey interface: attribute usages
FAIL SubtleCrypto interface: existence and properties of interface object assert_own_property: self does not have own property "SubtleCrypto" expected property "SubtleCrypto" missing
FAIL SubtleCrypto interface object length assert_own_property: self does not have own property "SubtleCrypto" expected property "SubtleCrypto" missing
FAIL SubtleCrypto interface object name assert_own_property: self does not have own property "SubtleCrypto" expected property "SubtleCrypto" missing
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'CryptoKey').value is CryptoKey
+PASS Object.getOwnPropertyDescriptor(global, 'CryptoKey').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CryptoKey').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CryptoKey').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'CryptoKey').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'CustomElementRegistry').value is CustomElementRegistry
PASS Object.getOwnPropertyDescriptor(global, 'CustomElementRegistry').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'CustomElementRegistry').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'CryptoKey').value is CryptoKey
+PASS Object.getOwnPropertyDescriptor(global, 'CryptoKey').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CryptoKey').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CryptoKey').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'CryptoKey').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'CustomElementRegistry').value is CustomElementRegistry
PASS Object.getOwnPropertyDescriptor(global, 'CustomElementRegistry').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'CustomElementRegistry').hasOwnProperty('set') is false
+2016-09-09 Jiewen Tan <jiewen_tan@apple.com>
+
+ Rename Key to CryptoKey
+ https://bugs.webkit.org/show_bug.cgi?id=161665
+ <rdar://problem/28083391>
+
+ Reviewed by Brent Fulgham.
+
+ A link to the spec: https://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface
+
+ * crypto/CryptoKey.idl:
+ Remove some unnecessary IDL attributes and reorder KeyType enum to match the spec.
+ * crypto/CryptoKeyType.h:
+
2016-09-09 Alex Christensen <achristensen@webkit.org>
URLParser: Handle \ in path according to spec
*/
enum KeyType {
- "secret",
"public",
- "private"
+ "private",
+ "secret"
};
enum KeyUsage {
[
Conditional=SUBTLE_CRYPTO,
GenerateIsReachable=Impl,
- InterfaceName=Key,
- NoInterfaceObject,
SkipVTableValidation
] interface CryptoKey {
readonly attribute KeyType type;
namespace WebCore {
enum class CryptoKeyType {
- Secret,
Public,
- Private
+ Private,
+ Secret
};
} // namespace WebCore