<!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>[206627] 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/206627">206627</a></dd>
<dt>Author</dt> <dd>jiewen_tan@apple.com</dd>
<dt>Date</dt> <dd>2016-09-29 17:47:21 -0700 (Thu, 29 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Expose CryptoKey to web workers
https://bugs.webkit.org/show_bug.cgi?id=162640
<rdar://problem/28182204>
Reviewed by Brent Fulgham.
Source/WebCore:
Tests: crypto/workers/aes-postMessage-worker.html
crypto/workers/hmac-postMessage-worker.html
crypto/workers/hrsa-postMessage-worker.html
crypto/workers/multiple-postMessage-worker.html
crypto/workers/rsa-postMessage-worker.html
* crypto/CryptoKey.idl:
* crypto/SerializedCryptoKeyWrap.h:
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::deleteDefaultWebCryptoMasterKey):
Add a way to delete the default web crypto master key such that we can test
these APIs and cleanup.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::wrapCryptoKey):
(WebCore::WorkerGlobalScope::unwrapCryptoKey):
* workers/WorkerGlobalScope.h:
Tools:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/SerializedCryptoKeyWrap.mm: Added.
(TestWebKitAPI::TEST_F):
Add API tests for SerializedCryptoKeyWrap APIs.
LayoutTests:
* crypto/resources/common.js: Renamed from LayoutTests/crypto/subtle/resources/common.js.
* crypto/subtle/aes-cbc-192-encrypt-decrypt.html:
* crypto/subtle/aes-cbc-256-encrypt-decrypt.html:
* crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html:
* crypto/subtle/aes-cbc-encrypt-decrypt.html:
* crypto/subtle/aes-cbc-generate-key.html:
* crypto/subtle/aes-cbc-import-jwk.html:
* crypto/subtle/aes-cbc-invalid-length.html:
* crypto/subtle/aes-cbc-unwrap-failure.html:
* crypto/subtle/aes-cbc-unwrap-rsa.html:
* crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html:
* crypto/subtle/aes-cbc-wrap-rsa.html:
* crypto/subtle/aes-cbc-wrong-key-class.html:
* crypto/subtle/aes-export-key.html:
* crypto/subtle/aes-kw-key-manipulation.html:
* crypto/subtle/aes-kw-wrap-unwrap-aes.html:
* crypto/subtle/aes-postMessage-expected.txt:
* crypto/subtle/aes-postMessage.html:
* crypto/subtle/argument-conversion.html:
* crypto/subtle/array-buffer-view-offset.html:
* crypto/subtle/crypto-key-algorithm-gc.html:
* crypto/subtle/crypto-key-usages-gc.html:
* crypto/subtle/hmac-check-algorithm.html:
* crypto/subtle/hmac-export-key.html:
* crypto/subtle/hmac-generate-key.html:
* crypto/subtle/hmac-import-jwk.html:
* crypto/subtle/hmac-postMessage-expected.txt:
* crypto/subtle/hmac-postMessage.html:
* crypto/subtle/hmac-sign-verify-empty-key.html:
* crypto/subtle/hmac-sign-verify.html:
* crypto/subtle/import-jwk.html:
* crypto/subtle/jwk-export-use-values.html:
* crypto/subtle/jwk-import-use-values.html:
* crypto/subtle/postMessage-worker-expected.txt: Removed.
* crypto/subtle/rsa-export-generated-keys.html:
* crypto/subtle/rsa-export-key.html:
* crypto/subtle/rsa-export-private-key.html:
* crypto/subtle/rsa-indexeddb-non-exportable-private.html:
* crypto/subtle/rsa-indexeddb-non-exportable.html:
* crypto/subtle/rsa-indexeddb-private.html:
* crypto/subtle/rsa-indexeddb.html:
* crypto/subtle/rsa-oaep-generate-non-extractable-key.html:
* crypto/subtle/rsa-oaep-key-manipulation.html:
* crypto/subtle/rsa-oaep-plaintext-length.html:
* crypto/subtle/rsa-oaep-wrap-unwrap-aes.html:
* crypto/subtle/rsa-postMessage.html:
* crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html:
* crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html:
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html:
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html:
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html:
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html:
* crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html:
* crypto/subtle/sha-1.html:
* crypto/subtle/sha-224.html:
* crypto/subtle/sha-256.html:
* crypto/subtle/sha-384.html:
* crypto/subtle/sha-512.html:
* crypto/subtle/unimplemented-unwrap-crash.html:
* crypto/subtle/unwrapKey-check-usage.html:
* crypto/subtle/wrapKey-check-usage.html:
* crypto/workers/aes-postMessage-worker-expected.txt: Added.
* crypto/workers/aes-postMessage-worker.html: Added.
* crypto/workers/hmac-postMessage-worker-expected.txt: Added.
* crypto/workers/hmac-postMessage-worker.html: Renamed from LayoutTests/crypto/subtle/postMessage-worker.html.
* crypto/workers/hrsa-postMessage-worker-expected.txt: Added.
* crypto/workers/hrsa-postMessage-worker.html: Added.
* crypto/workers/multiple-postMessage-worker-expected.txt: Added.
* crypto/workers/multiple-postMessage-worker.html: Added.
* crypto/workers/resources/aes-postMessage-worker.js: Added.
* crypto/workers/resources/hmac-postMessage-worker.js: Renamed from LayoutTests/crypto/subtle/resources/postMessage-worker.js.
* crypto/workers/resources/hrsa-postMessage-worker.js: Added.
* crypto/workers/resources/rsa-postMessage-worker.js: Added.
* crypto/workers/rsa-postMessage-worker-expected.txt: Added.
* crypto/workers/rsa-postMessage-worker.html: Added.
* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbc192encryptdecrypthtml">trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbc256encryptdecrypthtml">trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html</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="#trunkLayoutTestscryptosubtleaescbcgeneratekeyhtml">trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkhtml">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcinvalidlengthhtml">trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcunwrapfailurehtml">trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcunwraprsahtml">trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcwraprsanonextractablehtml">trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcwraprsahtml">trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcwrongkeyclasshtml">trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaesexportkeyhtml">trunk/LayoutTests/crypto/subtle/aes-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwkeymanipulationhtml">trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html</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="#trunkLayoutTestscryptosubtleargumentconversionhtml">trunk/LayoutTests/crypto/subtle/argument-conversion.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlearraybufferviewoffsethtml">trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlecryptokeyalgorithmgchtml">trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlecryptokeyusagesgchtml">trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmaccheckalgorithmhtml">trunk/LayoutTests/crypto/subtle/hmac-check-algorithm.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacexportkeyhtml">trunk/LayoutTests/crypto/subtle/hmac-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacgeneratekeyhtml">trunk/LayoutTests/crypto/subtle/hmac-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkhtml">trunk/LayoutTests/crypto/subtle/hmac-import-jwk.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="#trunkLayoutTestscryptosubtlehmacsignverifyemptykeyhtml">trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacsignverifyhtml">trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleimportjwkhtml">trunk/LayoutTests/crypto/subtle/import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlejwkexportusevalueshtml">trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlejwkimportusevalueshtml">trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportgeneratedkeyshtml">trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportkeyhtml">trunk/LayoutTests/crypto/subtle/rsa-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportprivatekeyhtml">trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivatehtml">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbnonexportablehtml">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbprivatehtml">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbhtml">trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyhtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepkeymanipulationhtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepplaintextlengthhtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepwrapunwrapaeshtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersapostMessagehtml">trunk/LayoutTests/crypto/subtle/rsa-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5decrypthtml">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaeshtml">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyhtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwksmallkeyhtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkhtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyhtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha1html">trunk/LayoutTests/crypto/subtle/sha-1.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha224html">trunk/LayoutTests/crypto/subtle/sha-224.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha256html">trunk/LayoutTests/crypto/subtle/sha-256.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha384html">trunk/LayoutTests/crypto/subtle/sha-384.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha512html">trunk/LayoutTests/crypto/subtle/sha-512.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleunimplementedunwrapcrashhtml">trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleunwrapKeycheckusagehtml">trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlewrapKeycheckusagehtml">trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html</a></li>
<li><a href="#trunkLayoutTestsjsdomglobalconstructorsattributesdedicatedworkerexpectedtxt">trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecryptoCryptoKeyidl">trunk/Source/WebCore/crypto/CryptoKey.idl</a></li>
<li><a href="#trunkSourceWebCorecryptoSerializedCryptoKeyWraph">trunk/Source/WebCore/crypto/SerializedCryptoKeyWrap.h</a></li>
<li><a href="#trunkSourceWebCorecryptomacSerializedCryptoKeyWrapMacmm">trunk/Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopecpp">trunk/Source/WebCore/workers/WorkerGlobalScope.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopeh">trunk/Source/WebCore/workers/WorkerGlobalScope.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/crypto/resources/</li>
<li><a href="#trunkLayoutTestscryptoresourcescommonjs">trunk/LayoutTests/crypto/resources/common.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkersaespostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkersaespostMessageworkerhtml">trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkershmacpostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkershmacpostMessageworkerhtml">trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkershrsapostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkershrsapostMessageworkerhtml">trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkersmultiplepostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkersmultiplepostMessageworkerhtml">trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkersresourcesaespostMessageworkerjs">trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkersresourceshmacpostMessageworkerjs">trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkersresourceshrsapostMessageworkerjs">trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkersresourcesrsapostMessageworkerjs">trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkersrsapostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkersrsapostMessageworkerhtml">trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreSerializedCryptoKeyWrapmm">trunk/Tools/TestWebKitAPI/Tests/WebCore/SerializedCryptoKeyWrap.mm</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<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="#trunkLayoutTestscryptosubtleresourcescommonjs">trunk/LayoutTests/crypto/subtle/resources/common.js</a></li>
<li><a href="#trunkLayoutTestscryptosubtleresourcespostMessageworkerjs">trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/ChangeLog        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -1,3 +1,88 @@
</span><ins>+2016-09-29 Jiewen Tan <jiewen_tan@apple.com>
+
+ Expose CryptoKey to web workers
+ https://bugs.webkit.org/show_bug.cgi?id=162640
+ <rdar://problem/28182204>
+
+ Reviewed by Brent Fulgham.
+
+ * crypto/resources/common.js: Renamed from LayoutTests/crypto/subtle/resources/common.js.
+ * crypto/subtle/aes-cbc-192-encrypt-decrypt.html:
+ * crypto/subtle/aes-cbc-256-encrypt-decrypt.html:
+ * crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html:
+ * crypto/subtle/aes-cbc-encrypt-decrypt.html:
+ * crypto/subtle/aes-cbc-generate-key.html:
+ * crypto/subtle/aes-cbc-import-jwk.html:
+ * crypto/subtle/aes-cbc-invalid-length.html:
+ * crypto/subtle/aes-cbc-unwrap-failure.html:
+ * crypto/subtle/aes-cbc-unwrap-rsa.html:
+ * crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html:
+ * crypto/subtle/aes-cbc-wrap-rsa.html:
+ * crypto/subtle/aes-cbc-wrong-key-class.html:
+ * crypto/subtle/aes-export-key.html:
+ * crypto/subtle/aes-kw-key-manipulation.html:
+ * crypto/subtle/aes-kw-wrap-unwrap-aes.html:
+ * crypto/subtle/aes-postMessage-expected.txt:
+ * crypto/subtle/aes-postMessage.html:
+ * crypto/subtle/argument-conversion.html:
+ * crypto/subtle/array-buffer-view-offset.html:
+ * crypto/subtle/crypto-key-algorithm-gc.html:
+ * crypto/subtle/crypto-key-usages-gc.html:
+ * crypto/subtle/hmac-check-algorithm.html:
+ * crypto/subtle/hmac-export-key.html:
+ * crypto/subtle/hmac-generate-key.html:
+ * crypto/subtle/hmac-import-jwk.html:
+ * crypto/subtle/hmac-postMessage-expected.txt:
+ * crypto/subtle/hmac-postMessage.html:
+ * crypto/subtle/hmac-sign-verify-empty-key.html:
+ * crypto/subtle/hmac-sign-verify.html:
+ * crypto/subtle/import-jwk.html:
+ * crypto/subtle/jwk-export-use-values.html:
+ * crypto/subtle/jwk-import-use-values.html:
+ * crypto/subtle/postMessage-worker-expected.txt: Removed.
+ * crypto/subtle/rsa-export-generated-keys.html:
+ * crypto/subtle/rsa-export-key.html:
+ * crypto/subtle/rsa-export-private-key.html:
+ * crypto/subtle/rsa-indexeddb-non-exportable-private.html:
+ * crypto/subtle/rsa-indexeddb-non-exportable.html:
+ * crypto/subtle/rsa-indexeddb-private.html:
+ * crypto/subtle/rsa-indexeddb.html:
+ * crypto/subtle/rsa-oaep-generate-non-extractable-key.html:
+ * crypto/subtle/rsa-oaep-key-manipulation.html:
+ * crypto/subtle/rsa-oaep-plaintext-length.html:
+ * crypto/subtle/rsa-oaep-wrap-unwrap-aes.html:
+ * crypto/subtle/rsa-postMessage.html:
+ * crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html:
+ * crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html:
+ * crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html:
+ * crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html:
+ * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html:
+ * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html:
+ * crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html:
+ * crypto/subtle/sha-1.html:
+ * crypto/subtle/sha-224.html:
+ * crypto/subtle/sha-256.html:
+ * crypto/subtle/sha-384.html:
+ * crypto/subtle/sha-512.html:
+ * crypto/subtle/unimplemented-unwrap-crash.html:
+ * crypto/subtle/unwrapKey-check-usage.html:
+ * crypto/subtle/wrapKey-check-usage.html:
+ * crypto/workers/aes-postMessage-worker-expected.txt: Added.
+ * crypto/workers/aes-postMessage-worker.html: Added.
+ * crypto/workers/hmac-postMessage-worker-expected.txt: Added.
+ * crypto/workers/hmac-postMessage-worker.html: Renamed from LayoutTests/crypto/subtle/postMessage-worker.html.
+ * crypto/workers/hrsa-postMessage-worker-expected.txt: Added.
+ * crypto/workers/hrsa-postMessage-worker.html: Added.
+ * crypto/workers/multiple-postMessage-worker-expected.txt: Added.
+ * crypto/workers/multiple-postMessage-worker.html: Added.
+ * crypto/workers/resources/aes-postMessage-worker.js: Added.
+ * crypto/workers/resources/hmac-postMessage-worker.js: Renamed from LayoutTests/crypto/subtle/resources/postMessage-worker.js.
+ * crypto/workers/resources/hrsa-postMessage-worker.js: Added.
+ * crypto/workers/resources/rsa-postMessage-worker.js: Added.
+ * crypto/workers/rsa-postMessage-worker-expected.txt: Added.
+ * crypto/workers/rsa-postMessage-worker.html: Added.
+ * js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
+
</ins><span class="cx"> 2016-09-29 Nan Wang <n_wang@apple.com>
</span><span class="cx">
</span><span class="cx"> AX: iOS: Tapping <input> in Safari zooms in a bit when page has max scale = 1
</span></span></pre></div>
<a id="trunkLayoutTestscryptoresourcescommonjsfromrev206626trunkLayoutTestscryptosubtleresourcescommonjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/resources/common.js (from rev 206626, trunk/LayoutTests/crypto/subtle/resources/common.js) (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/resources/common.js         (rev 0)
+++ trunk/LayoutTests/crypto/resources/common.js        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+// Verifies that the given "bytes" holds the same value as "expectedHexString".
+// "bytes" can be anything recognized by "bytesToHexString()".
+function bytesShouldMatchHexString(testDescription, expectedHexString, bytes)
+{
+ expectedHexString = "[" + expectedHexString.toLowerCase() + "]";
+ var actualHexString = "[" + bytesToHexString(bytes) + "]";
+
+ if (actualHexString === expectedHexString) {
+ debug("PASS: " + testDescription + " should be " + expectedHexString + " and was");
+ } else {
+ debug("FAIL: " + testDescription + " should be " + expectedHexString + " but was " + actualHexString);
+ }
+}
+
+// Builds a hex string representation for an array-like input.
+// "bytes" can be an Array of bytes, an ArrayBuffer, or any TypedArray.
+// The output looks like this:
+// ab034c99
+function bytesToHexString(bytes)
+{
+ if (!bytes)
+ return null;
+
+ bytes = new Uint8Array(bytes);
+ var hexBytes = [];
+
+ for (var i = 0; i < bytes.length; ++i) {
+ var byteString = bytes[i].toString(16);
+ if (byteString.length < 2)
+ byteString = "0" + byteString;
+ hexBytes.push(byteString);
+ }
+
+ return hexBytes.join("");
+}
+
+function bytesToASCIIString(bytes)
+{
+ return String.fromCharCode.apply(null, new Uint8Array(bytes));
+}
+
+function hexStringToUint8Array(hexString)
+{
+ if (hexString.length % 2 != 0)
+ throw "Invalid hexString";
+ var arrayBuffer = new Uint8Array(hexString.length / 2);
+
+ for (var i = 0; i < hexString.length; i += 2) {
+ var byteValue = parseInt(hexString.substr(i, 2), 16);
+ if (byteValue == NaN)
+ throw "Invalid hexString";
+ arrayBuffer[i/2] = byteValue;
+ }
+
+ return arrayBuffer;
+}
+
+function asciiToUint8Array(str)
+{
+ var chars = [];
+ for (var i = 0; i < str.length; ++i)
+ chars.push(str.charCodeAt(i));
+ return new Uint8Array(chars);
+}
+
+function failAndFinishJSTest(error)
+{
+ if (error)
+ debug(error);
+ finishJSTest();
+}
+
+var Base64URL = {
+ stringify: function (a) {
+ var base64string = btoa(String.fromCharCode.apply(0, a));
+ return base64string.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
+ },
+ parse: function (s) {
+ s = s.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, '');
+ return new Uint8Array(Array.prototype.map.call(atob(s), function (c) { return c.charCodeAt(0) }));
+ }
+};
+
+if (!(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) && !crypto.subtle)
+ crypto.subtle = crypto.webkitSubtle;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc192encryptdecrypthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc256encryptdecrypthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddinghtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecrypthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcgeneratekeyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcinvalidlengthhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcunwrapfailurehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcunwraprsahtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwraprsanonextractablehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwraprsahtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwrongkeyclasshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaesexportkeyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-export-key.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-export-key.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-export-key.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwkeymanipulationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwwrapunwrapaeshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaespostMessageexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt        2016-09-30 00:47:21 UTC (rev 206627)
</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 ["decrypt", "encrypt", "sign", "verify"]
</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="trunkLayoutTestscryptosubtleaespostMessagehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-postMessage.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-postMessage.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/aes-postMessage.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> <head>
</span><span class="cx"> <meta charset="utf-8">
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script>
</span><span class="lines">@@ -18,13 +18,13 @@
</span><span class="cx"> shouldBe("key.extractable", "true");
</span><span class="cx"> shouldBe("key.algorithm.name", "'AES-CBC'");
</span><span class="cx"> shouldBe("key.algorithm.length", "128");
</span><del>- shouldBe("key.usages", '["decrypt", "encrypt", "sign", "verify"]');
</del><ins>+ shouldBe("key.usages", '["decrypt", "encrypt"]');
</ins><span class="cx">
</span><span class="cx"> finishJSTest();
</span><span class="cx"> }, false);
</span><span class="cx">
</span><del>-importTestKeys().then(function(keys) {
- postMessage(keys.aesCbc, "*");
</del><ins>+crypto.subtle.importKey("raw", asciiToUint8Array("16 bytes of key!"), {name: "aes-cbc", length: 128}, true, ["encrypt", "decrypt"]).then(function(key) {
+ postMessage(key, "*");
</ins><span class="cx"> });
</span><span class="cx"> </script>
</span><span class="cx"> <script src="../../resources/js-test-post.js"></script>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleargumentconversionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/argument-conversion.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/argument-conversion.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/argument-conversion.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlearraybufferviewoffsethtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlecryptokeyalgorithmgchtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> <head>
</span><span class="cx"> <meta charset="utf-8">
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlecryptokeyusagesgchtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> <head>
</span><span class="cx"> <meta charset="utf-8">
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmaccheckalgorithmhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-check-algorithm.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-check-algorithm.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/hmac-check-algorithm.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacexportkeyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-export-key.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-export-key.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/hmac-export-key.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacgeneratekeyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-generate-key.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-generate-key.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/hmac-generate-key.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacpostMessageexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt        2016-09-30 00:47:21 UTC (rev 206627)
</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 ["decrypt", "encrypt", "sign", "verify"]
</del><ins>+PASS key.usages is ["sign", "verify"]
</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 (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-postMessage.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/hmac-postMessage.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> <head>
</span><span class="cx"> <meta charset="utf-8">
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script>
</span><span class="lines">@@ -18,13 +18,13 @@
</span><span class="cx"> shouldBe("key.extractable", "true");
</span><span class="cx"> shouldBe("key.algorithm.name", "'HMAC'");
</span><span class="cx"> shouldBe("key.algorithm.length", "16");
</span><del>- shouldBe("key.usages", '["decrypt", "encrypt", "sign", "verify"]');
</del><ins>+ shouldBe("key.usages", '["sign", "verify"]');
</ins><span class="cx">
</span><span class="cx"> finishJSTest();
</span><span class="cx"> }, false);
</span><span class="cx">
</span><del>-importTestKeys().then(function(keys) {
- postMessage(keys.hmacSha1, "*");
</del><ins>+crypto.subtle.importKey("raw", asciiToUint8Array("16 bytes of key!"), {name: 'hmac', hash: {name: 'sha-1'}}, true, ['sign', 'verify']).then(function(key) {
+ postMessage(key, "*");
</ins><span class="cx"> });
</span><span class="cx"> </script>
</span><span class="cx"> <script src="../../resources/js-test-post.js"></script>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacsignverifyemptykeyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacsignverifyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleimportjwkhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/import-jwk.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/import-jwk.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/import-jwk.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlejwkexportusevalueshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlejwkimportusevalueshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlepostMessageworkerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/postMessage-worker-expected.txt (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/postMessage-worker-expected.txt        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/postMessage-worker-expected.txt        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -1,10 +0,0 @@
</span><del>-Test sending crypto keys via postMessage to a worker.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-FAIL Check failed in worker: key is null
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlepostMessageworkerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/postMessage-worker.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/postMessage-worker.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/postMessage-worker.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -1,36 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src="../../resources/js-test-pre.js"></script>
-<script src="resources/common.js"></script>
-</head>
-<body>
-<script>
-
-description("Test sending crypto keys via postMessage to a worker.");
-
-jsTestIsAsync = true;
-
-importTestKeys().then(function(keys) {
- var worker = new Worker("resources/postMessage-worker.js");
- worker.onmessage = function(evt) {
- if (!evt.data.result) {
- testFailed("Check failed in worker: " + evt.data.message);
- } else {
- testPassed("All checks passed in worker");
- key = evt.data.key;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "16");
- shouldBe("key.usages", '["decrypt", "encrypt", "sign", "verify"]');
- }
- finishJSTest();
- }
- worker.postMessage(keys.hmacSha1);
-});
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleresourcescommonjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/resources/common.js (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/resources/common.js        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/resources/common.js        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -1,105 +0,0 @@
</span><del>-function importTestKeys()
-{
- var keyFormat = "raw";
- var data = asciiToUint8Array("16 bytes of key!");
- var extractable = true;
- var keyUsages = ['encrypt', 'decrypt', 'sign', 'verify'];
-
- var hmacPromise = crypto.subtle.importKey(keyFormat, data, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, keyUsages);
- var aesCbcPromise = crypto.subtle.importKey(keyFormat, data, {name: 'AES-CBC'}, extractable, keyUsages);
- var aesCbcJustDecrypt = crypto.subtle.importKey(keyFormat, data, {name: 'AES-CBC'}, false, ['decrypt']);
-
- return Promise.all([hmacPromise, aesCbcPromise, aesCbcJustDecrypt]).then(function(results) {
- return {
- hmacSha1: results[0],
- aesCbc: results[1],
- aesCbcJustDecrypt: results[2],
- };
- });
-}
-
-// Verifies that the given "bytes" holds the same value as "expectedHexString".
-// "bytes" can be anything recognized by "bytesToHexString()".
-function bytesShouldMatchHexString(testDescription, expectedHexString, bytes)
-{
- expectedHexString = "[" + expectedHexString.toLowerCase() + "]";
- var actualHexString = "[" + bytesToHexString(bytes) + "]";
-
- if (actualHexString === expectedHexString) {
- debug("PASS: " + testDescription + " should be " + expectedHexString + " and was");
- } else {
- debug("FAIL: " + testDescription + " should be " + expectedHexString + " but was " + actualHexString);
- }
-}
-
-// Builds a hex string representation for an array-like input.
-// "bytes" can be an Array of bytes, an ArrayBuffer, or any TypedArray.
-// The output looks like this:
-// ab034c99
-function bytesToHexString(bytes)
-{
- if (!bytes)
- return null;
-
- bytes = new Uint8Array(bytes);
- var hexBytes = [];
-
- for (var i = 0; i < bytes.length; ++i) {
- var byteString = bytes[i].toString(16);
- if (byteString.length < 2)
- byteString = "0" + byteString;
- hexBytes.push(byteString);
- }
-
- return hexBytes.join("");
-}
-
-function bytesToASCIIString(bytes)
-{
- return String.fromCharCode.apply(null, new Uint8Array(bytes));
-}
-
-function hexStringToUint8Array(hexString)
-{
- if (hexString.length % 2 != 0)
- throw "Invalid hexString";
- var arrayBuffer = new Uint8Array(hexString.length / 2);
-
- for (var i = 0; i < hexString.length; i += 2) {
- var byteValue = parseInt(hexString.substr(i, 2), 16);
- if (byteValue == NaN)
- throw "Invalid hexString";
- arrayBuffer[i/2] = byteValue;
- }
-
- return arrayBuffer;
-}
-
-function asciiToUint8Array(str)
-{
- var chars = [];
- for (var i = 0; i < str.length; ++i)
- chars.push(str.charCodeAt(i));
- return new Uint8Array(chars);
-}
-
-function failAndFinishJSTest(error)
-{
- if (error)
- debug(error);
- finishJSTest();
-}
-
-var Base64URL = {
- stringify: function (a) {
- var base64string = btoa(String.fromCharCode.apply(0, a));
- return base64string.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
- },
- parse: function (s) {
- s = s.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, '');
- return new Uint8Array(Array.prototype.map.call(atob(s), function (c) { return c.charCodeAt(0) }));
- }
-};
-
-if (!crypto.subtle)
- crypto.subtle = crypto.webkitSubtle;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleresourcespostMessageworkerjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -1,16 +0,0 @@
</span><del>-onmessage = function(evt)
-{
- var key = evt.data;
- if (!key)
- postMessage({ result:false, message:'key is ' + key });
- if (key.type != 'secret')
- postMessage({ result:false, message:'key.type should be "secret"' });
- else if (!key.extractable)
- postMessage({ result:false, message:'key.extractable should be true' });
- else if (key.algorithm.name != "HMAC")
- postMessage({ result:false, message:'key.algorithm.name should be "HMAC"' });
- else if (key.usages.toString() != "decrypt,encrypt,sign,verify")
- postMessage({ result:false, message:'key.usages should be ["decrypt", "encrypt", "sign", "verify"]' });
- else
- postMessage({ result:true, key:key });
-}
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportgeneratedkeyshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportkeyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-export-key.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-key.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-key.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportprivatekeyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivatehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> enablePrivateBrowsing = true;
</span><span class="cx"> </script>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script src="resources/rsa-indexeddb-non-exportable.js"></script>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportablehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script src="resources/rsa-indexeddb-non-exportable.js"></script>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbprivatehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> enablePrivateBrowsing = true;
</span><span class="cx"> </script>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script src="resources/rsa-indexeddb.js"></script>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script src="resources/rsa-indexeddb.js"></script>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepkeymanipulationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepplaintextlengthhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepwrapunwrapaeshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersapostMessagehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsa-postMessage.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-postMessage.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsa-postMessage.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> <head>
</span><span class="cx"> <meta charset="utf-8">
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <script>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5decrypthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</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 (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwksmallkeyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha1html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/sha-1.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-1.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/sha-1.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha224html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/sha-224.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-224.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/sha-224.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha256html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/sha-256.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-256.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/sha-256.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha384html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/sha-384.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-384.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/sha-384.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha512html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/sha-512.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-512.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/sha-512.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleunimplementedunwrapcrashhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleunwrapKeycheckusagehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlewrapKeycheckusagehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><del>-<script src="resources/common.js"></script>
</del><ins>+<script src="../resources/common.js"></script>
</ins><span class="cx"> </head>
</span><span class="cx"> <body>
</span><span class="cx"> <p id="description"></p>
</span></span></pre></div>
<a id="trunkLayoutTestscryptoworkersaespostMessageworkerexpectedtxtfromrev206626trunkLayoutTestscryptosubtleaespostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt (from rev 206626, trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt) (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test sending aes crypto keys via postMessage to a worker.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS All checks passed in worker
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkersaespostMessageworkerhtmlfromrev206626trunkLayoutTestscryptosubtlepostMessageworkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html (from rev 206626, trunk/LayoutTests/crypto/subtle/postMessage-worker.html) (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html         (rev 0)
+++ trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<script>
+
+description("Test sending aes crypto keys via postMessage to a worker.");
+
+jsTestIsAsync = true;
+
+crypto.subtle.importKey("raw", asciiToUint8Array("16 bytes of key!"), {name: "aes-cbc", length: 128}, true, ["encrypt", "decrypt"]).then(function(localKey) {
+ var worker = new Worker("resources/aes-postMessage-worker.js");
+ worker.onmessage = function(evt) {
+ if (!evt.data.result) {
+ testFailed("Check failed in worker: " + evt.data.message);
+ } else {
+ testPassed("All checks passed in worker");
+ key = evt.data.key;
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'AES-CBC'");
+ shouldBe("key.algorithm.length", "128");
+ shouldBe("key.usages", "['decrypt', 'encrypt']");
+ }
+ finishJSTest();
+ }
+ worker.postMessage(localKey);
+});
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkershmacpostMessageworkerexpectedtxtfromrev206626trunkLayoutTestscryptosubtlehmacpostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt (from rev 206626, trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt) (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test sending hmac crypto keys via postMessage to a worker.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS All checks passed in worker
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 16
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is ["sign", "verify"]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkershmacpostMessageworkerhtmlfromrev206626trunkLayoutTestscryptosubtlepostMessageworkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html (from rev 206626, trunk/LayoutTests/crypto/subtle/postMessage-worker.html) (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html         (rev 0)
+++ trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<script>
+
+description("Test sending hmac crypto keys via postMessage to a worker.");
+
+jsTestIsAsync = true;
+
+crypto.subtle.importKey("raw", asciiToUint8Array("16 bytes of key!"), {name: 'hmac', hash: {name: 'sha-1'}}, true, ['sign', 'verify']).then(function(localKey) {
+ var worker = new Worker("resources/hmac-postMessage-worker.js");
+ worker.onmessage = function(evt) {
+ if (!evt.data.result) {
+ testFailed("Check failed in worker: " + evt.data.message);
+ } else {
+ testPassed("All checks passed in worker");
+ key = evt.data.key;
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'HMAC'");
+ shouldBe("key.algorithm.length", "16");
+ shouldBe("key.algorithm.hash.name", "'SHA-1'");
+ shouldBe("key.usages", '["sign", "verify"]');
+ }
+ finishJSTest();
+ }
+ worker.postMessage(localKey);
+});
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkershrsapostMessageworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+Test sending hashed rsa crypto keys via postMessage to a worker.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS All checks passed in worker for private key
+PASS privateKey.type is 'private'
+PASS privateKey.extractable is false
+PASS privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS privateKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(privateKey.algorithm.publicExponent) is '010001'
+PASS privateKey.algorithm.hash.name is 'SHA-256'
+PASS privateKey.usages is ['decrypt']
+PASS All checks passed in worker for public key
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash.name is 'SHA-256'
+PASS publicKey.usages is ['encrypt']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkershrsapostMessageworkerhtmlfromrev206626trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html (from rev 206626, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html) (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html         (rev 0)
+++ trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<script>
+
+description("Test sending hashed rsa crypto keys via postMessage to a worker.");
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RS256",
+ n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
+ e: "AQAB"
+};
+
+var privateKeyJSON = {
+ kty: "RSA",
+ alg: "RS256",
+ n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
+ e: "AQAB",
+ d: "eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ",
+ p: "4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0",
+ q: "xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc",
+ dp: "fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk",
+ dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE",
+ qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk"
+};
+
+var algorithmKeyGen = {
+ name: "RSASSA-PKCS1-v1_5",
+ // RsaKeyGenParams
+ modulusLength: 2048,
+ publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
+};
+
+var count = 0;
+var worker = new Worker("resources/hrsa-postMessage-worker.js");
+worker.onmessage = function(evt) {
+ if (!evt.data.result) {
+ testFailed("Check failed in worker: " + evt.data.message);
+ finishJSTest();
+ } else {
+ if (publicKey = evt.data.publicKey) {
+ testPassed("All checks passed in worker for public key");
+ shouldBe("publicKey.type", "'public'");
+ shouldBe("publicKey.extractable", "true");
+ shouldBe("publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+ shouldBe("publicKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(publicKey.algorithm.publicExponent)", "'010001'");
+ shouldBe("publicKey.algorithm.hash.name", "'SHA-256'");
+ shouldBe("publicKey.usages", "['encrypt']");
+ } else if (privateKey = evt.data.privateKey) {
+ testPassed("All checks passed in worker for private key");
+ shouldBe("privateKey.type", "'private'");
+ shouldBe("privateKey.extractable", "false");
+ shouldBe("privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+ shouldBe("privateKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(privateKey.algorithm.publicExponent)", "'010001'");
+ shouldBe("privateKey.algorithm.hash.name", "'SHA-256'");
+ shouldBe("privateKey.usages", "['decrypt']");
+ }
+ count = count + 1;
+ }
+
+ if (count == 2)
+ finishJSTest();
+}
+
+crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), algorithmKeyGen, true, ['encrypt']).then(function(localPublicKey) {
+ worker.postMessage({ publicKey: localPublicKey });
+});
+crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), algorithmKeyGen, false, ['decrypt']).then(function(localPrivateKey) {
+ worker.postMessage({ privateKey: localPrivateKey });
+});
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkersmultiplepostMessageworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+Test sending multiple crypto keys via postMessage to a worker.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS All checks passed in worker: 0
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt']
+PASS All checks passed in worker: 1
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt']
+PASS All checks passed in worker: 2
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt']
+PASS All checks passed in worker: 3
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt']
+PASS All checks passed in worker: 4
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt']
+PASS All checks passed in worker: 5
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt']
+PASS All checks passed in worker: 6
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt']
+PASS All checks passed in worker: 7
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt']
+PASS All checks passed in worker: 8
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt']
+PASS All checks passed in worker: 9
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkersmultiplepostMessageworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html         (rev 0)
+++ trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<script>
+
+description("Test sending multiple crypto keys via postMessage to a worker.");
+
+jsTestIsAsync = true;
+
+var count = 0;
+var worker = new Worker("resources/aes-postMessage-worker.js");
+worker.onmessage = function(evt) {
+ if (!evt.data.result) {
+ testFailed("Check failed in worker: " + evt.data.message);
+ finishJSTest();
+ } else {
+ testPassed("All checks passed in worker: " + count);
+ key = evt.data.key;
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'AES-CBC'");
+ shouldBe("key.algorithm.length", "128");
+ shouldBe("key.usages", "['decrypt', 'encrypt']");
+ count = count + 1;
+ }
+
+ if (count == 10)
+ finishJSTest();
+}
+
+var keyFormat = "raw";
+var keyData = asciiToUint8Array("16 bytes of key!");
+var aesKeyGenParams = {name: "aes-cbc", length: 128};
+var usages = ["encrypt", "decrypt"]
+for (i = 0; i < 10; i++)
+ crypto.subtle.importKey(keyFormat, keyData, aesKeyGenParams, true, usages).then(function(localKey) {
+ worker.postMessage(localKey);
+ });
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkersresourcesaespostMessageworkerjsfromrev206626trunkLayoutTestscryptosubtleresourcespostMessageworkerjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js (from rev 206626, trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js) (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js         (rev 0)
+++ trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+onmessage = function(evt)
+{
+ var key = evt.data;
+ if (!key)
+ postMessage({ result:false, message:'key is ' + key });
+ if (key.type != 'secret')
+ postMessage({ result:false, message:'key.type should be "secret"' });
+ else if (!key.extractable)
+ postMessage({ result:false, message:'key.extractable should be true' });
+ else if (key.algorithm.name != "AES-CBC")
+ postMessage({ result:false, message:'key.algorithm.name should be "AES-CBC"' });
+ else if (key.algorithm.length != 128)
+ postMessage({ result:false, message:'key.algorithm.length should be 128' });
+ else if (key.usages.toString() != "decrypt,encrypt")
+ postMessage({ result:false, message:'key.usages should be ["decrypt", "encrypt"]' });
+ else
+ postMessage({ result:true, key:key });
+}
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkersresourceshmacpostMessageworkerjsfromrev206626trunkLayoutTestscryptosubtleresourcespostMessageworkerjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js (from rev 206626, trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js) (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js         (rev 0)
+++ trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+onmessage = function(evt)
+{
+ var key = evt.data;
+ if (!key)
+ postMessage({ result:false, message:'key is ' + key });
+ if (key.type != 'secret')
+ postMessage({ result:false, message:'key.type should be "secret"' });
+ else if (!key.extractable)
+ postMessage({ result:false, message:'key.extractable should be true' });
+ else if (key.algorithm.name != "HMAC")
+ postMessage({ result:false, message:'key.algorithm.name should be "HMAC"' });
+ else if (key.algorithm.length != 16)
+ postMessage({ result:false, message:'key.algorithm.length should be 16' });
+ else if (key.algorithm.hash.name != "SHA-1")
+ postMessage({ result:false, message:'key.algorithm.hash.name should be "SHA-1"' });
+ else if (key.usages.toString() != "sign,verify")
+ postMessage({ result:false, message:'key.usages should be ["sign", "verify"]' });
+ else
+ postMessage({ result:true, key:key });
+}
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkersresourceshrsapostMessageworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js         (rev 0)
+++ trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+importScripts("../../resources/common.js");
+
+onmessage = function(evt)
+{
+ if (publicKey = evt.data.publicKey) {
+ if (publicKey.type != 'public')
+ postMessage({ result:false, message:'publicKey.type should be "public"' });
+ else if (!publicKey.extractable)
+ postMessage({ result:false, message:'publicKey.extractable should be true' });
+ else if (publicKey.algorithm.name != "RSASSA-PKCS1-v1_5")
+ postMessage({ result:false, message:'publicKey.algorithm.name should be "RSASSA-PKCS1-v1_5"' });
+ else if (publicKey.algorithm.modulusLength != 2048)
+ postMessage({ result:false, message:'publicKey.algorithm.modulusLength should be 2048' });
+ else if (bytesToHexString(publicKey.algorithm.publicExponent) != "010001")
+ postMessage({ result:false, message:'publicKey.algorithm.publicExponent should be "010001"' });
+ else if (publicKey.algorithm.hash.name != "SHA-256")
+ postMessage({ result:false, message:'publicKey.algorithm.hash.name should be "SHA-256"' });
+ else if (publicKey.usages.toString() != "encrypt")
+ postMessage({ result:false, message:'publicKey.usages should be ["encrypt"]' });
+ else
+ postMessage({ result:true, publicKey:publicKey });
+ } else if (privateKey = evt.data.privateKey) {
+ if (privateKey.type != 'private')
+ postMessage({ result:false, message:'privateKey.type should be "private"' });
+ else if (privateKey.extractable)
+ postMessage({ result:false, message:'privateKey.extractable should be false' });
+ else if (privateKey.algorithm.name != "RSASSA-PKCS1-v1_5")
+ postMessage({ result:false, message:'privateKey.algorithm.name should be "RSASSA-PKCS1-v1_5"' });
+ else if (privateKey.algorithm.modulusLength != 2048)
+ postMessage({ result:false, message:'privateKey.algorithm.modulusLength should be 2048' });
+ else if (bytesToHexString(privateKey.algorithm.publicExponent) != "010001")
+ postMessage({ result:false, message:'privateKey.algorithm.publicExponent should be "010001"' });
+ else if (privateKey.algorithm.hash.name != "SHA-256")
+ postMessage({ result:false, message:'publicKey.algorithm.hash.name should be "SHA-256"' });
+ else if (privateKey.usages.toString() != "decrypt")
+ postMessage({ result:false, message:'privateKey.usages should be ["decrypt"]' });
+ else
+ postMessage({ result:true, privateKey:privateKey });
+ } else {
+ postMessage({ result:false, message:'key is ' + key });
+ }
+}
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkersresourcesrsapostMessageworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js         (rev 0)
+++ trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+importScripts("../../resources/common.js");
+
+onmessage = function(evt)
+{
+ if (publicKey = evt.data.publicKey) {
+ if (publicKey.type != 'public')
+ postMessage({ result:false, message:'publicKey.type should be "public"' });
+ else if (!publicKey.extractable)
+ postMessage({ result:false, message:'publicKey.extractable should be true' });
+ else if (publicKey.algorithm.name != "RSAES-PKCS1-v1_5")
+ postMessage({ result:false, message:'publicKey.algorithm.name should be "RSAES-PKCS1-v1_5"' });
+ else if (publicKey.algorithm.modulusLength != 2048)
+ postMessage({ result:false, message:'publicKey.algorithm.modulusLength should be 2048' });
+ else if (bytesToHexString(publicKey.algorithm.publicExponent) != "010001")
+ postMessage({ result:false, message:'publicKey.algorithm.publicExponent should be "010001"' });
+ else if (typeof publicKey.algorithm.hash != 'undefined')
+ postMessage({ result:false, message:'publicKey.algorithm.hash should be undefined' });
+ else if (publicKey.usages.toString() != "encrypt")
+ postMessage({ result:false, message:'publicKey.usages should be ["encrypt"]' });
+ else
+ postMessage({ result:true, publicKey:publicKey });
+ } else if (privateKey = evt.data.privateKey) {
+ if (privateKey.type != 'private')
+ postMessage({ result:false, message:'privateKey.type should be "private"' });
+ else if (privateKey.extractable)
+ postMessage({ result:false, message:'privateKey.extractable should be false' });
+ else if (privateKey.algorithm.name != "RSAES-PKCS1-v1_5")
+ postMessage({ result:false, message:'privateKey.algorithm.name should be "RSAES-PKCS1-v1_5"' });
+ else if (privateKey.algorithm.modulusLength != 2048)
+ postMessage({ result:false, message:'privateKey.algorithm.modulusLength should be 2048' });
+ else if (bytesToHexString(privateKey.algorithm.publicExponent) != "010001")
+ postMessage({ result:false, message:'privateKey.algorithm.publicExponent should be "010001"' });
+ else if (typeof privateKey.algorithm.hash != 'undefined')
+ postMessage({ result:false, message:'privateKey.algorithm.hash should be undefined' });
+ else if (privateKey.usages.toString() != "decrypt")
+ postMessage({ result:false, message:'privateKey.usages should be ["decrypt"]' });
+ else
+ postMessage({ result:true, privateKey:privateKey });
+ } else {
+ postMessage({ result:false, message:'key is ' + key });
+ }
+}
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkersrsapostMessageworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+Test sending rsa crypto keys via postMessage to a worker.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS All checks passed in worker for private key
+PASS privateKey.type is 'private'
+PASS privateKey.extractable is false
+PASS privateKey.algorithm.name is 'RSAES-PKCS1-v1_5'
+PASS privateKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(privateKey.algorithm.publicExponent) is '010001'
+PASS privateKey.algorithm.hash is undefined.
+PASS privateKey.usages is ['decrypt']
+PASS All checks passed in worker for public key
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSAES-PKCS1-v1_5'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash is undefined.
+PASS publicKey.usages is ['encrypt']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkersrsapostMessageworkerhtmlfromrev206626trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html (from rev 206626, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html) (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html         (rev 0)
+++ trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<script>
+
+description("Test sending rsa crypto keys via postMessage to a worker.");
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RSA1_5",
+ n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
+ e: "AQAB"
+};
+
+var privateKeyJSON = {
+ kty: "RSA",
+ alg: "RSA1_5",
+ n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
+ e: "AQAB",
+ d: "eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ",
+ p: "4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0",
+ q: "xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc",
+ dp: "fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk",
+ dq: "jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE",
+ qi: "YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk"
+};
+
+var algorithmKeyGen = {
+ name: "RSAES-PKCS1-v1_5",
+ // RsaKeyGenParams
+ modulusLength: 2048,
+ publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
+};
+
+var count = 0;
+var worker = new Worker("resources/rsa-postMessage-worker.js");
+worker.onmessage = function(evt) {
+ if (!evt.data.result) {
+ testFailed("Check failed in worker: " + evt.data.message);
+ finishJSTest();
+ } else {
+ if (publicKey = evt.data.publicKey) {
+ testPassed("All checks passed in worker for public key");
+ shouldBe("publicKey.type", "'public'");
+ shouldBe("publicKey.extractable", "true");
+ shouldBe("publicKey.algorithm.name", "'RSAES-PKCS1-v1_5'");
+ shouldBe("publicKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(publicKey.algorithm.publicExponent)", "'010001'");
+ shouldBeUndefined("publicKey.algorithm.hash");
+ shouldBe("publicKey.usages", "['encrypt']");
+ } else if (privateKey = evt.data.privateKey) {
+ testPassed("All checks passed in worker for private key");
+ shouldBe("privateKey.type", "'private'");
+ shouldBe("privateKey.extractable", "false");
+ shouldBe("privateKey.algorithm.name", "'RSAES-PKCS1-v1_5'");
+ shouldBe("privateKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(privateKey.algorithm.publicExponent)", "'010001'");
+ shouldBeUndefined("privateKey.algorithm.hash");
+ shouldBe("privateKey.usages", "['decrypt']");
+ }
+ count = count + 1;
+ }
+
+ if (count == 2)
+ finishJSTest();
+}
+
+crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), algorithmKeyGen, true, ['encrypt']).then(function(localPublicKey) {
+ worker.postMessage({ publicKey: localPublicKey });
+});
+crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), algorithmKeyGen, false, ['decrypt']).then(function(localPrivateKey) {
+ worker.postMessage({ privateKey: localPrivateKey });
+});
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsjsdomglobalconstructorsattributesdedicatedworkerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -39,6 +39,11 @@
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('set') is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Crypto').enumerable is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Crypto').configurable is true
</span><ins>+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'CryptoKey').value is CryptoKey
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'CryptoKey').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'CryptoKey').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'CryptoKey').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'CryptoKey').configurable is true
</ins><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMException').value is DOMException
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMException').hasOwnProperty('get') is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMException').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/Source/WebCore/ChangeLog        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2016-09-29 Jiewen Tan <jiewen_tan@apple.com>
+
+ Expose CryptoKey to web workers
+ https://bugs.webkit.org/show_bug.cgi?id=162640
+ <rdar://problem/28182204>
+
+ Reviewed by Brent Fulgham.
+
+ Tests: crypto/workers/aes-postMessage-worker.html
+ crypto/workers/hmac-postMessage-worker.html
+ crypto/workers/hrsa-postMessage-worker.html
+ crypto/workers/multiple-postMessage-worker.html
+ crypto/workers/rsa-postMessage-worker.html
+
+ * crypto/CryptoKey.idl:
+ * crypto/SerializedCryptoKeyWrap.h:
+ * crypto/mac/SerializedCryptoKeyWrapMac.mm:
+ (WebCore::deleteDefaultWebCryptoMasterKey):
+ Add a way to delete the default web crypto master key such that we can test
+ these APIs and cleanup.
+ * workers/WorkerGlobalScope.cpp:
+ (WebCore::WorkerGlobalScope::wrapCryptoKey):
+ (WebCore::WorkerGlobalScope::unwrapCryptoKey):
+ * workers/WorkerGlobalScope.h:
+
</ins><span class="cx"> 2016-09-29 Nan Wang <n_wang@apple.com>
</span><span class="cx">
</span><span class="cx"> AX: iOS: Tapping <input> in Safari zooms in a bit when page has max scale = 1
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoCryptoKeyidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/CryptoKey.idl (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/CryptoKey.idl        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/Source/WebCore/crypto/CryptoKey.idl        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx">
</span><span class="cx"> [
</span><span class="cx"> Conditional=SUBTLE_CRYPTO,
</span><ins>+ Exposed=(Window,Worker),
</ins><span class="cx"> GenerateIsReachable=Impl,
</span><span class="cx"> SkipVTableValidation
</span><span class="cx"> ] interface CryptoKey {
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoSerializedCryptoKeyWraph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/SerializedCryptoKeyWrap.h (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/SerializedCryptoKeyWrap.h        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/Source/WebCore/crypto/SerializedCryptoKeyWrap.h        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -33,7 +33,15 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+// The purpose of the following APIs is to protect serialized CryptoKey data in IndexedDB or
+// any other local storage that go through the structured clone algorithm. However, a side effect
+// of this extra layer of protection is redundant communications between mainThread(document) and
+// workerThreads. Please refer to WorkerGlobalScope for detailed explanation. P.S. This extra layer
+// of protection is not required by the spec as of 11 December 2014:
+// https://www.w3.org/TR/WebCryptoAPI/#security-developers
+
</ins><span class="cx"> WEBCORE_EXPORT bool getDefaultWebCryptoMasterKey(Vector<uint8_t>&);
</span><ins>+WEBCORE_EXPORT bool deleteDefaultWebCryptoMasterKey();
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT bool wrapSerializedCryptoKey(const Vector<uint8_t>& masterKey, const Vector<uint8_t>& key, Vector<uint8_t>& result);
</span><span class="cx"> WEBCORE_EXPORT bool unwrapSerializedCryptoKey(const Vector<uint8_t>& masterKey, const Vector<uint8_t>& wrappedKey, Vector<uint8_t>& key);
</span></span></pre></div>
<a id="trunkSourceWebCorecryptomacSerializedCryptoKeyWrapMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -169,6 +169,22 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool deleteDefaultWebCryptoMasterKey()
+{
+ NSDictionary *query = @{
+ (id)kSecClass : (id)kSecClassGenericPassword,
+ (id)kSecAttrAccount : masterKeyAccountNameForCurrentApplication(),
+ };
+
+ OSStatus status = SecItemDelete((CFDictionaryRef)query);
+ if (status) {
+ if (status != errSecItemNotFound && status != errSecUserCanceled)
+ WTFLogAlways("Could not delete WebCrypto master key in Keychain, error %d", (int)status);
+ return false;
+ }
+ return true;
+}
+
</ins><span class="cx"> bool wrapSerializedCryptoKey(const Vector<uint8_t>& masterKey, const Vector<uint8_t>& key, Vector<uint8_t>& result)
</span><span class="cx"> {
</span><span class="cx"> Vector<uint8_t> kek(16);
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> #include "SecurityOriginPolicy.h"
</span><span class="cx"> #include "SocketProvider.h"
</span><span class="cx"> #include "URL.h"
</span><ins>+#include "WorkerLoaderProxy.h"
</ins><span class="cx"> #include "WorkerLocation.h"
</span><span class="cx"> #include "WorkerNavigator.h"
</span><span class="cx"> #include "WorkerObjectProxy.h"
</span><span class="lines">@@ -383,14 +384,40 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><del>-bool WorkerGlobalScope::wrapCryptoKey(const Vector<uint8_t>&, Vector<uint8_t>&)
</del><ins>+bool WorkerGlobalScope::wrapCryptoKey(const Vector<uint8_t>& key, Vector<uint8_t>& wrappedKey)
</ins><span class="cx"> {
</span><del>- return false;
</del><ins>+ bool result = false, done = false;
+ m_thread.workerLoaderProxy().postTaskToLoader([&result, &key, &wrappedKey, &done, workerGlobalScope = this](ScriptExecutionContext& context) {
+ result = context.wrapCryptoKey(key, wrappedKey);
+ done = true;
+ workerGlobalScope->postTask([](ScriptExecutionContext& context) {
+ ASSERT_UNUSED(context, context.isWorkerGlobalScope());
+ });
+ });
+
+ MessageQueueWaitResult waitResult = MessageQueueMessageReceived;
+ while (!done && waitResult != MessageQueueTerminated)
+ waitResult = m_thread.runLoop().runInMode(this, WorkerRunLoop::defaultMode());
+
+ return result;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool WorkerGlobalScope::unwrapCryptoKey(const Vector<uint8_t>&, Vector<uint8_t>&)
</del><ins>+bool WorkerGlobalScope::unwrapCryptoKey(const Vector<uint8_t>& wrappedKey, Vector<uint8_t>& key)
</ins><span class="cx"> {
</span><del>- return false;
</del><ins>+ bool result = false, done = false;
+ m_thread.workerLoaderProxy().postTaskToLoader([&result, &wrappedKey, &key, &done, workerGlobalScope = this](ScriptExecutionContext& context) {
+ result = context.unwrapCryptoKey(wrappedKey, key);
+ done = true;
+ workerGlobalScope->postTask([](ScriptExecutionContext& context) {
+ ASSERT_UNUSED(context, context.isWorkerGlobalScope());
+ });
+ });
+
+ MessageQueueWaitResult waitResult = MessageQueueMessageReceived;
+ while (!done && waitResult != MessageQueueTerminated)
+ waitResult = m_thread.runLoop().runInMode(this, WorkerRunLoop::defaultMode());
+
+ return result;
</ins><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(SUBTLE_CRYPTO)
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.h (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.h        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.h        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -145,8 +145,15 @@
</span><span class="cx"> void addConsoleMessage(MessageSource, MessageLevel, const String& message, unsigned long requestIdentifier = 0) override;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><del>- bool wrapCryptoKey(const Vector<uint8_t>& key, Vector<uint8_t>& wrappedKey) override;
- bool unwrapCryptoKey(const Vector<uint8_t>& wrappedKey, Vector<uint8_t>& key) override;
</del><ins>+ // The following two functions are side effects of providing extra protection to serialized
+ // CryptoKey data that went through the structured clone algorithm to local storage such as
+ // IndexedDB. They don't provide any proctection against communications between mainThread
+ // and workerThreads. In fact, they cause extra expense as workerThreads cannot talk to clients
+ // to unwrap/wrap crypto keys. Hence, workerThreads must always ask mainThread to unwrap/wrap
+ // keys, which results in a second communication and plain keys being transferred between
+ // workerThreads and the mainThread.
+ bool wrapCryptoKey(const Vector<uint8_t>& key, Vector<uint8_t>& wrappedKey) final;
+ bool unwrapCryptoKey(const Vector<uint8_t>& wrappedKey, Vector<uint8_t>& key) final;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> Crypto& crypto() const;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/Tools/ChangeLog        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-09-29 Jiewen Tan <jiewen_tan@apple.com>
+
+ Expose CryptoKey to web workers
+ https://bugs.webkit.org/show_bug.cgi?id=162640
+ <rdar://problem/28182204>
+
+ Reviewed by Brent Fulgham.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebCore/SerializedCryptoKeyWrap.mm: Added.
+ (TestWebKitAPI::TEST_F):
+ Add API tests for SerializedCryptoKeyWrap APIs.
+
</ins><span class="cx"> 2016-09-29 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> Fix syntax violation handling in IPv4 address parsing
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (206626 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-09-30 00:38:18 UTC (rev 206626)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -142,6 +142,7 @@
</span><span class="cx">                 5714ECB91CA8B5B000051AC8 /* DownloadRequestOriginalURL.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5714ECB81CA8B58800051AC8 /* DownloadRequestOriginalURL.html */; };
</span><span class="cx">                 5714ECBB1CA8BFE400051AC8 /* DownloadRequestOriginalURLFrame.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5714ECBA1CA8BFD100051AC8 /* DownloadRequestOriginalURLFrame.html */; };
</span><span class="cx">                 5714ECBD1CA8C22A00051AC8 /* DownloadRequestOriginalURL2.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5714ECBC1CA8C21800051AC8 /* DownloadRequestOriginalURL2.html */; };
</span><ins>+                5769C50B1D9B0002000847FB /* SerializedCryptoKeyWrap.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5769C50A1D9B0001000847FB /* SerializedCryptoKeyWrap.mm */; };
</ins><span class="cx">                 57901FB11CAF142D00ED64F9 /* LoadInvalidURLRequest.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 57901FB01CAF141C00ED64F9 /* LoadInvalidURLRequest.html */; };
</span><span class="cx">                 57F56A5C1C7F8CC100F31D7E /* IsNavigationActionTrusted.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 57F56A5B1C7F8A4000F31D7E /* IsNavigationActionTrusted.html */; };
</span><span class="cx">                 5C2936931D5BF70D00DEAB1E /* CookieAcceptPolicy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C2936911D5BF63E00DEAB1E /* CookieAcceptPolicy.mm */; };
</span><span class="lines">@@ -910,6 +911,7 @@
</span><span class="cx">                 5714ECB81CA8B58800051AC8 /* DownloadRequestOriginalURL.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DownloadRequestOriginalURL.html; sourceTree = "<group>"; };
</span><span class="cx">                 5714ECBA1CA8BFD100051AC8 /* DownloadRequestOriginalURLFrame.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DownloadRequestOriginalURLFrame.html; sourceTree = "<group>"; };
</span><span class="cx">                 5714ECBC1CA8C21800051AC8 /* DownloadRequestOriginalURL2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DownloadRequestOriginalURL2.html; sourceTree = "<group>"; };
</span><ins>+                5769C50A1D9B0001000847FB /* SerializedCryptoKeyWrap.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SerializedCryptoKeyWrap.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 57901FAC1CAF12C200ED64F9 /* LoadInvalidURLRequest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LoadInvalidURLRequest.mm; sourceTree = "<group>"; };
</span><span class="cx">                 57901FAE1CAF137100ED64F9 /* LoadInvalidURLRequest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LoadInvalidURLRequest.mm; sourceTree = "<group>"; };
</span><span class="cx">                 57901FB01CAF141C00ED64F9 /* LoadInvalidURLRequest.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LoadInvalidURLRequest.html; sourceTree = "<group>"; };
</span><span class="lines">@@ -2013,6 +2015,7 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 93A7EB3C18FA63A4009E7670 /* URLExtras.mm */,
</span><span class="cx">                                 CD89D0381C4EDB2A00040A04 /* WebCoreNSURLSession.mm */,
</span><ins>+                                5769C50A1D9B0001000847FB /* SerializedCryptoKeyWrap.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = cocoa;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -2412,6 +2415,7 @@
</span><span class="cx">                                 7CCE7F051A411AE600447C4C /* NewFirstVisuallyNonEmptyLayoutFrames.cpp in Sources */,
</span><span class="cx">                                 7CCE7F251A411AF600447C4C /* OpenAndCloseWindow.mm in Sources */,
</span><span class="cx">                                 7CCB4DA91C83AE7300CC6918 /* PageGroup.cpp in Sources */,
</span><ins>+                                5769C50B1D9B0002000847FB /* SerializedCryptoKeyWrap.mm in Sources */,
</ins><span class="cx">                                 7CCE7F071A411AE600447C4C /* PageLoadBasic.cpp in Sources */,
</span><span class="cx">                                 7CCE7F081A411AE600447C4C /* PageLoadDidChangeLocationWithinPageForFrame.cpp in Sources */,
</span><span class="cx">                                 7CCE7EC71A411A7E00447C4C /* PageVisibilityStateWithWindowChanges.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreSerializedCryptoKeyWrapmm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebCore/SerializedCryptoKeyWrap.mm (0 => 206627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/SerializedCryptoKeyWrap.mm         (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/SerializedCryptoKeyWrap.mm        2016-09-30 00:47:21 UTC (rev 206627)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+
+#import <WebCore/SerializedCryptoKeyWrap.h>
+#import <wtf/MainThread.h>
+
+namespace TestWebKitAPI {
+
+// TODO: We should enable the following tests on iOS simulator once <rdar://problem/28534666> is fixed.
+// A seperate bug is filed about this: <rdar://problem/28507240>.
+#if !PLATFORM(IOS)
+class SerializedCryptoKeyWrapTest : public testing::Test {
+public:
+ virtual void SetUp()
+ {
+ WTF::initializeMainThread();
+ WebCore::deleteDefaultWebCryptoMasterKey();
+ }
+
+ virtual void TearDown()
+ {
+ WebCore::deleteDefaultWebCryptoMasterKey();
+ }
+};
+
+TEST_F(SerializedCryptoKeyWrapTest, GetDefaultWebCryptoMasterKey)
+{
+ Vector<uint8_t> masterKey1;
+ EXPECT_TRUE(WebCore::getDefaultWebCryptoMasterKey(masterKey1));
+
+ Vector<uint8_t> masterKey2;
+ EXPECT_TRUE(WebCore::getDefaultWebCryptoMasterKey(masterKey2));
+
+ EXPECT_TRUE(masterKey1 == masterKey2);
+}
+
+TEST_F(SerializedCryptoKeyWrapTest, DeleteDefaultWebCryptoMasterKey)
+{
+ Vector<uint8_t> masterKey1;
+ EXPECT_TRUE(WebCore::getDefaultWebCryptoMasterKey(masterKey1));
+ EXPECT_TRUE(WebCore::deleteDefaultWebCryptoMasterKey());
+
+ Vector<uint8_t> masterKey2;
+ EXPECT_TRUE(WebCore::getDefaultWebCryptoMasterKey(masterKey2));
+
+ EXPECT_TRUE(masterKey1 != masterKey2);
+}
+
+TEST_F(SerializedCryptoKeyWrapTest, SerializedCryptoKeyWrapUnwrap)
+{
+ Vector<uint8_t> masterKey;
+ EXPECT_TRUE(WebCore::getDefaultWebCryptoMasterKey(masterKey));
+
+ Vector<uint8_t> cryptoKey(16, 1);
+ Vector<uint8_t> wrappedKey;
+ EXPECT_TRUE(WebCore::wrapSerializedCryptoKey(masterKey, cryptoKey, wrappedKey));
+ EXPECT_TRUE(cryptoKey != wrappedKey);
+ // ensure wrappedKey doesn't contain cryptoKey
+ bool notContained = true;
+ size_t limit = wrappedKey.size() - cryptoKey.size() + 1;
+ for (size_t i = 0; i < limit; i++) {
+ size_t j = 0;
+ for (; j < cryptoKey.size() && wrappedKey[i + j] == cryptoKey[j]; j++) { }
+ if (j >= cryptoKey.size()) {
+ notContained = false;
+ break;
+ }
+ }
+ EXPECT_TRUE(notContained);
+
+ Vector<uint8_t> unwrappedKey;
+ EXPECT_TRUE(WebCore::unwrapSerializedCryptoKey(masterKey, wrappedKey, unwrappedKey));
+ EXPECT_TRUE(unwrappedKey == cryptoKey);
+}
+#endif
+
+} // namespace TestWebKitAPI
</ins></span></pre>
</div>
</div>
</body>
</html>