<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[160547] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/160547">160547</a></dd>
<dt>Author</dt> <dd>ap@apple.com</dd>
<dt>Date</dt> <dd>2013-12-13 11:10:54 -0800 (Fri, 13 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebCrypto Key.usages should be ordered alphabetically
https://bugs.webkit.org/show_bug.cgi?id=125696

Reviewed by Darin Adler.

Source/WebCore: 

* crypto/CryptoKey.cpp: (WebCore::CryptoKey::usages): Do it.

LayoutTests: 

* crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt:
* crypto/subtle/aes-cbc-192-encrypt-decrypt.html:
* crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt:
* crypto/subtle/aes-cbc-256-encrypt-decrypt.html:
* crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt:
* crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt:
* crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html:
* crypto/subtle/aes-cbc-encrypt-decrypt.html:
* crypto/subtle/aes-cbc-generate-key-expected.txt:
* crypto/subtle/aes-cbc-generate-key.html:
* crypto/subtle/aes-cbc-invalid-length-expected.txt:
* crypto/subtle/aes-cbc-invalid-length.html:
* crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt:
* crypto/subtle/aes-kw-wrap-unwrap-aes.html:
* crypto/subtle/aes-postMessage-expected.txt:
* crypto/subtle/aes-postMessage.html:
* crypto/subtle/hmac-postMessage-expected.txt:
* crypto/subtle/hmac-postMessage.html:
* crypto/subtle/jwk-import-use-values-expected.txt:
* crypto/subtle/jwk-import-use-values.html:
* crypto/subtle/postMessage-worker-expected.txt:
* crypto/subtle/postMessage-worker.html:
* crypto/subtle/resources/postMessage-worker.js:
(onmessage):
* crypto/subtle/rsa-oaep-key-manipulation-expected.txt:
* crypto/subtle/rsa-oaep-key-manipulation.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:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbc192encryptdecryptexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbc192encryptdecrypthtml">trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbc256encryptdecryptexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbc256encryptdecrypthtml">trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcencryptdecryptexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddingexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddinghtml">trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcencryptdecrypthtml">trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcgeneratekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcgeneratekeyhtml">trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcinvalidlengthexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcinvalidlengthhtml">trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwwrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwwrapunwrapaeshtml">trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaespostMessageexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaespostMessagehtml">trunk/LayoutTests/crypto/subtle/aes-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacpostMessageexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacpostMessagehtml">trunk/LayoutTests/crypto/subtle/hmac-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlejwkimportusevaluesexpectedtxt">trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlejwkimportusevalueshtml">trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlepostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/subtle/postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlepostMessageworkerhtml">trunk/LayoutTests/crypto/subtle/postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleresourcespostMessageworkerjs">trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepkeymanipulationexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepkeymanipulationhtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepwrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepwrapunwrapaeshtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaeshtml">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecryptoCryptoKeycpp">trunk/Source/WebCore/crypto/CryptoKey.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/ChangeLog        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2013-12-13  Alexey Proskuryakov  &lt;ap@apple.com&gt;
+
+        WebCrypto Key.usages should be ordered alphabetically
+        https://bugs.webkit.org/show_bug.cgi?id=125696
+
+        Reviewed by Darin Adler.
+
+        * crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt:
+        * crypto/subtle/aes-cbc-192-encrypt-decrypt.html:
+        * crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt:
+        * crypto/subtle/aes-cbc-256-encrypt-decrypt.html:
+        * crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt:
+        * crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt:
+        * crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html:
+        * crypto/subtle/aes-cbc-encrypt-decrypt.html:
+        * crypto/subtle/aes-cbc-generate-key-expected.txt:
+        * crypto/subtle/aes-cbc-generate-key.html:
+        * crypto/subtle/aes-cbc-invalid-length-expected.txt:
+        * crypto/subtle/aes-cbc-invalid-length.html:
+        * crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt:
+        * crypto/subtle/aes-kw-wrap-unwrap-aes.html:
+        * crypto/subtle/aes-postMessage-expected.txt:
+        * crypto/subtle/aes-postMessage.html:
+        * crypto/subtle/hmac-postMessage-expected.txt:
+        * crypto/subtle/hmac-postMessage.html:
+        * crypto/subtle/jwk-import-use-values-expected.txt:
+        * crypto/subtle/jwk-import-use-values.html:
+        * crypto/subtle/postMessage-worker-expected.txt:
+        * crypto/subtle/postMessage-worker.html:
+        * crypto/subtle/resources/postMessage-worker.js:
+        (onmessage):
+        * crypto/subtle/rsa-oaep-key-manipulation-expected.txt:
+        * crypto/subtle/rsa-oaep-key-manipulation.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:
+
</ins><span class="cx"> 2013-12-13  Rob Buis  &lt;rob.buis@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Clean up SVGScriptElement
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc192encryptdecryptexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS key.algorithm.length is 192
</span><del>-PASS key.usages is ['encrypt', 'decrypt']
</del><ins>+PASS key.usages is ['decrypt', 'encrypt']
</ins><span class="cx"> Using the key to encrypt plaintext...
</span><span class="cx"> PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'
</span><span class="cx"> Decrypting it back...
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc192encryptdecrypthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.length&quot;, &quot;192&quot;);
</span><del>-    shouldBe(&quot;key.usages&quot;, &quot;['encrypt', 'decrypt']&quot;);
</del><ins>+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;Using the key to encrypt plaintext...&quot;);
</span><span class="cx">     return crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc256encryptdecryptexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS key.algorithm.length is 256
</span><del>-PASS key.usages is ['encrypt', 'decrypt']
</del><ins>+PASS key.usages is ['decrypt', 'encrypt']
</ins><span class="cx"> Using the key to encrypt plaintext...
</span><span class="cx"> PASS bytesToHexString(new Uint8Array(encryptionResult)) is 'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644'
</span><span class="cx"> Decrypting it back...
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc256encryptdecrypthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.length&quot;, &quot;256&quot;);
</span><del>-    shouldBe(&quot;key.usages&quot;, &quot;['encrypt', 'decrypt']&quot;);
</del><ins>+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;Using the key to encrypt plaintext...&quot;);
</span><span class="cx">     return crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecryptexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS key.algorithm.length is 128
</span><del>-PASS key.usages is ['encrypt', 'decrypt']
</del><ins>+PASS key.usages is ['decrypt', 'encrypt']
</ins><span class="cx"> Using the key to encrypt plaintext...
</span><span class="cx"> PASS bytesToHexString(new Uint8Array(encryptionResult)) is '7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012'
</span><span class="cx"> Decrypting it back...
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS key.algorithm.length is 128
</span><del>-PASS key.usages is ['encrypt', 'decrypt']
</del><ins>+PASS key.usages is ['decrypt', 'encrypt']
</ins><span class="cx"> Using the key to encrypt plaintext...
</span><span class="cx"> PASS bytesToHexString(new Uint8Array(cyphertext)) is '630199c5f202cc7167bb84c6c72b349d'
</span><span class="cx"> Decrypting it back...
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddinghtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
</span><del>-    shouldBe(&quot;key.usages&quot;, &quot;['encrypt', 'decrypt']&quot;);
</del><ins>+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;Using the key to encrypt plaintext...&quot;);
</span><span class="cx">     return crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecrypthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
</span><del>-    shouldBe(&quot;key.usages&quot;, &quot;['encrypt', 'decrypt']&quot;);
</del><ins>+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;Using the key to encrypt plaintext...&quot;);
</span><span class="cx">     return crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcgeneratekeyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS key.algorithm.length is 128
</span><del>-PASS key.usages is ['encrypt', 'decrypt']
</del><ins>+PASS key.usages is ['decrypt', 'encrypt']
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcgeneratekeyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
</span><del>-    shouldBe(&quot;key.usages&quot;, &quot;['encrypt', 'decrypt']&quot;);
</del><ins>+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     finishJSTest();
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcinvalidlengthexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS key.algorithm.length is 176
</span><del>-PASS key.usages is ['encrypt', 'decrypt']
</del><ins>+PASS key.usages is ['decrypt', 'encrypt']
</ins><span class="cx"> Using the key to encrypt plaintext...
</span><span class="cx"> Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail.
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcinvalidlengthhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.length&quot;, &quot;176&quot;);
</span><del>-    shouldBe(&quot;key.usages&quot;, &quot;['encrypt', 'decrypt']&quot;);
</del><ins>+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;Using the key to encrypt plaintext...&quot;);
</span><span class="cx">     return crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, [plaintext]);
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwwrapunwrapaesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> PASS unwrappedKey.extractable is true
</span><span class="cx"> PASS unwrappedKey.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS unwrappedKey.algorithm.length is 128
</span><del>-PASS unwrappedKey.usages is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
</del><ins>+PASS unwrappedKey.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
</ins><span class="cx"> Exporting it...
</span><span class="cx"> PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(keyData)
</span><span class="cx"> 
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx"> PASS unwrappedKey.extractable is true
</span><span class="cx"> PASS unwrappedKey.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS unwrappedKey.algorithm.length is 128
</span><del>-PASS unwrappedKey.usages is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
</del><ins>+PASS unwrappedKey.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
</ins><span class="cx"> Exporting it...
</span><span class="cx"> PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(keyData)
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwwrapunwrapaeshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx">     shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;128&quot;);
</span><del>-    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']&quot;);
</del><ins>+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;Exporting it...&quot;);
</span><span class="cx">     return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">     shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;128&quot;);
</span><del>-    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']&quot;);
</del><ins>+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;Exporting it...&quot;);
</span><span class="cx">     return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaespostMessageexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS key.algorithm.length is 128
</span><del>-PASS key.usages is [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]
</del><ins>+PASS key.usages is [&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaespostMessagehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-postMessage.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-postMessage.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/aes-postMessage.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
</span><del>-    shouldBe(&quot;key.usages&quot;, '[&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]');
</del><ins>+    shouldBe(&quot;key.usages&quot;, '[&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]');
</ins><span class="cx"> 
</span><span class="cx">     finishJSTest();
</span><span class="cx"> }, false);
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacpostMessageexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'HMAC'
</span><span class="cx"> PASS key.algorithm.length is 16
</span><del>-PASS key.usages is [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]
</del><ins>+PASS key.usages is [&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacpostMessagehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-postMessage.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-postMessage.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/hmac-postMessage.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.length&quot;, &quot;16&quot;);
</span><del>-    shouldBe(&quot;key.usages&quot;, '[&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]');
</del><ins>+    shouldBe(&quot;key.usages&quot;, '[&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]');
</ins><span class="cx"> 
</span><span class="cx">     finishJSTest();
</span><span class="cx"> }, false);
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlejwkimportusevaluesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx"> PASS key.usages is [&quot;decrypt&quot;]
</span><span class="cx"> 
</span><span class="cx"> enconly,deconly:
</span><del>-PASS key.usages is [&quot;encrypt&quot;,&quot;decrypt&quot;]
</del><ins>+PASS key.usages is [&quot;decrypt&quot;,&quot;encrypt&quot;]
</ins><span class="cx"> 
</span><span class="cx"> wrap:
</span><span class="cx"> PASS key.usages is [&quot;wrapKey&quot;]
</span><span class="lines">@@ -19,13 +19,13 @@
</span><span class="cx"> PASS key.usages is [&quot;unwrapKey&quot;]
</span><span class="cx"> 
</span><span class="cx"> wrap,unwrap:
</span><del>-PASS key.usages is [&quot;wrapKey&quot;,&quot;unwrapKey&quot;]
</del><ins>+PASS key.usages is [&quot;unwrapKey&quot;,&quot;wrapKey&quot;]
</ins><span class="cx"> 
</span><span class="cx"> enconly,deconly,wrap:
</span><del>-PASS key.usages is [&quot;encrypt&quot;,&quot;decrypt&quot;,&quot;wrapKey&quot;]
</del><ins>+PASS key.usages is [&quot;decrypt&quot;,&quot;encrypt&quot;,&quot;wrapKey&quot;]
</ins><span class="cx"> 
</span><span class="cx"> enc:
</span><del>-PASS key.usages is [&quot;encrypt&quot;,&quot;decrypt&quot;,&quot;wrapKey&quot;,&quot;unwrapKey&quot;]
</del><ins>+PASS key.usages is [&quot;decrypt&quot;,&quot;encrypt&quot;,&quot;unwrapKey&quot;,&quot;wrapKey&quot;]
</ins><span class="cx"> 
</span><span class="cx"> sigonly:
</span><span class="cx"> PASS key.usages is [&quot;sign&quot;]
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> PASS key.usages is [&quot;encrypt&quot;]
</span><span class="cx"> 
</span><span class="cx"> enconly,,deconly:
</span><del>-PASS key.usages is [&quot;encrypt&quot;,&quot;decrypt&quot;]
</del><ins>+PASS key.usages is [&quot;decrypt&quot;,&quot;encrypt&quot;]
</ins><span class="cx"> 
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlejwkimportusevalueshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -54,12 +54,12 @@
</span><span class="cx"> Promise.all([
</span><span class="cx">     testWithAESCBC([&quot;encrypt&quot;], &quot;enconly&quot;),
</span><span class="cx">     testWithAESCBC([&quot;decrypt&quot;], &quot;deconly&quot;),
</span><del>-    testWithAESCBC([&quot;encrypt&quot;, &quot;decrypt&quot;], &quot;enconly,deconly&quot;),
</del><ins>+    testWithAESCBC([&quot;decrypt&quot;, &quot;encrypt&quot;], &quot;enconly,deconly&quot;),
</ins><span class="cx">     testWithAESCBC([&quot;wrapKey&quot;], &quot;wrap&quot;),
</span><span class="cx">     testWithAESCBC([&quot;unwrapKey&quot;], &quot;unwrap&quot;),
</span><del>-    testWithAESCBC([&quot;wrapKey&quot;, &quot;unwrapKey&quot;], &quot;wrap,unwrap&quot;),
-    testWithAESCBC([&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;], &quot;enconly,deconly,wrap&quot;),
-    testWithAESCBC([&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;], &quot;enc&quot;),
</del><ins>+    testWithAESCBC([&quot;unwrapKey&quot;, &quot;wrapKey&quot;], &quot;wrap,unwrap&quot;),
+    testWithAESCBC([&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;wrapKey&quot;], &quot;enconly,deconly,wrap&quot;),
+    testWithAESCBC([&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;unwrapKey&quot;, &quot;wrapKey&quot;], &quot;enc&quot;),
</ins><span class="cx">     testWithHMAC([&quot;sign&quot;], &quot;sigonly&quot;),
</span><span class="cx">     testWithHMAC([&quot;verify&quot;], &quot;vfyonly&quot;),
</span><span class="cx">     testWithHMAC([&quot;sign&quot;, &quot;verify&quot;], &quot;sig&quot;),
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     testWithAESCBC([], &quot;enconly &quot;),
</span><span class="cx">     testWithAESCBC([], &quot;EncOnly&quot;),
</span><span class="cx">     testWithAESCBC([&quot;encrypt&quot;], &quot;enconly, deconly&quot;),
</span><del>-    testWithAESCBC([&quot;encrypt&quot;, &quot;decrypt&quot;], &quot;enconly,,deconly&quot;),
</del><ins>+    testWithAESCBC([&quot;decrypt&quot;,&quot;encrypt&quot;], &quot;enconly,,deconly&quot;),
</ins><span class="cx"> 
</span><span class="cx"> ]).then(function() { finishJSTest(); } );
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlepostMessageworkerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/postMessage-worker-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/postMessage-worker-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/postMessage-worker-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'HMAC'
</span><span class="cx"> PASS key.algorithm.length is 16
</span><del>-PASS key.usages is [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]
</del><ins>+PASS key.usages is [&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlepostMessageworkerhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/postMessage-worker.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/postMessage-worker.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/postMessage-worker.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx">             shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">             shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
</span><span class="cx">             shouldBe(&quot;key.algorithm.length&quot;, &quot;16&quot;);
</span><del>-            shouldBe(&quot;key.usages&quot;, '[&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]');
</del><ins>+            shouldBe(&quot;key.usages&quot;, '[&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]');
</ins><span class="cx">         }
</span><span class="cx">         finishJSTest();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleresourcespostMessageworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -7,8 +7,8 @@
</span><span class="cx">         postMessage({ result:false, message:'key.extractable should be true' });
</span><span class="cx">     else if (key.algorithm.name != &quot;HMAC&quot;)
</span><span class="cx">         postMessage({ result:false, message:'key.algorithm.name should be &quot;HMAC&quot;' });
</span><del>-    else if (key.usages.toString() != &quot;encrypt,decrypt,sign,verify&quot;)
-        postMessage({ result:false, message:'key.usages should be [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]' });
</del><ins>+    else if (key.usages.toString() != &quot;decrypt,encrypt,sign,verify&quot;)
+        postMessage({ result:false, message:'key.usages should be [&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;sign&quot;, &quot;verify&quot;]' });
</ins><span class="cx">     else
</span><span class="cx">         postMessage({ result:true, key:key });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepkeymanipulationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> PASS bytesToHexString(exportedPublicKey.algorithm.publicExponent) is '010001'
</span><span class="cx"> PASS exportedPublicKey.algorithm.hash.name is 'SHA-1'
</span><span class="cx"> PASS exportedPublicKey.extractable is true
</span><del>-PASS exportedPublicKey.usages is ['encrypt','decrypt','wrapKey','unwrapKey']
</del><ins>+PASS exportedPublicKey.usages is ['decrypt','encrypt','unwrapKey','wrapKey']
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepkeymanipulationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">     shouldBe(&quot;bytesToHexString(exportedPublicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
</span><span class="cx">     shouldBe(&quot;exportedPublicKey.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
</span><span class="cx">     shouldBe(&quot;exportedPublicKey.extractable&quot;, &quot;true&quot;);
</span><del>-    shouldBe(&quot;exportedPublicKey.usages&quot;, &quot;['encrypt','decrypt','wrapKey','unwrapKey']&quot;);
</del><ins>+    shouldBe(&quot;exportedPublicKey.usages&quot;, &quot;['decrypt','encrypt','unwrapKey','wrapKey']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     finishJSTest();
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepwrapunwrapaesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> PASS unwrappedKey.extractable is true
</span><span class="cx"> PASS unwrappedKey.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS unwrappedKey.algorithm.length is 256
</span><del>-PASS unwrappedKey.usages is ['encrypt', 'decrypt']
</del><ins>+PASS unwrappedKey.usages is ['decrypt', 'encrypt']
</ins><span class="cx"> Exporting it...
</span><span class="cx"> PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
</span><span class="cx"> 
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> PASS unwrappedKey.extractable is true
</span><span class="cx"> PASS unwrappedKey.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS unwrappedKey.algorithm.length is 256
</span><del>-PASS unwrappedKey.usages is ['encrypt', 'decrypt']
</del><ins>+PASS unwrappedKey.usages is ['decrypt', 'encrypt']
</ins><span class="cx"> Exporting it...
</span><span class="cx"> PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepwrapunwrapaeshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">     shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
</span><del>-    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['encrypt', 'decrypt']&quot;);
</del><ins>+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;Exporting it...&quot;);
</span><span class="cx">     return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">     shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
</span><del>-    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['encrypt', 'decrypt']&quot;);
</del><ins>+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;Exporting it...&quot;);
</span><span class="cx">     return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> PASS unwrappedKey.extractable is true
</span><span class="cx"> PASS unwrappedKey.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS unwrappedKey.algorithm.length is 256
</span><del>-PASS unwrappedKey.usages is ['encrypt', 'decrypt']
</del><ins>+PASS unwrappedKey.usages is ['decrypt', 'encrypt']
</ins><span class="cx"> Exporting it...
</span><span class="cx"> PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
</span><span class="cx"> 
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> PASS unwrappedKey.extractable is true
</span><span class="cx"> PASS unwrappedKey.algorithm.name is 'AES-CBC'
</span><span class="cx"> PASS unwrappedKey.algorithm.length is 256
</span><del>-PASS unwrappedKey.usages is ['encrypt', 'decrypt']
</del><ins>+PASS unwrappedKey.usages is ['decrypt', 'encrypt']
</ins><span class="cx"> Exporting it...
</span><span class="cx"> PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaeshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">     shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
</span><del>-    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['encrypt', 'decrypt']&quot;);
</del><ins>+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;Exporting it...&quot;);
</span><span class="cx">     return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">     shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
</span><span class="cx">     shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
</span><del>-    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['encrypt', 'decrypt']&quot;);
</del><ins>+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;Exporting it...&quot;);
</span><span class="cx">     return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/Source/WebCore/ChangeLog        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2013-12-13  Alexey Proskuryakov  &lt;ap@apple.com&gt;
+
+        WebCrypto Key.usages should be ordered alphabetically
+        https://bugs.webkit.org/show_bug.cgi?id=125696
+
+        Reviewed by Darin Adler.
+
+        * crypto/CryptoKey.cpp: (WebCore::CryptoKey::usages): Do it.
+
</ins><span class="cx"> 2013-12-13  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Make some optimizations for DOM bindings involving vectors
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoCryptoKeycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/CryptoKey.cpp (160546 => 160547)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/CryptoKey.cpp        2013-12-13 16:27:54 UTC (rev 160546)
+++ trunk/Source/WebCore/crypto/CryptoKey.cpp        2013-12-13 19:10:54 UTC (rev 160547)
</span><span class="lines">@@ -67,23 +67,24 @@
</span><span class="cx"> 
</span><span class="cx"> Vector&lt;String&gt; CryptoKey::usages() const
</span><span class="cx"> {
</span><ins>+    // The result is ordered alphabetically.
</ins><span class="cx">     Vector&lt;String&gt; result;
</span><ins>+    if (m_usages &amp; CryptoKeyUsageDecrypt)
+        result.append(ASCIILiteral(&quot;decrypt&quot;));
+    if (m_usages &amp; CryptoKeyUsageDeriveBits)
+        result.append(ASCIILiteral(&quot;deriveBits&quot;));
+    if (m_usages &amp; CryptoKeyUsageDeriveKey)
+        result.append(ASCIILiteral(&quot;deriveKey&quot;));
</ins><span class="cx">     if (m_usages &amp; CryptoKeyUsageEncrypt)
</span><span class="cx">         result.append(ASCIILiteral(&quot;encrypt&quot;));
</span><del>-    if (m_usages &amp; CryptoKeyUsageDecrypt)
-        result.append(ASCIILiteral(&quot;decrypt&quot;));
</del><span class="cx">     if (m_usages &amp; CryptoKeyUsageSign)
</span><span class="cx">         result.append(ASCIILiteral(&quot;sign&quot;));
</span><ins>+    if (m_usages &amp; CryptoKeyUsageUnwrapKey)
+        result.append(ASCIILiteral(&quot;unwrapKey&quot;));
</ins><span class="cx">     if (m_usages &amp; CryptoKeyUsageVerify)
</span><span class="cx">         result.append(ASCIILiteral(&quot;verify&quot;));
</span><del>-    if (m_usages &amp; CryptoKeyUsageDeriveKey)
-        result.append(ASCIILiteral(&quot;deriveKey&quot;));
-    if (m_usages &amp; CryptoKeyUsageDeriveBits)
-        result.append(ASCIILiteral(&quot;deriveBits&quot;));
</del><span class="cx">     if (m_usages &amp; CryptoKeyUsageWrapKey)
</span><span class="cx">         result.append(ASCIILiteral(&quot;wrapKey&quot;));
</span><del>-    if (m_usages &amp; CryptoKeyUsageUnwrapKey)
-        result.append(ASCIILiteral(&quot;unwrapKey&quot;));
</del><span class="cx"> 
</span><span class="cx">     return result;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>