Title: [164546] trunk
Revision
164546
Author
[email protected]
Date
2014-02-22 10:10:37 -0800 (Sat, 22 Feb 2014)

Log Message

Rename JWK key_ops values from wrap/unwrap to wrapKey/unwrapKey
https://bugs.webkit.org/show_bug.cgi?id=129121

Reviewed by Sam Weinig.

Source/WebCore:

* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::JSCryptoKeySerializationJWK::reconcileUsages): Updated to newer names.
(WebCore::addUsagesToJSON): Ditto.
(WebCore::JSCryptoKeySerializationJWK::serialize): rsa-oaep-key-manipulation test
started ot fail, because RSA-OAEP with 2048 bit key and sha-1 can only encrypt
214 bytes, and the new longer names made JSON serialization slightly longer.
Compensate by not doing any indentation in JSON.

LayoutTests:

* crypto/subtle/aes-export-key-expected.txt:
* crypto/subtle/aes-export-key.html:
* crypto/subtle/jwk-export-use-values-expected.txt:
* crypto/subtle/jwk-export-use-values.html:
* crypto/subtle/jwk-import-use-values-expected.txt:
* crypto/subtle/jwk-import-use-values.html:
* crypto/subtle/rsa-oaep-key-manipulation-expected.txt:
* crypto/subtle/rsa-oaep-key-manipulation.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (164545 => 164546)


--- trunk/LayoutTests/ChangeLog	2014-02-22 17:50:55 UTC (rev 164545)
+++ trunk/LayoutTests/ChangeLog	2014-02-22 18:10:37 UTC (rev 164546)
@@ -1,3 +1,19 @@
+2014-02-22  Alexey Proskuryakov  <[email protected]>
+
+        Rename JWK key_ops values from wrap/unwrap to wrapKey/unwrapKey
+        https://bugs.webkit.org/show_bug.cgi?id=129121
+
+        Reviewed by Sam Weinig.
+
+        * crypto/subtle/aes-export-key-expected.txt:
+        * crypto/subtle/aes-export-key.html:
+        * crypto/subtle/jwk-export-use-values-expected.txt:
+        * crypto/subtle/jwk-export-use-values.html:
+        * crypto/subtle/jwk-import-use-values-expected.txt:
+        * crypto/subtle/jwk-import-use-values.html:
+        * crypto/subtle/rsa-oaep-key-manipulation-expected.txt:
+        * crypto/subtle/rsa-oaep-key-manipulation.html:
+
 2014-02-21  Timothy Hatcher  <[email protected]>
 
         Add inspection user interface for IndexedDB.

Modified: trunk/LayoutTests/crypto/subtle/aes-export-key-expected.txt (164545 => 164546)


--- trunk/LayoutTests/crypto/subtle/aes-export-key-expected.txt	2014-02-22 17:50:55 UTC (rev 164545)
+++ trunk/LayoutTests/crypto/subtle/aes-export-key-expected.txt	2014-02-22 18:10:37 UTC (rev 164546)
@@ -24,7 +24,7 @@
 PASS exportedJWK.alg is 'A192CBC'
 PASS exportedJWK.ext is true
 PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['encrypt', 'decrypt', 'wrap', 'unwrap']
+PASS exportedJWK.key_ops is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
 
 Importing a key that's not extractable...
 

Modified: trunk/LayoutTests/crypto/subtle/aes-export-key.html (164545 => 164546)


--- trunk/LayoutTests/crypto/subtle/aes-export-key.html	2014-02-22 17:50:55 UTC (rev 164545)
+++ trunk/LayoutTests/crypto/subtle/aes-export-key.html	2014-02-22 18:10:37 UTC (rev 164546)
@@ -54,7 +54,7 @@
     shouldBe("exportedJWK.alg", "'A192CBC'");
     shouldBe("exportedJWK.ext", "true");
     shouldBe("exportedJWK.use", "undefined");
-    shouldBe("exportedJWK.key_ops", "['encrypt', 'decrypt', 'wrap', 'unwrap']");
+    shouldBe("exportedJWK.key_ops", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
 
     debug("\nImporting a key that's not extractable...");
     return crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, "AES-CBC", nonExtractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'])

Modified: trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt (164545 => 164546)


--- trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt	2014-02-22 17:50:55 UTC (rev 164545)
+++ trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt	2014-02-22 18:10:37 UTC (rev 164546)
@@ -17,23 +17,23 @@
 
 wrapKey:
 PASS jwk.use is undefined
-PASS jwk.key_ops is ["wrap"]
+PASS jwk.key_ops is ["wrapKey"]
 
 unwrapKey:
 PASS jwk.use is undefined
-PASS jwk.key_ops is ["unwrap"]
+PASS jwk.key_ops is ["unwrapKey"]
 
 wrapKey,unwrapKey:
 PASS jwk.use is undefined
-PASS jwk.key_ops is ["wrap","unwrap"]
+PASS jwk.key_ops is ["wrapKey","unwrapKey"]
 
 encrypt,decrypt,wrapKey:
 PASS jwk.use is undefined
-PASS jwk.key_ops is ["encrypt","decrypt","wrap"]
+PASS jwk.key_ops is ["encrypt","decrypt","wrapKey"]
 
 encrypt,decrypt,wrapKey,unwrapKey:
 PASS jwk.use is undefined
-PASS jwk.key_ops is ["encrypt","decrypt","wrap","unwrap"]
+PASS jwk.key_ops is ["encrypt","decrypt","wrapKey","unwrapKey"]
 
 sign:
 PASS jwk.use is undefined

Modified: trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html (164545 => 164546)


--- trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html	2014-02-22 17:50:55 UTC (rev 164545)
+++ trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html	2014-02-22 18:10:37 UTC (rev 164546)
@@ -48,11 +48,11 @@
     testWithAESCBC(["encrypt"], ["encrypt"]),
     testWithAESCBC(["decrypt"], ["decrypt"]),
     testWithAESCBC(["encrypt", "decrypt"], ["encrypt", "decrypt"]),
-    testWithAESCBC(["wrapKey"], ["wrap"]),
-    testWithAESCBC(["unwrapKey"], ["unwrap"]),
-    testWithAESCBC(["wrapKey", "unwrapKey"], ["wrap", "unwrap"]),
-    testWithAESCBC(["encrypt", "decrypt", "wrapKey"], ["encrypt", "decrypt", "wrap"]),
-    testWithAESCBC(["encrypt", "decrypt", "wrapKey", "unwrapKey"], ["encrypt", "decrypt", "wrap", "unwrap"]),
+    testWithAESCBC(["wrapKey"], ["wrapKey"]),
+    testWithAESCBC(["unwrapKey"], ["unwrapKey"]),
+    testWithAESCBC(["wrapKey", "unwrapKey"], ["wrapKey", "unwrapKey"]),
+    testWithAESCBC(["encrypt", "decrypt", "wrapKey"], ["encrypt", "decrypt", "wrapKey"]),
+    testWithAESCBC(["encrypt", "decrypt", "wrapKey", "unwrapKey"], ["encrypt", "decrypt", "wrapKey", "unwrapKey"]),
     testWithHMAC(["sign"], ["sign"]),
     testWithHMAC(["verify"], ["verify"]),
     testWithHMAC(["sign", "verify"], ["sign", "verify"]),

Modified: trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt (164545 => 164546)


--- trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt	2014-02-22 17:50:55 UTC (rev 164545)
+++ trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt	2014-02-22 18:10:37 UTC (rev 164546)
@@ -14,16 +14,16 @@
 {"key_ops":["encrypt","decrypt"]}:
 PASS key.usages is ["decrypt","encrypt"]
 
-{"key_ops":["wrap"]}:
+{"key_ops":["wrapKey"]}:
 PASS key.usages is ["wrapKey"]
 
-{"key_ops":["unwrap"]}:
+{"key_ops":["unwrapKey"]}:
 PASS key.usages is ["unwrapKey"]
 
-{"key_ops":["wrap","unwrap"]}:
+{"key_ops":["wrapKey","unwrapKey"]}:
 PASS key.usages is ["unwrapKey","wrapKey"]
 
-{"key_ops":["encrypt","decrypt","wrap"]}:
+{"key_ops":["encrypt","decrypt","wrapKey"]}:
 PASS key.usages is ["decrypt","encrypt","wrapKey"]
 
 {"use":"enc"}:

Modified: trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html (164545 => 164546)


--- trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html	2014-02-22 17:50:55 UTC (rev 164545)
+++ trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html	2014-02-22 18:10:37 UTC (rev 164546)
@@ -73,10 +73,10 @@
     testWithAESCBC(["encrypt"], {key_ops: ["encrypt"]}),
     testWithAESCBC(["decrypt"], {key_ops: ["decrypt"]}),
     testWithAESCBC(["decrypt", "encrypt"], {key_ops: ["encrypt", "decrypt"]}),
-    testWithAESCBC(["wrapKey"], {key_ops: ["wrap"]}),
-    testWithAESCBC(["unwrapKey"], {key_ops: ["unwrap"]}),
-    testWithAESCBC(["unwrapKey", "wrapKey"], {key_ops: ["wrap", "unwrap"]}),
-    testWithAESCBC(["decrypt", "encrypt", "wrapKey"], {key_ops: ["encrypt", "decrypt", "wrap"]}),
+    testWithAESCBC(["wrapKey"], {key_ops: ["wrapKey"]}),
+    testWithAESCBC(["unwrapKey"], {key_ops: ["unwrapKey"]}),
+    testWithAESCBC(["unwrapKey", "wrapKey"], {key_ops: ["wrapKey", "unwrapKey"]}),
+    testWithAESCBC(["decrypt", "encrypt", "wrapKey"], {key_ops: ["encrypt", "decrypt", "wrapKey"]}),
     testWithAESCBC(["decrypt", "encrypt", "unwrapKey", "wrapKey"], {use: "enc"}),
     testWithHMAC(["sign"], {key_ops: ["sign"]}),
     testWithHMAC(["verify"], {key_ops: ["verify"]}),

Modified: trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt (164545 => 164546)


--- trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt	2014-02-22 17:50:55 UTC (rev 164545)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt	2014-02-22 18:10:37 UTC (rev 164546)
@@ -27,7 +27,7 @@
 Exporting public key to JWK...
 PASS jwkPublicKey.alg is 'RSA-OAEP'
 PASS jwkPublicKey.ext is true
-PASS jwkPublicKey.key_ops is ['encrypt', 'decrypt', 'wrap', 'unwrap']
+PASS jwkPublicKey.key_ops is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
 PASS jwkPublicKey.use is undefined
 PASS jwkPublicKey.kty is 'RSA'
 PASS bytesToHexString(Base64URL.parse(jwkPublicKey.e)) is '010001'

Modified: trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html (164545 => 164546)


--- trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html	2014-02-22 17:50:55 UTC (rev 164545)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html	2014-02-22 18:10:37 UTC (rev 164546)
@@ -56,7 +56,7 @@
     jwkPublicKey = JSON.parse(bytesToASCIIString(jwkPublicKeyArray));
     shouldBe("jwkPublicKey.alg", "'RSA-OAEP'");
     shouldBe("jwkPublicKey.ext", "true");
-    shouldBe("jwkPublicKey.key_ops", "['encrypt', 'decrypt', 'wrap', 'unwrap']");
+    shouldBe("jwkPublicKey.key_ops", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
     shouldBe("jwkPublicKey.use", "undefined");
     shouldBe("jwkPublicKey.kty", "'RSA'");
     shouldBe("bytesToHexString(Base64URL.parse(jwkPublicKey.e))", "'010001'");

Modified: trunk/Source/WebCore/ChangeLog (164545 => 164546)


--- trunk/Source/WebCore/ChangeLog	2014-02-22 17:50:55 UTC (rev 164545)
+++ trunk/Source/WebCore/ChangeLog	2014-02-22 18:10:37 UTC (rev 164546)
@@ -1,3 +1,18 @@
+2014-02-22  Alexey Proskuryakov  <[email protected]>
+
+        Rename JWK key_ops values from wrap/unwrap to wrapKey/unwrapKey
+        https://bugs.webkit.org/show_bug.cgi?id=129121
+
+        Reviewed by Sam Weinig.
+
+        * bindings/js/JSCryptoKeySerializationJWK.cpp:
+        (WebCore::JSCryptoKeySerializationJWK::reconcileUsages): Updated to newer names.
+        (WebCore::addUsagesToJSON): Ditto.
+        (WebCore::JSCryptoKeySerializationJWK::serialize): rsa-oaep-key-manipulation test
+        started ot fail, because RSA-OAEP with 2048 bit key and sha-1 can only encrypt
+        214 bytes, and the new longer names made JSON serialization slightly longer.
+        Compensate by not doing any indentation in JSON.
+
 2014-02-22  Frédéric Wang  <[email protected]>
 
         Only skip stretchy operators when determining the stretch height.

Modified: trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp (164545 => 164546)


--- trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp	2014-02-22 17:50:55 UTC (rev 164545)
+++ trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp	2014-02-22 18:10:37 UTC (rev 164546)
@@ -282,9 +282,9 @@
                 return;
             if (!tryJWKKeyOpsValue(m_exec, jwkUsages, operation, ASCIILiteral("decrypt"), CryptoKeyUsageDecrypt))
                 return;
-            if (!tryJWKKeyOpsValue(m_exec, jwkUsages, operation, ASCIILiteral("wrap"), CryptoKeyUsageWrapKey))
+            if (!tryJWKKeyOpsValue(m_exec, jwkUsages, operation, ASCIILiteral("wrapKey"), CryptoKeyUsageWrapKey))
                 return;
-            if (!tryJWKKeyOpsValue(m_exec, jwkUsages, operation, ASCIILiteral("unwrap"), CryptoKeyUsageUnwrapKey))
+            if (!tryJWKKeyOpsValue(m_exec, jwkUsages, operation, ASCIILiteral("unwrapKey"), CryptoKeyUsageUnwrapKey))
                 return;
             if (!tryJWKKeyOpsValue(m_exec, jwkUsages, operation, ASCIILiteral("deriveKey"), CryptoKeyUsageDeriveKey))
                 return;
@@ -666,9 +666,9 @@
     if (usages & CryptoKeyUsageDecrypt)
         keyOps->putDirectIndex(exec, index++, jsString(exec, ASCIILiteral("decrypt")));
     if (usages & CryptoKeyUsageWrapKey)
-        keyOps->putDirectIndex(exec, index++, jsString(exec, ASCIILiteral("wrap")));
+        keyOps->putDirectIndex(exec, index++, jsString(exec, ASCIILiteral("wrapKey")));
     if (usages & CryptoKeyUsageUnwrapKey)
-        keyOps->putDirectIndex(exec, index++, jsString(exec, ASCIILiteral("unwrap")));
+        keyOps->putDirectIndex(exec, index++, jsString(exec, ASCIILiteral("unwrapKey")));
     if (usages & CryptoKeyUsageDeriveKey)
         keyOps->putDirectIndex(exec, index++, jsString(exec, ASCIILiteral("deriveKey")));
     if (usages & CryptoKeyUsageDeriveBits)
@@ -709,7 +709,7 @@
     if (exec->hadException())
         return String();
 
-    return JSONStringify(exec, result, 4);
+    return JSONStringify(exec, result, 0);
 }
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to