<!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>[206883] 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/206883">206883</a></dd>
<dt>Author</dt> <dd>jiewen_tan@apple.com</dd>
<dt>Date</dt> <dd>2016-10-06 14:32:02 -0700 (Thu, 06 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add a dummy SubtleCrypto interface
https://bugs.webkit.org/show_bug.cgi?id=162992
<rdar://problem/28643573>
Reviewed by Brent Fulgham.
LayoutTests/imported/w3c:
* WebCryptoAPI/digest/test_digest-expected.txt:
* WebCryptoAPI/idlharness-expected.txt:
Source/WebCore:
Add a dummy SubtleCrypto interface and rename KeyPair to CryptoKeyPair.
Tests: crypto/subtle/gc-2.html
crypto/subtle/gc-3.html
crypto/subtle/gc.html
crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html
crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html
crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html
crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html
crypto/webkitSubtle/aes-cbc-generate-key.html
crypto/webkitSubtle/aes-cbc-import-jwk.html
crypto/webkitSubtle/aes-cbc-invalid-length.html
crypto/webkitSubtle/aes-cbc-unwrap-failure.html
crypto/webkitSubtle/aes-cbc-unwrap-rsa.html
crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html
crypto/webkitSubtle/aes-cbc-wrap-rsa.html
crypto/webkitSubtle/aes-cbc-wrong-key-class.html
crypto/webkitSubtle/aes-export-key.html
crypto/webkitSubtle/aes-kw-key-manipulation.html
crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html
crypto/webkitSubtle/aes-postMessage.html
crypto/webkitSubtle/argument-conversion.html
crypto/webkitSubtle/array-buffer-view-offset.html
crypto/webkitSubtle/crypto-key-algorithm-gc.html
crypto/webkitSubtle/crypto-key-usages-gc.html
crypto/webkitSubtle/hmac-check-algorithm.html
crypto/webkitSubtle/hmac-export-key.html
crypto/webkitSubtle/hmac-generate-key.html
crypto/webkitSubtle/hmac-import-jwk.html
crypto/webkitSubtle/hmac-postMessage.html
crypto/webkitSubtle/hmac-sign-verify-empty-key.html
crypto/webkitSubtle/hmac-sign-verify.html
crypto/webkitSubtle/import-jwk.html
crypto/webkitSubtle/jwk-export-use-values.html
crypto/webkitSubtle/jwk-import-use-values.html
crypto/webkitSubtle/rsa-export-generated-keys.html
crypto/webkitSubtle/rsa-export-key.html
crypto/webkitSubtle/rsa-export-private-key.html
crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
crypto/webkitSubtle/rsa-indexeddb-private.html
crypto/webkitSubtle/rsa-indexeddb.html
crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html
crypto/webkitSubtle/rsa-oaep-key-manipulation.html
crypto/webkitSubtle/rsa-oaep-plaintext-length.html
crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html
crypto/webkitSubtle/rsa-postMessage.html
crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html
crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html
crypto/webkitSubtle/sha-1.html
crypto/webkitSubtle/sha-224.html
crypto/webkitSubtle/sha-256.html
crypto/webkitSubtle/sha-384.html
crypto/webkitSubtle/sha-512.html
crypto/webkitSubtle/unimplemented-unwrap-crash.html
crypto/webkitSubtle/unwrapKey-check-usage.html
crypto/webkitSubtle/wrapKey-check-usage.html
crypto/workers/subtle/aes-postMessage-worker.html
crypto/workers/subtle/gc-worker.html
crypto/workers/subtle/hmac-postMessage-worker.html
crypto/workers/subtle/hrsa-postMessage-worker.html
crypto/workers/subtle/multiple-postMessage-worker.html
crypto/workers/subtle/rsa-postMessage-worker.html
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* crypto/CryptoKeyPair.idl:
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::SubtleCrypto):
* crypto/SubtleCrypto.h:
(WebCore::SubtleCrypto::create):
* crypto/SubtleCrypto.idl: Added.
* page/Crypto.cpp:
(WebCore::Crypto::Crypto):
(WebCore::Crypto::subtle):
* page/Crypto.h:
* page/Crypto.idl:
LayoutTests:
* crypto/resources/common.js:
* crypto/subtle/gc-2-expected.txt: Added.
* crypto/subtle/gc-2.html: Added.
* crypto/subtle/gc-3-expected.txt: Added.
* crypto/subtle/gc-3.html: Added.
* crypto/subtle/gc-expected.txt: Added.
* crypto/subtle/gc.html: Added.
* crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt.
* crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html.
* crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt.
* crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html.
* crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt.
* crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt.
* crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html.
* crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html.
* crypto/webkitSubtle/aes-cbc-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt.
* crypto/webkitSubtle/aes-cbc-generate-key.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-generate-key.html.
* crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt.
* crypto/webkitSubtle/aes-cbc-import-jwk.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-import-jwk.html.
* crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt.
* crypto/webkitSubtle/aes-cbc-invalid-length.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-invalid-length.html.
* crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt.
* crypto/webkitSubtle/aes-cbc-unwrap-failure.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html.
* crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt.
* crypto/webkitSubtle/aes-cbc-unwrap-rsa.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html.
* crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt.
* crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt.
* crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html.
* crypto/webkitSubtle/aes-cbc-wrap-rsa.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html.
* crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt.
* crypto/webkitSubtle/aes-cbc-wrong-key-class.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html.
* crypto/webkitSubtle/aes-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-export-key-expected.txt.
* crypto/webkitSubtle/aes-export-key.html: Renamed from LayoutTests/crypto/subtle/aes-export-key.html.
* crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt.
* crypto/webkitSubtle/aes-kw-key-manipulation.html: Renamed from LayoutTests/crypto/subtle/aes-kw-key-manipulation.html.
* crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt.
* crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html.
* crypto/webkitSubtle/aes-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-postMessage-expected.txt.
* crypto/webkitSubtle/aes-postMessage.html: Renamed from LayoutTests/crypto/subtle/aes-postMessage.html.
* crypto/webkitSubtle/argument-conversion-expected.txt: Renamed from LayoutTests/crypto/subtle/argument-conversion-expected.txt.
* crypto/webkitSubtle/argument-conversion.html: Renamed from LayoutTests/crypto/subtle/argument-conversion.html.
* crypto/webkitSubtle/array-buffer-view-offset-expected.txt: Renamed from LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt.
* crypto/webkitSubtle/array-buffer-view-offset.html: Renamed from LayoutTests/crypto/subtle/array-buffer-view-offset.html.
* crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt: Renamed from LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt.
* crypto/webkitSubtle/crypto-key-algorithm-gc.html: Renamed from LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html.
* crypto/webkitSubtle/crypto-key-usages-gc-expected.txt: Renamed from LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt.
* crypto/webkitSubtle/crypto-key-usages-gc.html: Renamed from LayoutTests/crypto/subtle/crypto-key-usages-gc.html.
* crypto/webkitSubtle/hmac-check-algorithm-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt.
* crypto/webkitSubtle/hmac-check-algorithm.html: Renamed from LayoutTests/crypto/subtle/hmac-check-algorithm.html.
* crypto/webkitSubtle/hmac-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-export-key-expected.txt.
* crypto/webkitSubtle/hmac-export-key.html: Renamed from LayoutTests/crypto/subtle/hmac-export-key.html.
* crypto/webkitSubtle/hmac-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-export-key.html.
* crypto/webkitSubtle/hmac-generate-key.html: Renamed from LayoutTests/crypto/subtle/hmac-generate-key.html.
* crypto/webkitSubtle/hmac-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt.
* crypto/webkitSubtle/hmac-import-jwk.html: Renamed from LayoutTests/crypto/subtle/hmac-import-jwk.html.
* crypto/webkitSubtle/hmac-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-postMessage-expected.txt.
* crypto/webkitSubtle/hmac-postMessage.html: Renamed from LayoutTests/crypto/subtle/hmac-postMessage.html.
* crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt.
* crypto/webkitSubtle/hmac-sign-verify-empty-key.html: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html.
* crypto/webkitSubtle/hmac-sign-verify-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt.
* crypto/webkitSubtle/hmac-sign-verify.html: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify.html.
* crypto/webkitSubtle/import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/import-jwk-expected.txt.
* crypto/webkitSubtle/import-jwk.html: Renamed from LayoutTests/crypto/subtle/import-jwk-expected.html.
* crypto/webkitSubtle/jwk-export-use-values-expected.txt: Renamed from LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt.
* crypto/webkitSubtle/jwk-export-use-values.html: Renamed from LayoutTests/crypto/subtle/jwk-export-use-values.html.
* crypto/webkitSubtle/jwk-import-use-values-expected.txt: Renamed from LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt.
* crypto/webkitSubtle/jwk-import-use-values.html: Renamed from LayoutTests/crypto/subtle/jwk-import-use-values.html.
* crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js: Renamed from LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js.
* crypto/webkitSubtle/resources/rsa-indexeddb.js: Renamed from LayoutTests/crypto/subtle/resources/rsa-indexeddb.js.
* crypto/webkitSubtle/rsa-export-generated-keys-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt.
* crypto/webkitSubtle/rsa-export-generated-keys.html: Renamed from LayoutTests/crypto/subtle/rsa-export-generated-keys.html.
* crypto/webkitSubtle/rsa-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-key-expected.txt.
* crypto/webkitSubtle/rsa-export-key.html: Renamed from LayoutTests/crypto/subtle/rsa-export-key.html.
* crypto/webkitSubtle/rsa-export-private-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt.
* crypto/webkitSubtle/rsa-export-private-key.html: Renamed from LayoutTests/crypto/subtle/rsa-export-private-key.html.
* crypto/webkitSubtle/rsa-indexeddb-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt.
* crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt.
* crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt.
* crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html.
* crypto/webkitSubtle/rsa-indexeddb-non-exportable.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html.
* crypto/webkitSubtle/rsa-indexeddb-private-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt.
* crypto/webkitSubtle/rsa-indexeddb-private.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-private.html.
* crypto/webkitSubtle/rsa-indexeddb.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb.html.
* crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt.
* crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html.
* crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt.
* crypto/webkitSubtle/rsa-oaep-key-manipulation.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html.
* crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt.
* crypto/webkitSubtle/rsa-oaep-plaintext-length.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html.
* crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt.
* crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html.
* crypto/webkitSubtle/rsa-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-postMessage-expected.txt.
* crypto/webkitSubtle/rsa-postMessage.html: Renamed from LayoutTests/crypto/subtle/rsa-postMessage.html.
* crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt.
* crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html.
* crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt.
* crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt: Added.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html.
* crypto/webkitSubtle/sha-1-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-1-expected.txt.
* crypto/webkitSubtle/sha-1.html: Renamed from LayoutTests/crypto/subtle/sha-1.html.
* crypto/webkitSubtle/sha-224-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-224-expected.txt.
* crypto/webkitSubtle/sha-224.html: Renamed from LayoutTests/crypto/subtle/sha-224.html.
* crypto/webkitSubtle/sha-256-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-256-expected.txt.
* crypto/webkitSubtle/sha-256.html: Renamed from LayoutTests/crypto/subtle/sha-256.html.
* crypto/webkitSubtle/sha-384-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-384-expected.txt.
* crypto/webkitSubtle/sha-384.html: Renamed from LayoutTests/crypto/subtle/sha-384.html.
* crypto/webkitSubtle/sha-512-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-512-expected.txt.
* crypto/webkitSubtle/sha-512.html: Renamed from LayoutTests/crypto/subtle/sha-512.html.
* crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt: Renamed from LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt.
* crypto/webkitSubtle/unimplemented-unwrap-crash.html: Renamed from LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html.
* crypto/webkitSubtle/unwrapKey-check-usage-expected.txt: Renamed from LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt.
* crypto/webkitSubtle/unwrapKey-check-usage.html: Renamed from LayoutTests/crypto/subtle/unwrapKey-check-usage.html.
* crypto/webkitSubtle/wrapKey-check-usage-expected.txt: Renamed from LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt.
* crypto/webkitSubtle/wrapKey-check-usage.html: Renamed from LayoutTests/crypto/subtle/wrapKey-check-usage.html.
* crypto/workers/subtle/aes-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt.
* crypto/workers/subtle/aes-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/aes-postMessage-worker.html.
* crypto/workers/subtle/gc-worker-expected.txt: Added.
* crypto/workers/subtle/gc-worker.html: Added.
* crypto/workers/subtle/hmac-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt.
* crypto/workers/subtle/hmac-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/hmac-postMessage-worker.html.
* crypto/workers/subtle/hrsa-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt.
* crypto/workers/subtle/hrsa-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/hrsa-postMessage-worker.html.
* crypto/workers/subtle/multiple-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt.
* crypto/workers/subtle/multiple-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/multiple-postMessage-worker.html.
* crypto/workers/subtle/resources/aes-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/aes-postMessage-worker.js.
* crypto/workers/subtle/resources/gc-worker.js: Added.
* crypto/workers/subtle/resources/hmac-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js.
* crypto/workers/subtle/resources/hrsa-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js.
* crypto/workers/subtle/resources/rsa-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js.
* crypto/workers/subtle/rsa-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt.
* crypto/workers/subtle/rsa-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/rsa-postMessage-worker.html.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator-wk1/TestExpectations:
* platform/win/TestExpectations:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscryptoresourcescommonjs">trunk/LayoutTests/crypto/resources/common.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIdigesttest_digestexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIidlharnessexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformeflTestExpectations">trunk/LayoutTests/platform/efl/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk1TestExpectations">trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcescpp">trunk/Source/WebCore/DerivedSources.cpp</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCorePlatformEflcmake">trunk/Source/WebCore/PlatformEfl.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformMaccmake">trunk/Source/WebCore/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecryptoCryptoKeyPairidl">trunk/Source/WebCore/crypto/CryptoKeyPair.idl</a></li>
<li><a href="#trunkSourceWebCorepageCryptocpp">trunk/Source/WebCore/page/Crypto.cpp</a></li>
<li><a href="#trunkSourceWebCorepageCryptoh">trunk/Source/WebCore/page/Crypto.h</a></li>
<li><a href="#trunkSourceWebCorepageCryptoidl">trunk/Source/WebCore/page/Crypto.idl</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscryptosubtlegc2expectedtxt">trunk/LayoutTests/crypto/subtle/gc-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegc2html">trunk/LayoutTests/crypto/subtle/gc-2.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegc3expectedtxt">trunk/LayoutTests/crypto/subtle/gc-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegc3html">trunk/LayoutTests/crypto/subtle/gc-3.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegcexpectedtxt">trunk/LayoutTests/crypto/subtle/gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegchtml">trunk/LayoutTests/crypto/subtle/gc.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbc192encryptdecryptexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbc192encryptdecrypthtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbc256encryptdecryptexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbc256encryptdecrypthtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcencryptdecryptexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcencryptdecryptwithpaddingexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcencryptdecryptwithpaddinghtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcencryptdecrypthtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcgeneratekeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcgeneratekeyhtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcimportjwkexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcimportjwkhtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcinvalidlengthexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcinvalidlengthhtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcunwrapfailureexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcunwrapfailurehtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcunwraprsaexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcunwraprsahtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcwraprsaexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcwraprsanonextractableexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcwraprsanonextractablehtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcwraprsahtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcwrongkeyclassexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcwrongkeyclasshtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaesexportkeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-export-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaesexportkeyhtml">trunk/LayoutTests/crypto/webkitSubtle/aes-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaeskwkeymanipulationexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaeskwkeymanipulationhtml">trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaeskwwrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaeskwwrapunwrapaeshtml">trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaespostMessageexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaespostMessagehtml">trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleargumentconversionexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/argument-conversion-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleargumentconversionhtml">trunk/LayoutTests/crypto/webkitSubtle/argument-conversion.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlearraybufferviewoffsetexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlearraybufferviewoffsethtml">trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgcexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgchtml">trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgcexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgchtml">trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmaccheckalgorithmexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmaccheckalgorithmhtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacexportkeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacexportkeyhtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacgeneratekeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacgeneratekeyhtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacimportjwkexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacimportjwkhtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacpostMessageexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacpostMessagehtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacsignverifyemptykeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacsignverifyemptykeyhtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacsignverifyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacsignverifyhtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleimportjwkexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleimportjwkhtml">trunk/LayoutTests/crypto/webkitSubtle/import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlejwkexportusevaluesexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlejwkexportusevalueshtml">trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlejwkimportusevaluesexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlejwkimportusevalueshtml">trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleresourcesrsaindexeddbnonexportablejs">trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleresourcesrsaindexeddbjs">trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb.js</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaexportgeneratedkeysexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaexportgeneratedkeyshtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaexportkeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaexportkeyhtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaexportprivatekeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaexportprivatekeyhtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportableexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportableprivateexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportableprivatehtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportablehtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbprivateexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbprivatehtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbhtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepgeneratenonextractablekeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepgeneratenonextractablekeyhtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepkeymanipulationexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepkeymanipulationhtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepplaintextlengthexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepplaintextlengthhtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepwrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepwrapunwrapaeshtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersapostMessageexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersapostMessagehtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5decryptexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5decrypthtml">trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5wrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5wrapunwrapaeshtml">trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponentexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtml">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeyhtml">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwkexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwksmallkeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwksmallkeyhtml">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwkhtml">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5signverifyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5signverifyhtml">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha1expectedtxt">trunk/LayoutTests/crypto/webkitSubtle/sha-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha1html">trunk/LayoutTests/crypto/webkitSubtle/sha-1.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha224expectedtxt">trunk/LayoutTests/crypto/webkitSubtle/sha-224-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha224html">trunk/LayoutTests/crypto/webkitSubtle/sha-224.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha256expectedtxt">trunk/LayoutTests/crypto/webkitSubtle/sha-256-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha256html">trunk/LayoutTests/crypto/webkitSubtle/sha-256.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha384expectedtxt">trunk/LayoutTests/crypto/webkitSubtle/sha-384-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha384html">trunk/LayoutTests/crypto/webkitSubtle/sha-384.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha512expectedtxt">trunk/LayoutTests/crypto/webkitSubtle/sha-512-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha512html">trunk/LayoutTests/crypto/webkitSubtle/sha-512.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleunimplementedunwrapcrashexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleunimplementedunwrapcrashhtml">trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleunwrapKeycheckusageexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleunwrapKeycheckusagehtml">trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlewrapKeycheckusageexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlewrapKeycheckusagehtml">trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage.html</a></li>
<li>trunk/LayoutTests/crypto/workers/subtle/</li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleaespostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleaespostMessageworkerhtml">trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlegcworkerexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/gc-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlegcworkerhtml">trunk/LayoutTests/crypto/workers/subtle/gc-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerhtml">trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlehrsapostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlehrsapostMessageworkerhtml">trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlemultiplepostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlemultiplepostMessageworkerhtml">trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker.html</a></li>
<li>trunk/LayoutTests/crypto/workers/subtle/resources/</li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourcesaespostMessageworkerjs">trunk/LayoutTests/crypto/workers/subtle/resources/aes-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourcesgcworkerjs">trunk/LayoutTests/crypto/workers/subtle/resources/gc-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourceshmacpostMessageworkerjs">trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourceshrsapostMessageworkerjs">trunk/LayoutTests/crypto/workers/subtle/resources/hrsa-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourcesrsapostMessageworkerjs">trunk/LayoutTests/crypto/workers/subtle/resources/rsa-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlersapostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlersapostMessageworkerhtml">trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker.html</a></li>
<li><a href="#trunkSourceWebCorecryptoSubtleCryptocpp">trunk/Source/WebCore/crypto/SubtleCrypto.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoSubtleCryptoh">trunk/Source/WebCore/crypto/SubtleCrypto.h</a></li>
<li><a href="#trunkSourceWebCorecryptoSubtleCryptoidl">trunk/Source/WebCore/crypto/SubtleCrypto.idl</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscryptosubtleaescbc192encryptdecryptexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbc192encryptdecrypthtml">trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbc256encryptdecryptexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbc256encryptdecrypthtml">trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcencryptdecryptexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddingexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddinghtml">trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcencryptdecrypthtml">trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcgeneratekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcgeneratekeyhtml">trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkhtml">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcinvalidlengthexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcinvalidlengthhtml">trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcunwrapfailureexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcunwrapfailurehtml">trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcunwraprsaexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcunwraprsahtml">trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcwraprsaexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcwraprsanonextractableexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt</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="#trunkLayoutTestscryptosubtleaescbcwrongkeyclassexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcwrongkeyclasshtml">trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaesexportkeyexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-export-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaesexportkeyhtml">trunk/LayoutTests/crypto/subtle/aes-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwkeymanipulationexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwkeymanipulationhtml">trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwwrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwwrapunwrapaeshtml">trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaespostMessageexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaespostMessagehtml">trunk/LayoutTests/crypto/subtle/aes-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleargumentconversionexpectedtxt">trunk/LayoutTests/crypto/subtle/argument-conversion-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleargumentconversionhtml">trunk/LayoutTests/crypto/subtle/argument-conversion.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlearraybufferviewoffsetexpectedtxt">trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlearraybufferviewoffsethtml">trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlecryptokeyalgorithmgcexpectedtxt">trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlecryptokeyalgorithmgchtml">trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlecryptokeyusagesgcexpectedtxt">trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlecryptokeyusagesgchtml">trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmaccheckalgorithmexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmaccheckalgorithmhtml">trunk/LayoutTests/crypto/subtle/hmac-check-algorithm.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacexportkeyexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-export-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacexportkeyhtml">trunk/LayoutTests/crypto/subtle/hmac-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacgeneratekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacgeneratekeyhtml">trunk/LayoutTests/crypto/subtle/hmac-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt</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="#trunkLayoutTestscryptosubtlehmacsignverifyemptykeyexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacsignverifyemptykeyhtml">trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacsignverifyexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacsignverifyhtml">trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleimportjwkexpectedtxt">trunk/LayoutTests/crypto/subtle/import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleimportjwkhtml">trunk/LayoutTests/crypto/subtle/import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlejwkexportusevaluesexpectedtxt">trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlejwkexportusevalueshtml">trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlejwkimportusevaluesexpectedtxt">trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlejwkimportusevalueshtml">trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html</a></li>
<li>trunk/LayoutTests/crypto/subtle/resources/</li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportgeneratedkeysexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportgeneratedkeyshtml">trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportkeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-export-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportkeyhtml">trunk/LayoutTests/crypto/subtle/rsa-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportprivatekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportprivatekeyhtml">trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbnonexportableexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivateexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt</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="#trunkLayoutTestscryptosubtlersaindexeddbprivateexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt</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="#trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyhtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepkeymanipulationexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepkeymanipulationhtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepplaintextlengthexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepplaintextlengthhtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepwrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepwrapunwrapaeshtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersapostMessageexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersapostMessagehtml">trunk/LayoutTests/crypto/subtle/rsa-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5decryptexpectedtxt">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5decrypthtml">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaeshtml">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponentexpectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt</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_5importjwkexpectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwksmallkeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt</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_5signverifyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyhtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha1expectedtxt">trunk/LayoutTests/crypto/subtle/sha-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha1html">trunk/LayoutTests/crypto/subtle/sha-1.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha224expectedtxt">trunk/LayoutTests/crypto/subtle/sha-224-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha224html">trunk/LayoutTests/crypto/subtle/sha-224.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha256expectedtxt">trunk/LayoutTests/crypto/subtle/sha-256-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha256html">trunk/LayoutTests/crypto/subtle/sha-256.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha384expectedtxt">trunk/LayoutTests/crypto/subtle/sha-384-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha384html">trunk/LayoutTests/crypto/subtle/sha-384.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha512expectedtxt">trunk/LayoutTests/crypto/subtle/sha-512-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha512html">trunk/LayoutTests/crypto/subtle/sha-512.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleunimplementedunwrapcrashexpectedtxt">trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleunimplementedunwrapcrashhtml">trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleunwrapKeycheckusageexpectedtxt">trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleunwrapKeycheckusagehtml">trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlewrapKeycheckusageexpectedtxt">trunk/LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlewrapKeycheckusagehtml">trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html</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>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/ChangeLog        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,3 +1,156 @@
</span><ins>+2016-10-06 Jiewen Tan <jiewen_tan@apple.com>
+
+ Add a dummy SubtleCrypto interface
+ https://bugs.webkit.org/show_bug.cgi?id=162992
+ <rdar://problem/28643573>
+
+ Reviewed by Brent Fulgham.
+
+ * crypto/resources/common.js:
+ * crypto/subtle/gc-2-expected.txt: Added.
+ * crypto/subtle/gc-2.html: Added.
+ * crypto/subtle/gc-3-expected.txt: Added.
+ * crypto/subtle/gc-3.html: Added.
+ * crypto/subtle/gc-expected.txt: Added.
+ * crypto/subtle/gc.html: Added.
+ * crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt.
+ * crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html.
+ * crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt.
+ * crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html.
+ * crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt.
+ * crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt.
+ * crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html.
+ * crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html.
+ * crypto/webkitSubtle/aes-cbc-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt.
+ * crypto/webkitSubtle/aes-cbc-generate-key.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-generate-key.html.
+ * crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt.
+ * crypto/webkitSubtle/aes-cbc-import-jwk.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-import-jwk.html.
+ * crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt.
+ * crypto/webkitSubtle/aes-cbc-invalid-length.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-invalid-length.html.
+ * crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt.
+ * crypto/webkitSubtle/aes-cbc-unwrap-failure.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html.
+ * crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt.
+ * crypto/webkitSubtle/aes-cbc-unwrap-rsa.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html.
+ * crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt.
+ * crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt.
+ * crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html.
+ * crypto/webkitSubtle/aes-cbc-wrap-rsa.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html.
+ * crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt.
+ * crypto/webkitSubtle/aes-cbc-wrong-key-class.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html.
+ * crypto/webkitSubtle/aes-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-export-key-expected.txt.
+ * crypto/webkitSubtle/aes-export-key.html: Renamed from LayoutTests/crypto/subtle/aes-export-key.html.
+ * crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt.
+ * crypto/webkitSubtle/aes-kw-key-manipulation.html: Renamed from LayoutTests/crypto/subtle/aes-kw-key-manipulation.html.
+ * crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt.
+ * crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html.
+ * crypto/webkitSubtle/aes-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-postMessage-expected.txt.
+ * crypto/webkitSubtle/aes-postMessage.html: Renamed from LayoutTests/crypto/subtle/aes-postMessage.html.
+ * crypto/webkitSubtle/argument-conversion-expected.txt: Renamed from LayoutTests/crypto/subtle/argument-conversion-expected.txt.
+ * crypto/webkitSubtle/argument-conversion.html: Renamed from LayoutTests/crypto/subtle/argument-conversion.html.
+ * crypto/webkitSubtle/array-buffer-view-offset-expected.txt: Renamed from LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt.
+ * crypto/webkitSubtle/array-buffer-view-offset.html: Renamed from LayoutTests/crypto/subtle/array-buffer-view-offset.html.
+ * crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt: Renamed from LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt.
+ * crypto/webkitSubtle/crypto-key-algorithm-gc.html: Renamed from LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html.
+ * crypto/webkitSubtle/crypto-key-usages-gc-expected.txt: Renamed from LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt.
+ * crypto/webkitSubtle/crypto-key-usages-gc.html: Renamed from LayoutTests/crypto/subtle/crypto-key-usages-gc.html.
+ * crypto/webkitSubtle/hmac-check-algorithm-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt.
+ * crypto/webkitSubtle/hmac-check-algorithm.html: Renamed from LayoutTests/crypto/subtle/hmac-check-algorithm.html.
+ * crypto/webkitSubtle/hmac-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-export-key-expected.txt.
+ * crypto/webkitSubtle/hmac-export-key.html: Renamed from LayoutTests/crypto/subtle/hmac-export-key.html.
+ * crypto/webkitSubtle/hmac-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-export-key.html.
+ * crypto/webkitSubtle/hmac-generate-key.html: Renamed from LayoutTests/crypto/subtle/hmac-generate-key.html.
+ * crypto/webkitSubtle/hmac-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt.
+ * crypto/webkitSubtle/hmac-import-jwk.html: Renamed from LayoutTests/crypto/subtle/hmac-import-jwk.html.
+ * crypto/webkitSubtle/hmac-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-postMessage-expected.txt.
+ * crypto/webkitSubtle/hmac-postMessage.html: Renamed from LayoutTests/crypto/subtle/hmac-postMessage.html.
+ * crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt.
+ * crypto/webkitSubtle/hmac-sign-verify-empty-key.html: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html.
+ * crypto/webkitSubtle/hmac-sign-verify-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt.
+ * crypto/webkitSubtle/hmac-sign-verify.html: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify.html.
+ * crypto/webkitSubtle/import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/import-jwk-expected.txt.
+ * crypto/webkitSubtle/import-jwk.html: Renamed from LayoutTests/crypto/subtle/import-jwk-expected.html.
+ * crypto/webkitSubtle/jwk-export-use-values-expected.txt: Renamed from LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt.
+ * crypto/webkitSubtle/jwk-export-use-values.html: Renamed from LayoutTests/crypto/subtle/jwk-export-use-values.html.
+ * crypto/webkitSubtle/jwk-import-use-values-expected.txt: Renamed from LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt.
+ * crypto/webkitSubtle/jwk-import-use-values.html: Renamed from LayoutTests/crypto/subtle/jwk-import-use-values.html.
+ * crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js: Renamed from LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js.
+ * crypto/webkitSubtle/resources/rsa-indexeddb.js: Renamed from LayoutTests/crypto/subtle/resources/rsa-indexeddb.js.
+ * crypto/webkitSubtle/rsa-export-generated-keys-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt.
+ * crypto/webkitSubtle/rsa-export-generated-keys.html: Renamed from LayoutTests/crypto/subtle/rsa-export-generated-keys.html.
+ * crypto/webkitSubtle/rsa-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-key-expected.txt.
+ * crypto/webkitSubtle/rsa-export-key.html: Renamed from LayoutTests/crypto/subtle/rsa-export-key.html.
+ * crypto/webkitSubtle/rsa-export-private-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt.
+ * crypto/webkitSubtle/rsa-export-private-key.html: Renamed from LayoutTests/crypto/subtle/rsa-export-private-key.html.
+ * crypto/webkitSubtle/rsa-indexeddb-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt.
+ * crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt.
+ * crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt.
+ * crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html.
+ * crypto/webkitSubtle/rsa-indexeddb-non-exportable.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html.
+ * crypto/webkitSubtle/rsa-indexeddb-private-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt.
+ * crypto/webkitSubtle/rsa-indexeddb-private.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-private.html.
+ * crypto/webkitSubtle/rsa-indexeddb.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb.html.
+ * crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt.
+ * crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html.
+ * crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt.
+ * crypto/webkitSubtle/rsa-oaep-key-manipulation.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html.
+ * crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt.
+ * crypto/webkitSubtle/rsa-oaep-plaintext-length.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html.
+ * crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt.
+ * crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html.
+ * crypto/webkitSubtle/rsa-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-postMessage-expected.txt.
+ * crypto/webkitSubtle/rsa-postMessage.html: Renamed from LayoutTests/crypto/subtle/rsa-postMessage.html.
+ * crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt.
+ * crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html.
+ * crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt.
+ * crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt: Added.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt.
+ * crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html.
+ * crypto/webkitSubtle/sha-1-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-1-expected.txt.
+ * crypto/webkitSubtle/sha-1.html: Renamed from LayoutTests/crypto/subtle/sha-1.html.
+ * crypto/webkitSubtle/sha-224-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-224-expected.txt.
+ * crypto/webkitSubtle/sha-224.html: Renamed from LayoutTests/crypto/subtle/sha-224.html.
+ * crypto/webkitSubtle/sha-256-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-256-expected.txt.
+ * crypto/webkitSubtle/sha-256.html: Renamed from LayoutTests/crypto/subtle/sha-256.html.
+ * crypto/webkitSubtle/sha-384-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-384-expected.txt.
+ * crypto/webkitSubtle/sha-384.html: Renamed from LayoutTests/crypto/subtle/sha-384.html.
+ * crypto/webkitSubtle/sha-512-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-512-expected.txt.
+ * crypto/webkitSubtle/sha-512.html: Renamed from LayoutTests/crypto/subtle/sha-512.html.
+ * crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt: Renamed from LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt.
+ * crypto/webkitSubtle/unimplemented-unwrap-crash.html: Renamed from LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html.
+ * crypto/webkitSubtle/unwrapKey-check-usage-expected.txt: Renamed from LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt.
+ * crypto/webkitSubtle/unwrapKey-check-usage.html: Renamed from LayoutTests/crypto/subtle/unwrapKey-check-usage.html.
+ * crypto/webkitSubtle/wrapKey-check-usage-expected.txt: Renamed from LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt.
+ * crypto/webkitSubtle/wrapKey-check-usage.html: Renamed from LayoutTests/crypto/subtle/wrapKey-check-usage.html.
+ * crypto/workers/subtle/aes-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt.
+ * crypto/workers/subtle/aes-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/aes-postMessage-worker.html.
+ * crypto/workers/subtle/gc-worker-expected.txt: Added.
+ * crypto/workers/subtle/gc-worker.html: Added.
+ * crypto/workers/subtle/hmac-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt.
+ * crypto/workers/subtle/hmac-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/hmac-postMessage-worker.html.
+ * crypto/workers/subtle/hrsa-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt.
+ * crypto/workers/subtle/hrsa-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/hrsa-postMessage-worker.html.
+ * crypto/workers/subtle/multiple-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt.
+ * crypto/workers/subtle/multiple-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/multiple-postMessage-worker.html.
+ * crypto/workers/subtle/resources/aes-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/aes-postMessage-worker.js.
+ * crypto/workers/subtle/resources/gc-worker.js: Added.
+ * crypto/workers/subtle/resources/hmac-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js.
+ * crypto/workers/subtle/resources/hrsa-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js.
+ * crypto/workers/subtle/resources/rsa-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js.
+ * crypto/workers/subtle/rsa-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt.
+ * crypto/workers/subtle/rsa-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/rsa-postMessage-worker.html.
+ * platform/efl/TestExpectations:
+ * platform/gtk/TestExpectations:
+ * platform/ios-simulator-wk1/TestExpectations:
+ * platform/win/TestExpectations:
+
</ins><span class="cx"> 2016-10-06 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><span class="cx"> Mutating styleSheet in shadow tree doesn't update the style
</span></span></pre></div>
<a id="trunkLayoutTestscryptoresourcescommonjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/resources/common.js (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/resources/common.js        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/resources/common.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -80,6 +80,3 @@
</span><span class="cx"> return new Uint8Array(Array.prototype.map.call(atob(s), function (c) { return c.charCodeAt(0) }));
</span><span class="cx"> }
</span><span class="cx"> };
</span><del>-
-if (!(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) && !crypto.subtle)
- crypto.subtle = crypto.webkitSubtle;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc192encryptdecryptexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-Test AES-CBC encrypt and decrypt functions with a 256 bit key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw AES key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 192
-PASS key.usages is ['decrypt', 'encrypt']
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'
-Decrypting it back...
-PASS new Uint8Array(decryptionResult) is plaintext
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc192encryptdecrypthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,48 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test AES-CBC encrypt and decrypt functions with a 256 bit key.");
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array("8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b");
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
-var extractable = true;
-
-debug("Importing a raw AES key from string literal...");
-crypto.subtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "192");
- shouldBe("key.usages", "['decrypt', 'encrypt']");
-
- debug("Using the key to encrypt plaintext...");
- return crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
-}).then(function(result) {
- encryptionResult = result;
- shouldBe("bytesToHexString(new Uint8Array(encryptionResult))", "'4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'");
-
- debug("Decrypting it back...");
- return crypto.subtle.decrypt({name: "aes-cbc", iv: iv}, key, result);
-}).then(function(result) {
- decryptionResult = result;
- shouldBe("new Uint8Array(decryptionResult)", "plaintext");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc256encryptdecryptexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-Test AES-CBC encrypt and decrypt functions with a 256 bit key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw AES key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 256
-PASS key.usages is ['decrypt', 'encrypt']
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(encryptionResult)) is 'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644'
-Decrypting it back...
-PASS new Uint8Array(decryptionResult) is plaintext
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc256encryptdecrypthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,48 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test AES-CBC encrypt and decrypt functions with a 256 bit key.");
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
-var extractable = true;
-
-debug("Importing a raw AES key from string literal...");
-crypto.subtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "256");
- shouldBe("key.usages", "['decrypt', 'encrypt']");
-
- debug("Using the key to encrypt plaintext...");
- return crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
-}).then(function(result) {
- encryptionResult = result;
- shouldBe("bytesToHexString(new Uint8Array(encryptionResult))", "'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644'");
-
- debug("Decrypting it back...");
- return crypto.subtle.decrypt({name: "aes-cbc", iv: iv}, key, result);
-}).then(function(result) {
- decryptionResult = result;
- shouldBe("new Uint8Array(decryptionResult)", "plaintext");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecryptexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,24 +0,0 @@
</span><del>-Test AES-CBC encrypt and decrypt functions.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw AES key from string literal...
-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']
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(encryptionResult)) is '7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012'
-Decrypting it back...
-PASS new Uint8Array(decryptionResult) is plaintext
-Testing initialization vector bindings...
-PASS crypto.subtle.encrypt({name: 'AES-CBC', iv: null}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.subtle.encrypt({name: 'AES-CBC'}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.subtle.encrypt({name: 'AES-CBC', iv: 3}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.subtle.encrypt({name: 'AES-CBC', iv: new Uint8Array([0])}, key, plaintext) threw exception Error: AES-CBC initialization data must be 16 bytes.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddingexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-Test AES-CBC encrypt and decrypt functions on a plaintext that is not a multiple of block size in length.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw AES key from string literal...
-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']
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(cyphertext)) is '630199c5f202cc7167bb84c6c72b349d'
-Decrypting it back...
-PASS new Uint8Array(decryptionResult) is plaintext
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddinghtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test AES-CBC encrypt and decrypt functions on a plaintext that is not a multiple of block size in length.");
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array("2b7e151628aed2a6abf7158809cf4f3c");
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = asciiToUint8Array("test");
-var extractable = true;
-
-debug("Importing a raw AES key from string literal...");
-crypto.subtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "128");
- shouldBe("key.usages", "['decrypt', 'encrypt']");
-
- debug("Using the key to encrypt plaintext...");
- return crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
-}).then(function(result) {
- cyphertext = result;
- shouldBe("bytesToHexString(new Uint8Array(cyphertext))", "'630199c5f202cc7167bb84c6c72b349d'");
-
- debug("Decrypting it back...");
- return crypto.subtle.decrypt({name: "aes-cbc", iv: iv}, key, result);
-}).then(function(result) {
- decryptionResult = result;
- shouldBe("new Uint8Array(decryptionResult)", "plaintext");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecrypthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,54 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test AES-CBC encrypt and decrypt functions.");
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array("2b7e151628aed2a6abf7158809cf4f3c");
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
-var extractable = true;
-
-debug("Importing a raw AES key from string literal...");
-crypto.subtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "128");
- shouldBe("key.usages", "['decrypt', 'encrypt']");
-
- debug("Using the key to encrypt plaintext...");
- return crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
-}).then(function(result) {
- encryptionResult = result;
- shouldBe("bytesToHexString(new Uint8Array(encryptionResult))", "'7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012'");
-
- debug("Decrypting it back...");
- return crypto.subtle.decrypt({name: "aes-cbc", iv: iv}, key, result);
-}).then(function(result) {
- decryptionResult = result;
- shouldBe("new Uint8Array(decryptionResult)", "plaintext");
-
- debug("Testing initialization vector bindings...");
- shouldThrow("crypto.subtle.encrypt({name: 'AES-CBC', iv: null}, key, plaintext)");
- shouldThrow("crypto.subtle.encrypt({name: 'AES-CBC'}, key, plaintext)");
- shouldThrow("crypto.subtle.encrypt({name: 'AES-CBC', iv: 3}, key, plaintext)");
- shouldThrow("crypto.subtle.encrypt({name: 'AES-CBC', iv: new Uint8Array([0])}, key, plaintext)");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcgeneratekeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-Test generating an AES key using AES-CBC algorithm.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS crypto.subtle.generateKey("aes-cbc", extractable, ["encrypt", "decrypt"]) threw exception TypeError: Type error.
-PASS crypto.subtle.generateKey({name: "aes-cbc"}, extractable, ["encrypt", "decrypt"]) threw exception TypeError: Value NaN is outside the range [0, 65535].
-PASS crypto.subtle.generateKey({name: "aes-cbc", length: undefined}, extractable, ["encrypt", "decrypt"]) threw exception TypeError: Value NaN is outside the range [0, 65535].
-PASS crypto.subtle.generateKey({name: "aes-cbc", length: {}}, extractable, ["encrypt", "decrypt"]) threw exception TypeError: Value NaN is outside the range [0, 65535].
-Generating a key...
-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
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcgeneratekeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,39 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test generating an AES key using AES-CBC algorithm.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-shouldThrow('crypto.subtle.generateKey("aes-cbc", extractable, ["encrypt", "decrypt"])');
-shouldThrow('crypto.subtle.generateKey({name: "aes-cbc"}, extractable, ["encrypt", "decrypt"])');
-shouldThrow('crypto.subtle.generateKey({name: "aes-cbc", length: undefined}, extractable, ["encrypt", "decrypt"])');
-shouldThrow('crypto.subtle.generateKey({name: "aes-cbc", length: {}}, extractable, ["encrypt", "decrypt"])');
-
-debug("Generating a key...");
-crypto.subtle.generateKey({name: "aes-cbc", length: 128}, extractable, ["encrypt", "decrypt"]).then(function(result) {
- key = result;
-
- 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();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-Test importing a JWK key for AES-CBC.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a key...
-
-PASS key.type is 'secret'
-PASS key.extractable is false
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 192
-PASS key.usages is ["encrypt"]
-
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,52 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test importing a JWK key for AES-CBC.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
-
-var jwkKey = {
- "kty": "oct",
- "alg": "A192CBC",
- "use": "enc",
- "ext": true,
- "k": "jnOw99oOZFLIEPMrgJB55WL46tJSLGt7"
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
-
-debug("Importing a key...\n");
-crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, null, false, ["encrypt"]).then(function(result) {
- key = result;
-
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "false");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "192");
- shouldBe("key.usages", '["encrypt"]');
-
- debug("\nUsing the key to encrypt plaintext...");
- return crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
-}).then(function(result) {
- encryptionResult = result;
- shouldBe("bytesToHexString(new Uint8Array(encryptionResult))", "'4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcinvalidlengthexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,17 +0,0 @@
</span><del>-Test an unsupported AES key length.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw AES key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 176
-PASS key.usages is ['decrypt', 'encrypt']
-Using the key to encrypt plaintext...
-Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcinvalidlengthhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test an unsupported AES key length.");
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array("8e73b0f7da0e6452c810f32b809079e562f8ead2522c");
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
-var extractable = true;
-
-debug("Importing a raw AES key from string literal...");
-crypto.subtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'AES-CBC'");
- shouldBe("key.algorithm.length", "176");
- shouldBe("key.usages", "['decrypt', 'encrypt']");
-
- debug("Using the key to encrypt plaintext...");
- return crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, key, [plaintext]);
-}).then(undefined, function(result) {
- debug("Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail.");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcunwrapfailureexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-Test unwrapping an RSA key with AES-CBC.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing an unwrapping key...
-PASS unwrappingKey.algorithm.name is 'AES-CBC'
-Unwrapping a key...
-PASS Promise rejected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcunwrapfailurehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,38 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test unwrapping an RSA key with AES-CBC.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var unwrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
-var wrappedKey = hexStringToUint8Array("b490dedb3abc3fd545e146538e6cc3ca"); // An empty encrypted JSON.
-
-debug("Importing an unwrapping key...");
-crypto.subtle.importKey("raw", unwrappingKeyOctets, "AES-CBC", nonExtractable, ["unwrapKey"]).then(function(result) {
- unwrappingKey = result;
- shouldBe("unwrappingKey.algorithm.name", "'AES-CBC'");
- var unwrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
- debug("Unwrapping a key...");
- return crypto.subtle.unwrapKey("jwk", wrappedKey, unwrappingKey, unwrapAlgorithm, null, extractable, ["sign", "verify", "encrypt", "decrypt", "wrap", "unwrap"]);
-}).then(undefined, function(result) {
- testPassed("Promise rejected");
- finishJSTest();
-});
-
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcunwraprsaexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,20 +0,0 @@
</span><del>-Test unwrapping an RSA key with AES-CBC.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing an unwrapping key...
-PASS unwrappingKey.algorithm.name is 'AES-CBC'
-Unwrapping a key...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'public'
-PASS unwrappedKey.usages is ['sign','verify']
-PASS unwrappedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS unwrappedKey.algorithm.modulusLength is 2048
-PASS Base64URL.stringify(unwrappedKey.algorithm.publicExponent) is publicKeyJSON.e
-PASS unwrappedKey.algorithm.hash.name is 'SHA-256'
-PASS unwrappedKey.extractable is false
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcunwraprsahtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,56 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test unwrapping an RSA key with AES-CBC.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- ext: false,
- use: "sig"
-};
-
-var unwrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
-var wrappedKey = hexStringToUint8Array("3511f6028db04ea97e7cfad3c4cc60837bceff25cb6c88292fbcb4547570afdc32e4003fe4d65f1e7df60dc1fdb3df36c3f58ab228e33aa31005852d46d0c2ad1318435a071bbb5bbb05650ea63d551698b0c040dd95ed0d379b5e2eccb545ae5620acb8051174cd2ad647328ad99dcd462fec40748724eb1e68f209f779faa2c35b4d4d1b6604a74e62a1846249ea6192954a5af10c71ebfea79948142441ed307e9f52e797a51a8007a6f87b57c51f9e7eef54b7e4a1f818ba6ac25ee5935c23b3253d6d9d222262c79ccdb7147d9c07527c22fe7a4ab91af20479edf5930b3c053c0a0b27092cfb53203633d01dcf6e333b5be7c1933c321c953f962b934ebefd9df8cca6c0a25fcd5fb96105435c42d9902406f82bc8daa8ec12fa85d9afa65adbfe3f60828ef64adaf43ad8e3b0af104cbfafd994323732bba08f84d5cac1d157b276233dffecafe47942b83c85ead6d5886c6badf534d4a32d3f545e8032dd5e419d7bff3acde2c37a96fc34fda8747d89500bf9f7ef45873c6b3b2741aaf74ff96a2f950028f38eb62f1be936fe0a994ebfa928021c0c96172d84584e");
-
-debug("Importing an unwrapping key...");
-crypto.subtle.importKey("raw", unwrappingKeyOctets, "AES-CBC", nonExtractable, ["unwrapKey"]).then(function(result) {
- unwrappingKey = result;
- shouldBe("unwrappingKey.algorithm.name", "'AES-CBC'");
- var unwrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
- debug("Unwrapping a key...");
- return crypto.subtle.unwrapKey("jwk", wrappedKey, unwrappingKey, unwrapAlgorithm, null, extractable, ["sign", "verify", "encrypt", "decrypt", "wrap", "unwrap"]);
-}).then(function(result) {
- unwrappedKey = result;
-
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'public'");
- shouldBe("unwrappedKey.usages", "['sign','verify']");
- shouldBe("unwrappedKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("unwrappedKey.algorithm.modulusLength", "2048");
- shouldBe("Base64URL.stringify(unwrappedKey.algorithm.publicExponent)", "publicKeyJSON.e");
- shouldBe("unwrappedKey.algorithm.hash.name", "'SHA-256'");
- shouldBe("unwrappedKey.extractable", "false");
- finishJSTest();
-});
-
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwraprsaexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-Test wrapping an RSA key with AES-CBC.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a key to wrap...
-PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
-Importing a key encryption key...
-PASS wrappingKey.algorithm.name is 'AES-CBC'
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwraprsanonextractableexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test wrapping an RSA key with AES-CBC.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a key to wrap...
-PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
-Importing a key encryption key...
-PASS wrappingKey.algorithm.name is 'AES-CBC'
-wrapping the key...
-PASS Rejected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwraprsanonextractablehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,52 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test wrapping an RSA key with AES-CBC.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- ext: false,
- use: "sig"
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
-var wrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
-
-debug("Importing a key to wrap...");
-crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, null, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
- shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- debug("Importing a key encryption key...");
- return crypto.subtle.importKey("raw", wrappingKeyOctets, "AES-CBC", nonExtractable, ["wrapKey"]);
-}).then(function(result) {
- wrappingKey = result;
- shouldBe("wrappingKey.algorithm.name", "'AES-CBC'");
- var wrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
- debug("wrapping the key...");
- return crypto.subtle.wrapKey("jwk", key, wrappingKey, wrapAlgorithm);
-}).then(undefined, function() {
- testPassed("Rejected");
- finishJSTest();
-});
-
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwraprsahtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,52 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test wrapping an RSA key with AES-CBC.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB",
- ext: true,
- use: "sig"
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
-var wrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
-
-debug("Importing a key to wrap...");
-crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, null, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
- shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- debug("Importing a key encryption key...");
- return crypto.subtle.importKey("raw", wrappingKeyOctets, "AES-CBC", nonExtractable, ["wrapKey"]);
-}).then(function(result) {
- wrappingKey = result;
- shouldBe("wrappingKey.algorithm.name", "'AES-CBC'");
- var wrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
- return crypto.subtle.wrapKey("jwk", key, wrappingKey, wrapAlgorithm);
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
- finishJSTest();
-});
-
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwrongkeyclassexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,12 +0,0 @@
</span><del>-Test calling AES-CBC encrypt with a HMAC key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw HMAC key from string literal...
-Using the key to encrypt plaintext...
-PASS crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwrongkeyclasshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,33 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test calling AES-CBC encrypt with a HMAC key.");
-
-jsTestIsAsync = true;
-
-var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
-var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
-var hmacKey = asciiToUint8Array('a');
-var extractable = true;
-
-debug("Importing a raw HMAC key from string literal...");
-crypto.subtle.importKey("raw", hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, ["sign", "verify", "encrypt", "decrypt"]).then(function(result) {
- key = result;
- debug("Using the key to encrypt plaintext...");
- shouldThrow('crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext)')
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaesexportkeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-export-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-export-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-export-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,38 +0,0 @@
</span><del>-Test exporting an AES key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS crypto.subtle.exportKey("raw") threw exception TypeError: Not enough arguments.
-PASS crypto.subtle.exportKey("raw", null) threw exception TypeError: Type error.
-PASS crypto.subtle.exportKey("raw", undefined) threw exception TypeError: Type error.
-PASS crypto.subtle.exportKey("raw", {}) threw exception TypeError: Type error.
-PASS crypto.subtle.exportKey("raw", 1) threw exception TypeError: Type error.
-
-Importing a JWK key...
-PASS crypto.subtle.exportKey(null, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey({}, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey("", key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
-
-Exporting the key as raw data...
-PASS bytesToHexString(new Uint8Array(exportedData)) is '8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'
-Exporting the key as JWK...
-PASS exportedJWK.kty is 'oct'
-PASS exportedJWK.k is 'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7'
-PASS exportedJWK.alg is 'A192CBC'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
-
-Importing a key that's not extractable...
-
-Trying to export as raw...
-PASS Rejected, as expected
-Trying to export as jwk...
-PASS Rejected, as expected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaesexportkeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-export-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-export-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-export-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,86 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test exporting an AES key.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var jwkKey = {
- kty: "oct",
- k: "jnOw99oOZFLIEPMrgJB55WL46tJSLGt7"
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
-
-shouldThrow('crypto.subtle.exportKey("raw")');
-shouldThrow('crypto.subtle.exportKey("raw", null)');
-shouldThrow('crypto.subtle.exportKey("raw", undefined)');
-shouldThrow('crypto.subtle.exportKey("raw", {})');
-shouldThrow('crypto.subtle.exportKey("raw", 1)');
-
-debug("\nImporting a JWK key...");
-crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, "AES-CBC", extractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']).then(function(result) {
- key = result;
-
- shouldThrow('crypto.subtle.exportKey(null, key)');
- shouldThrow('crypto.subtle.exportKey(undefined, key)');
- shouldThrow('crypto.subtle.exportKey({}, key)');
- shouldThrow('crypto.subtle.exportKey("", key)');
- shouldThrow('crypto.subtle.exportKey("foobar", key)');
-
- debug("\nExporting the key as raw data...");
- return crypto.subtle.exportKey("raw", key);
-}).then(function(result) {
- exportedData = result;
- shouldBe("bytesToHexString(new Uint8Array(exportedData))", "'8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'");
-
- debug("Exporting the key as JWK...");
- return crypto.subtle.exportKey("jwk", key);
-}).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
- shouldBe("exportedJWK.kty", "'oct'");
- shouldBe("exportedJWK.k", "'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7'");
- shouldBe("exportedJWK.alg", "'A192CBC'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.key_ops", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
-
- debug("\nImporting a key that's not extractable...");
- return crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, "AES-CBC", nonExtractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'])
-}).then(function(result) {
- key = result;
-
- debug("\nTrying to export as raw...");
- return crypto.subtle.exportKey("raw", key);
-}).then(function(result) {
- testFailed("Promise wasn't rejected");
- finishJSTest();
-}, function() {
- testPassed("Rejected, as expected");
-
- debug("Trying to export as jwk...");
- return crypto.subtle.exportKey("jwk", key);
-}).then(function(result) {
- testFailed("Promise wasn't rejected");
- finishJSTest();
-}, function() {
- testPassed("Rejected, as expected");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwkeymanipulationexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,25 +0,0 @@
</span><del>-Test generating, importing and exporting keys for AES-KW. Test that they can't be used with another algorithm.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Generating a key...
-PASS key.toString() is '[object CryptoKey]'
-PASS key.type is 'secret'
-PASS key.algorithm.name is 'AES-KW'
-PASS key.algorithm.length is 256
-
-Testing that the key can't be used with AES-CBC...
-PASS crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, key, hexStringToUint8Array("00")) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-
-Exporting the key to raw...
-PASS exportedKey.toString() is '[object ArrayBuffer]'
-Importing it back...
-PASS importedKey.toString() is '[object CryptoKey]'
-PASS importedKey.type is 'secret'
-PASS importedKey.algorithm.name is 'AES-KW'
-PASS importedKey.algorithm.length is 256
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwkeymanipulationhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,51 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test generating, importing and exporting keys for AES-KW. Test that they can't be used with another algorithm.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-debug("Generating a key...");
-crypto.subtle.generateKey({name: "aes-kw", length: 256}, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(result) {
- key = result;
- shouldBe("key.toString()", "'[object CryptoKey]'");
- shouldBe("key.type", "'secret'");
- shouldBe("key.algorithm.name", "'AES-KW'");
- shouldBe("key.algorithm.length", "256");
-
- debug("\nTesting that the key can't be used with AES-CBC...");
- iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
- shouldThrow('crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, key, hexStringToUint8Array("00"))');
-
- debug("\nExporting the key to raw...");
- return crypto.subtle.exportKey('raw', key);
-}).then(function(result) {
- exportedKey = result;
- shouldBe("exportedKey.toString()", "'[object ArrayBuffer]'");
- debug("Importing it back...");
- return crypto.subtle.importKey('raw', exportedKey, "aes-kw", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
-}).then(function(result) {
- importedKey = result;
-
- shouldBe("importedKey.toString()", "'[object CryptoKey]'");
- shouldBe("importedKey.type", "'secret'");
- shouldBe("importedKey.algorithm.name", "'AES-KW'");
- shouldBe("importedKey.algorithm.length", "256");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwwrapunwrapaesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,22 +0,0 @@
</span><del>-Test wrapping and unwrapping keys with AES-KW.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing key encryption key...
-Importing a key to be wrapped...
-Wrapping it...
-PASS bytesToHexString(wrappedKey) is '1fa68b0a8112b447aef34bd8fb5a7b829d3e862371d2cfe5'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 128
-PASS unwrappedKey.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(keyData)
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwwrapunwrapaeshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,58 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test wrapping and unwrapping keys with AES-KW.");
-
-jsTestIsAsync = true;
-
-var kekData = hexStringToUint8Array("000102030405060708090A0B0C0D0E0F");
-var keyData = hexStringToUint8Array("00112233445566778899AABBCCDDEEFF");
-var extractable = true;
-
-debug("Importing key encryption key...");
-crypto.subtle.importKey("raw", kekData, "aes-kw", extractable, ["wrapKey", "unwrapKey"]).then(function(result) {
- kek = result;
-
- debug("Importing a key to be wrapped...");
- return crypto.subtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
-}).then(function(result) {
- key = result;
-
- debug("Wrapping it...");
- return crypto.subtle.wrapKey("raw", key, kek, "aes-kw");
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("bytesToHexString(wrappedKey)", "'1fa68b0a8112b447aef34bd8fb5a7b829d3e862371d2cfe5'"); // Result from RFC 3394.
-
- debug("Unwrapping it...");
- return crypto.subtle.unwrapKey("raw", wrappedKey, kek, "aes-kw", "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
-}).then(function(result) {
- unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'secret'");
- shouldBe("unwrappedKey.extractable", "true");
- shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
- shouldBe("unwrappedKey.algorithm.length", "128");
- shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']");
-
- debug("Exporting it...");
- return crypto.subtle.exportKey("raw", unwrappedKey);
-}).then(function(result) {
- unwrappedKeyData = result;
- shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(keyData)");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaespostMessageexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-Test sending crypto keys via postMessage.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-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
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaespostMessagehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-postMessage.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-postMessage.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-postMessage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,32 +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.");
-
-jsTestIsAsync = true;
-
-window.addEventListener("message", function(evt) {
- key = evt.data;
- 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();
-}, false);
-
-crypto.subtle.importKey("raw", asciiToUint8Array("16 bytes of key!"), {name: "aes-cbc", length: 128}, true, ["encrypt", "decrypt"]).then(function(key) {
- postMessage(key, "*");
-});
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleargumentconversionexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/argument-conversion-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/argument-conversion-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/argument-conversion-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,38 +0,0 @@
</span><del>-Test crypto.subtle argument conversion
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Passing algorithm name as a string object...
-PASS ...succeeded
-
-Passing algorithm name as a string object in a dictionary...
-PASS ...succeeded
-
-Passing algorithm name as an object with toString
-PASS ...succeeded
-
-Passing invalid data to digest()
-PASS crypto.subtle.digest({name: 'sha-1'}) threw exception TypeError: Not enough arguments.
-PASS crypto.subtle.digest({name: 'sha-1'}, null) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.subtle.digest({name: 'sha-1'}, 10) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.subtle.digest({name: 'sha-1'}, [10]) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.subtle.digest({name: 'sha-1'}, [new Uint8Array([0])]) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-
-Passing invalid algorithmIdentifiers to digest()
-PASS crypto.subtle.digest({ toString:function() { return 'sha-1' } }, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest({name: ''}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest({name: null}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest({name: undefined}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest({name: 'sha'}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest({name: 1}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest('', data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest(null, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest(undefined, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest(1, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest({}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleargumentconversionhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/argument-conversion.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/argument-conversion.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/argument-conversion.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,56 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test crypto.subtle argument conversion");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- debug("\nPassing algorithm name as a string object...");
- return crypto.subtle.digest(new String('sha-1'), new Uint8Array([]));
-}).then(function(result) {
- testPassed("...succeeded");
- debug("\nPassing algorithm name as a string object in a dictionary...");
- return crypto.subtle.digest({name: new String('sha-1')}, new Uint8Array([]));
-}).then(function(result) {
- testPassed("...succeeded");
- debug("\nPassing algorithm name as an object with toString");
- return crypto.subtle.digest({name: { toString:function() { return 'sha-1' } } }, new Uint8Array([]));
-}).then(function(result) {
- testPassed("...succeeded");
-
- debug("\nPassing invalid data to digest()");
- shouldThrow("crypto.subtle.digest({name: 'sha-1'})");
- shouldThrow("crypto.subtle.digest({name: 'sha-1'}, null)");
- shouldThrow("crypto.subtle.digest({name: 'sha-1'}, 10)");
- shouldThrow("crypto.subtle.digest({name: 'sha-1'}, [10])");
- shouldThrow("crypto.subtle.digest({name: 'sha-1'}, [new Uint8Array([0])])");
-
- debug("\nPassing invalid algorithmIdentifiers to digest()");
- data = new Uint8Array([0]);
- shouldThrow("crypto.subtle.digest({ toString:function() { return 'sha-1' } }, data)"); // Algorithm normalization doesn't attempt to call toString.
- shouldThrow("crypto.subtle.digest({name: ''}, data)");
- shouldThrow("crypto.subtle.digest({name: null}, data)");
- shouldThrow("crypto.subtle.digest({name: undefined}, data)");
- shouldThrow("crypto.subtle.digest({name: 'sha'}, data)");
- shouldThrow("crypto.subtle.digest({name: 1}, data)");
- shouldThrow("crypto.subtle.digest('', data)");
- shouldThrow("crypto.subtle.digest(null, data)");
- shouldThrow("crypto.subtle.digest(undefined, data)");
- shouldThrow("crypto.subtle.digest(1, data)");
- shouldThrow("crypto.subtle.digest({}, data)");
-}).then(finishJSTest);
-
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlearraybufferviewoffsetexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,10 +0,0 @@
</span><del>-Test that an ArrayBufferView with offset is processed correctly.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS bytesToHexString(new Uint8Array(digest)) is '2c7e7c384f7829694282b1e3a6216def8082d055'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlearraybufferviewoffsethtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,30 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test that an ArrayBufferView with offset is processed correctly.");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- var originalData = new Uint8Array([0xf, 0xf, 0xf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0xf, 0xf, 0xf]);
- var slicedData = new Uint8Array(originalData.buffer, 3, 11);
- return crypto.subtle.digest({name: 'sha-1'}, slicedData);
-}).then(function(result) {
- digest = result;
- // Expected result for [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'2c7e7c384f7829694282b1e3a6216def8082d055'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlecryptokeyalgorithmgcexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-Test that CryptoKey.algorithm preserves custom properties.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Generating a HMAC key with default length...
-PASS key.algorithm === key.algorithm is true
-PASS key.algorithm.foo is "bar"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlecryptokeyalgorithmgchtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,44 +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 that CryptoKey.algorithm preserves custom properties.");
-jsTestIsAsync = true;
-
-debug("\nGenerating a HMAC key with default length...");
-crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, true, ["sign", "verify"]).then(function(result) {
- key = result;
- startTest();
-});
-
-function startTest()
-{
- shouldBeTrue("key.algorithm === key.algorithm");
- key.algorithm.foo = "bar";
- gc();
- setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
- gc();
- setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
- gc();
- shouldBeEqualToString('key.algorithm.foo', 'bar');
- finishJSTest();
-}
-
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlecryptokeyusagesgcexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-Test that CryptoKey.usages preserves custom properties.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Generating a HMAC key with default length...
-PASS key.usages === key.usages is true
-PASS key.usages.foo is "bar"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlecryptokeyusagesgchtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,44 +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 that CryptoKey.usages preserves custom properties.");
-jsTestIsAsync = true;
-
-debug("\nGenerating a HMAC key with default length...");
-crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, true, ["sign", "verify"]).then(function(result) {
- key = result;
- startTest();
-});
-
-function startTest()
-{
- shouldBeTrue("key.usages === key.usages");
- key.usages.foo = "bar";
- gc();
- setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
- gc();
- setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
- gc();
- shouldBeEqualToString('key.usages.foo', 'bar');
- finishJSTest();
-}
-
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegc2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/gc-2-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-2-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/subtle/gc-2-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+Test that window.crypto.subtle wrapper preserves custom properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS [object Crypto] is defined.
+PASS [object SubtleCrypto] is defined.
+PASS anotherWindowCrypto.subtle.foo is "bar"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegc2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/gc-2.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-2.html         (rev 0)
+++ trunk/LayoutTests/crypto/subtle/gc-2.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+
+description("Test that window.crypto.subtle wrapper preserves custom properties.");
+jsTestIsAsync = true;
+
+var anotherWindowCrypto;
+
+function startTest()
+{
+ anotherWindowCrypto = frames[0].crypto;
+ shouldBeDefined(anotherWindowCrypto);
+ shouldBeDefined(anotherWindowCrypto.subtle);
+
+ anotherWindowCrypto.subtle.foo = "bar";
+ document.body.removeChild(document.getElementsByTagName("iframe")[0]);
+ gc();
+ setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+ gc();
+ setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+ gc();
+ shouldBe('anotherWindowCrypto.subtle.foo', '"bar"');
+ finishJSTest();
+}
+
+window.onload = startTest;
+
+</script>
+<iframe src="about:blank"></iframe>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegc3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/gc-3-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-3-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/subtle/gc-3-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Test that window.crypto wrapper protects all dependencies, so it can always be used to get crypto.subtle.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS [object Crypto] is defined.
+PASS [object SubtleCrypto] is defined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegc3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/gc-3.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-3.html         (rev 0)
+++ trunk/LayoutTests/crypto/subtle/gc-3.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+
+description("Test that window.crypto wrapper protects all dependencies, so it can always be used to get crypto.subtle.");
+jsTestIsAsync = true;
+
+var anotherWindowCrypto;
+
+function startTest()
+{
+ anotherWindowCrypto = frames[0].crypto;
+ shouldBeDefined(anotherWindowCrypto);
+ document.body.removeChild(document.getElementsByTagName("iframe")[0]);
+ gc();
+ setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+ gc();
+ setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+ gc();
+ shouldBeDefined(anotherWindowCrypto.subtle);
+ finishJSTest();
+}
+
+window.onload = startTest;
+
+</script>
+<iframe src="about:blank"></iframe>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegcexpectedtxtfromrev206882trunkLayoutTestscryptosubtleunimplementedunwrapcrashexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/gc-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/subtle/gc-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Test that window.crypto.subtle wrapper preserves custom properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.crypto.subtle.foo is "bar"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegchtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/gc.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc.html         (rev 0)
+++ trunk/LayoutTests/crypto/subtle/gc.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+
+description("Test that window.crypto.subtle wrapper preserves custom properties.");
+jsTestIsAsync = true;
+
+function startTest()
+{
+ window.crypto.subtle.foo = "bar";
+ gc();
+ setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+ gc();
+ setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+ gc();
+ shouldBe('window.crypto.subtle.foo', '"bar"');
+ finishJSTest();
+}
+
+window.onload = startTest;
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmaccheckalgorithmexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test that HMAC operations only work when hash functions match between invocation and key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw HMAC SHA-1 key from string literal...
-Done
-PASS crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('foo')) did not throw exception.
-PASS crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('foo')) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.verify({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo')) did not throw exception.
-PASS crypto.subtle.verify({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo')) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmaccheckalgorithmhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-check-algorithm.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-check-algorithm.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-check-algorithm.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,36 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test that HMAC operations only work when hash functions match between invocation and key.");
-
-jsTestIsAsync = true;
-
-var hmacKey = asciiToUint8Array('a');
-var extractable = true;
-
-debug("Importing a raw HMAC SHA-1 key from string literal...");
-crypto.subtle.importKey("raw", hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, ["sign", "verify"]).then(function(result) {
- debug("Done");
- key = result;
-
- shouldNotThrow("crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('foo'))");
- shouldThrow("crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('foo'))");
-
- shouldNotThrow("crypto.subtle.verify({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo'))");
- shouldThrow("crypto.subtle.verify({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo'))");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacexportkeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-export-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-export-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-export-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,31 +0,0 @@
</span><del>-Test exporting an AES key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a JWK key...
-PASS crypto.subtle.exportKey(null, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey({}, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey("", key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
-Exporting the key as raw data...
-PASS bytesToHexString(new Uint8Array(exportedData)) is '6a18e49feff7f3b7e09ec89b7f6deab2f6a18e49feff7f3b7e09ec89b7f6deab'
-Exporting the key as JWK...
-PASS exportedJWK.kty is 'oct'
-PASS exportedJWK.k is 'ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs'
-PASS exportedJWK.alg is 'HS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['sign', 'verify']
-
-Importing a key that's not extractable...
-
-Trying to export as raw...
-PASS Rejected, as expected
-Trying to export as jwk...
-PASS Rejected, as expected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacexportkeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-export-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-export-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-export-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,80 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test exporting an AES key.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var jwkKey = {
- "kty": "oct",
- "k": "ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs"
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
-
-debug("Importing a JWK key...");
-crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, { name: "HMAC", hash: "SHA-256" }, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
-
- shouldThrow('crypto.subtle.exportKey(null, key)');
- shouldThrow('crypto.subtle.exportKey(undefined, key)');
- shouldThrow('crypto.subtle.exportKey({}, key)');
- shouldThrow('crypto.subtle.exportKey("", key)');
- shouldThrow('crypto.subtle.exportKey("foobar", key)');
-
- debug("Exporting the key as raw data...");
- return crypto.subtle.exportKey("raw", key);
-}).then(function(result) {
- exportedData = result;
- shouldBe("bytesToHexString(new Uint8Array(exportedData))", "'6a18e49feff7f3b7e09ec89b7f6deab2f6a18e49feff7f3b7e09ec89b7f6deab'");
-
- debug("Exporting the key as JWK...");
- return crypto.subtle.exportKey("jwk", key);
-}).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
- shouldBe("exportedJWK.kty", "'oct'");
- shouldBe("exportedJWK.k", "'ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs'");
- shouldBe("exportedJWK.alg", "'HS256'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
-
- debug("\nImporting a key that's not extractable...");
- return crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, { name: "HMAC", hash: "SHA-256" }, nonExtractable, ["sign", "verify"]);
-}).then(function(result) {
- key = result;
-
- debug("\nTrying to export as raw...");
- return crypto.subtle.exportKey("raw", key);
-}).then(function(result) {
- testFailed("Promise wasn't rejected");
- finishJSTest();
-}, function() {
- testPassed("Rejected, as expected");
-
- debug("Trying to export as jwk...");
- return crypto.subtle.exportKey("jwk", key);
-}).then(function(result) {
- testFailed("Promise wasn't rejected");
- finishJSTest();
-}, function() {
- testPassed("Rejected, as expected");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacgeneratekeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-generate-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-generate-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-generate-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,29 +0,0 @@
</span><del>-Test generating a HMAC key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS crypto.subtle.generateKey("hmac", extractable, ["sign", "verify"]) threw exception TypeError: Type error.
-PASS crypto.subtle.generateKey({name: "hmac"}, extractable, ["sign", "verify"]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: "hmac", length: undefined}, extractable, ["sign", "verify"]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: "hmac", length: {}}, extractable, ["sign", "verify"]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-
-Generating a key with default length...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 64
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is ["sign", "verify"]
-
-Generating a key with custom length...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 5
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is ["sign"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacgeneratekeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-generate-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-generate-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-generate-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,51 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test generating a HMAC key.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-shouldThrow('crypto.subtle.generateKey("hmac", extractable, ["sign", "verify"])');
-shouldThrow('crypto.subtle.generateKey({name: "hmac"}, extractable, ["sign", "verify"])');
-shouldThrow('crypto.subtle.generateKey({name: "hmac", length: undefined}, extractable, ["sign", "verify"])');
-shouldThrow('crypto.subtle.generateKey({name: "hmac", length: {}}, extractable, ["sign", "verify"])');
-
-debug("\nGenerating a key with default length...");
-crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
-
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "64");
- shouldBe("key.algorithm.hash.name", "'SHA-1'");
- shouldBe("key.usages", '["sign", "verify"]');
-
- debug("\nGenerating a key with custom length...");
- return crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: 5}, extractable, ["sign"]);
-}).then(function(result) {
- key = result;
-
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "5");
- shouldBe("key.algorithm.hash.name", "'SHA-1'");
- shouldBe("key.usages", '["sign"]');
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,22 +0,0 @@
</span><del>-Test importing a JWK key for HMAC.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a key...
-
-PASS key.type is 'secret'
-PASS key.extractable is false
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 32
-PASS key.usages is ["sign", "verify"]
-
-Using the key to sign message 'foo'...
-PASS bytesToHexString(new Uint8Array(signature)) is 'e03736fe098892b2a2da77812431f7c014d32e2fd69f3bcff883ac923a8fa2da'
-
-Verifying the signature...
-PASS verificationResult is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,55 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test importing a JWK key for HMAC.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var hmacKey = {
- "kty": "oct",
- "alg": "HS256",
- "use": "sig",
- "ext": false,
- "k": "ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs"
-};
-
-var hmacKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(hmacKey));
-
-debug("Importing a key...\n");
-crypto.subtle.importKey("jwk", hmacKeyAsArrayBuffer, null, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
-
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "false");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "32");
- shouldBe("key.usages", '["sign", "verify"]');
-
- debug("\nUsing the key to sign message 'foo'...");
- return crypto.subtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
-}).then(function(result) {
- signature = result;
- shouldBe("bytesToHexString(new Uint8Array(signature))", "'e03736fe098892b2a2da77812431f7c014d32e2fd69f3bcff883ac923a8fa2da'");
-
- debug("\nVerifying the signature...");
- return crypto.subtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
-}).then(function(result) {
- verificationResult = result;
- shouldBe("verificationResult", "true");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacpostMessageexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-Test sending crypto keys via postMessage.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 16
-PASS key.usages is ["sign", "verify"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacpostMessagehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-postMessage.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-postMessage.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-postMessage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,32 +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.");
-
-jsTestIsAsync = true;
-
-window.addEventListener("message", function(evt) {
- key = evt.data;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "16");
- shouldBe("key.usages", '["sign", "verify"]');
-
- finishJSTest();
-}, false);
-
-crypto.subtle.importKey("raw", asciiToUint8Array("16 bytes of key!"), {name: 'hmac', hash: {name: 'sha-1'}}, true, ['sign', 'verify']).then(function(key) {
- postMessage(key, "*");
-});
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacsignverifyemptykeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,20 +0,0 @@
</span><del>-Test HMAC sign and verify functions with an empty key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw HMAC key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 0
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is ['sign', 'verify']
-Using the key to sign 'foo'...
-PASS bytesToHexString(new Uint8Array(signature)) is 'a3cc770fc033e2cb419d42b64e0081a3bd3be30e'
-Verifying the signature...
-PASS verificationResult is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacsignverifyemptykeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test HMAC sign and verify functions with an empty key.");
-
-jsTestIsAsync = true;
-
-var hmacKey = asciiToUint8Array('');
-var extractable = true;
-
-debug("Importing a raw HMAC key from string literal...");
-crypto.subtle.importKey("raw", hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "0"); // See <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098>.
- shouldBe("key.algorithm.hash.name", "'SHA-1'");
- shouldBe("key.usages", "['sign', 'verify']");
-
- debug("Using the key to sign 'foo'...");
- return crypto.subtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
-}).then(function(result) {
- signature = result;
- shouldBe("bytesToHexString(new Uint8Array(signature))", "'a3cc770fc033e2cb419d42b64e0081a3bd3be30e'");
-
- debug("Verifying the signature...");
- return crypto.subtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
-}).then(function(result) {
- verificationResult = result;
- shouldBe("verificationResult", "true");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacsignverifyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,20 +0,0 @@
</span><del>-Test HMAC sign and verify functions.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a raw HMAC key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 1
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is ['sign', 'verify']
-Using the key to sign 'foo'...
-PASS bytesToHexString(new Uint8Array(signature)) is 'bebbc02e46b0f81183f40c25dce23e5045d65519'
-Verifying the signature...
-PASS verificationResult is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacsignverifyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test HMAC sign and verify functions.");
-
-jsTestIsAsync = true;
-
-var hmacKey = asciiToUint8Array('a');
-var extractable = true;
-
-debug("Importing a raw HMAC key from string literal...");
-crypto.subtle.importKey("raw", hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "1"); // See <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098>.
- shouldBe("key.algorithm.hash.name", "'SHA-1'");
- shouldBe("key.usages", "['sign', 'verify']");
-
- debug("Using the key to sign 'foo'...");
- return crypto.subtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
-}).then(function(result) {
- signature = result;
- shouldBe("bytesToHexString(new Uint8Array(signature))", "'bebbc02e46b0f81183f40c25dce23e5045d65519'");
-
- debug("Verifying the signature...");
- return crypto.subtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
-}).then(function(result) {
- verificationResult = result;
- shouldBe("verificationResult", "true");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleimportjwkexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/import-jwk-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/import-jwk-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,30 +0,0 @@
</span><del>-Test error handling for JWK import.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array(''), null) threw exception TypeError: Invalid JWK serialization.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{'), null) threw exception TypeError: Invalid JWK serialization.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('null'), null) threw exception TypeError: Invalid JWK serialization.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('undefined'), null) threw exception TypeError: Invalid JWK serialization.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{}'), null) threw exception TypeError: Neither key nor function argument has crypto algorithm specified.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{}'), "aes-cbc") threw exception TypeError: Required JWK "kty" member is missing.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "foobar", "alg": "HS256", "use": "sig", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Unsupported JWK key type foobar.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "foobar", "use": "sig", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Unsupported JWK algorithm foobar.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), "aes-cbc") threw exception TypeError: Algorithm specified in key is not compatible with one passed to importKey as argument.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), { name: "hmac", hash: "sha-1" }) threw exception TypeError: Algorithm specified in key is not compatible with one passed to importKey as argument.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256" }'), null) threw exception TypeError: Secret key data is not present is JWK.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "A128CBC" }'), null) threw exception TypeError: Secret key data is not present is JWK.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "1234" }'), null) threw exception TypeError: Key size is not valid for HS256.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "A128CBC", "use": "sig", "ext": false, "k": "1234" }'), null) threw exception TypeError: Key size is not valid for A128CBC.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "A128CBC", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Key size is not valid for A128CBC.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387f+nsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Cannot decode base64url key data in JWK.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": 1, "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Expected a string value for "kty" JSON key.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": 1, "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Expected a string value for "alg" JSON key.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": 1, "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Expected a string value for "use" JSON key.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": "false", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Expected a boolean value for "ext" JSON key.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": 1 }'), null) threw exception TypeError: Expected a string value for "k" JSON key.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleimportjwkhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/import-jwk.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/import-jwk.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,51 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test error handling for JWK import.");
-
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'null\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'undefined\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{}\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{}\'), "aes-cbc")')
-
-// Unknown/invalid JWK values.
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "foobar", "alg": "HS256", "use": "sig", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "foobar", "use": "sig", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-
-// Algorithm mismatch.
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), "aes-cbc")')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), { name: "hmac", hash: "sha-1" })')
-
-// No key data.
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256" }\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "A128CBC" }\'), null)')
-
-// Key data length is incorrect, not allowed in JWK.
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "1234" }\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "A128CBC", "use": "sig", "ext": false, "k": "1234" }\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "A128CBC", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-
-// Key data is not valid base64url.
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387f+nsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-
-// Incorrect data types.
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": 1, "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": 1, "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": 1, "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": "false", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": 1 }\'), null)')
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlejwkexportusevaluesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,53 +0,0 @@
</span><del>-Test exporting keys with various usages to JWK.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-encrypt:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["encrypt"]
-
-decrypt:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["decrypt"]
-
-encrypt,decrypt:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["encrypt","decrypt"]
-
-wrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["wrapKey"]
-
-unwrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["unwrapKey"]
-
-wrapKey,unwrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["wrapKey","unwrapKey"]
-
-encrypt,decrypt,wrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["encrypt","decrypt","wrapKey"]
-
-encrypt,decrypt,wrapKey,unwrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["encrypt","decrypt","wrapKey","unwrapKey"]
-
-sign:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["sign"]
-
-verify:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["verify"]
-
-sign,verify:
-PASS jwk.use is undefined
-PASS jwk.key_ops is ["sign","verify"]
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlejwkexportusevalueshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,64 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test exporting keys with various usages to JWK.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var aesKeyAsArrayBuffer = Base64URL.parse("jnOw99oOZFLIEPMrgJB55WL46tJSLGt7");
-var hmacKeyAsArrayBuffer = Base64URL.parse("ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs");
-
-function testWithAESCBC(usages, expectedKeyOps)
-{
- return crypto.subtle.importKey("raw", aesKeyAsArrayBuffer, "AES-CBC", extractable, usages).then(function(result) {
- return crypto.subtle.exportKey("jwk", result);
- }).then(function(result) {
- jwk = JSON.parse(bytesToASCIIString(result));
- debug(usages + ":");
- shouldBe("jwk.use", "undefined");
- shouldBe("jwk.key_ops", JSON.stringify(expectedKeyOps));
- debug("");
- });
-}
-
-function testWithHMAC(usages, expectedKeyOps)
-{
- return crypto.subtle.importKey("raw", hmacKeyAsArrayBuffer, {name: 'hmac', hash: {name: 'sha-256'}}, extractable, usages).then(function(result) {
- return crypto.subtle.exportKey("jwk", result);
- }).then(function(result) {
- jwk = JSON.parse(bytesToASCIIString(result));
- debug(usages + ":");
- shouldBe("jwk.use", "undefined");
- shouldBe("jwk.key_ops", JSON.stringify(expectedKeyOps));
- debug("");
- });
-}
-
-Promise.all([
- testWithAESCBC(["encrypt"], ["encrypt"]),
- testWithAESCBC(["decrypt"], ["decrypt"]),
- testWithAESCBC(["encrypt", "decrypt"], ["encrypt", "decrypt"]),
- testWithAESCBC(["wrapKey"], ["wrapKey"]),
- testWithAESCBC(["unwrapKey"], ["unwrapKey"]),
- testWithAESCBC(["wrapKey", "unwrapKey"], ["wrapKey", "unwrapKey"]),
- testWithAESCBC(["encrypt", "decrypt", "wrapKey"], ["encrypt", "decrypt", "wrapKey"]),
- testWithAESCBC(["encrypt", "decrypt", "wrapKey", "unwrapKey"], ["encrypt", "decrypt", "wrapKey", "unwrapKey"]),
- testWithHMAC(["sign"], ["sign"]),
- testWithHMAC(["verify"], ["verify"]),
- testWithHMAC(["sign", "verify"], ["sign", "verify"]),
-]).then(function() { finishJSTest(); } );
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlejwkimportusevaluesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,53 +0,0 @@
</span><del>-Test importing keys with various uses from JWK.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS testWithAESCBC(["encrypt"], {key_ops: ["encrypt", "encrypt"]}) threw exception TypeError: JWK key_ops contains a duplicate operation.
-
-{"key_ops":["encrypt"]}:
-PASS key.usages is ["encrypt"]
-
-{"key_ops":["decrypt"]}:
-PASS key.usages is ["decrypt"]
-
-{"key_ops":["encrypt","decrypt"]}:
-PASS key.usages is ["decrypt","encrypt"]
-
-{"key_ops":["wrapKey"]}:
-PASS key.usages is ["wrapKey"]
-
-{"key_ops":["unwrapKey"]}:
-PASS key.usages is ["unwrapKey"]
-
-{"key_ops":["wrapKey","unwrapKey"]}:
-PASS key.usages is ["unwrapKey","wrapKey"]
-
-{"key_ops":["encrypt","decrypt","wrapKey"]}:
-PASS key.usages is ["decrypt","encrypt","wrapKey"]
-
-{"use":"enc"}:
-PASS key.usages is ["decrypt","encrypt","unwrapKey","wrapKey"]
-
-{"key_ops":["sign"]}:
-PASS key.usages is ["sign"]
-
-{"key_ops":["verify"]}:
-PASS key.usages is ["verify"]
-
-{"use":"sig"}:
-PASS key.usages is ["sign","verify"]
-
-{"key_ops":["'encrypt'"]}:
-PASS key.usages is []
-
-{"key_ops":["encrypt "]}:
-PASS key.usages is []
-
-{"key_ops":["Encrypt"]}:
-PASS key.usages is []
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlejwkimportusevalueshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,95 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test importing keys with various uses from JWK.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var aesKeyAsJSON = {
- "alg": "A192CBC",
- "ext": true,
- "kty": "oct",
- "k": "jnOw99oOZFLIEPMrgJB55WL46tJSLGt7"
-};
-
-var hmacKeyAsJSON = {
- "alg": "HS256",
- "ext": true,
- "kty": "oct",
- "k": "ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs"
-};
-
-function testWithAESCBC(expectedUsages, jwkUsages)
-{
- if (jwkUsages.key_ops) {
- aesKeyAsJSON.key_ops = jwkUsages.key_ops;
- delete aesKeyAsJSON.use;
- } else {
- delete aesKeyAsJSON.key_ops;
- aesKeyAsJSON.use = jwkUsages.use;
- }
-
- return crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(aesKeyAsJSON)), "AES-CBC", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(result) {
- key = result;
- debug(JSON.stringify(jwkUsages) + ":");
- shouldBe("key.usages", JSON.stringify(expectedUsages));
- debug("");
- });
-}
-
-function testWithHMAC(expectedUsages, jwkUsages)
-{
- if (jwkUsages.key_ops) {
- hmacKeyAsJSON.key_ops = jwkUsages.key_ops;
- delete hmacKeyAsJSON.use;
- } else {
- delete hmacKeyAsJSON.key_ops;
- hmacKeyAsJSON.use = jwkUsages.use;
- }
-
- return crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(hmacKeyAsJSON)), {name: 'hmac', hash: {name: 'sha-256'}}, extractable, ["sign", "verify"]).then(function(result) {
- key = result;
- debug(JSON.stringify(jwkUsages) + ":");
- shouldBe("key.usages", JSON.stringify(expectedUsages));
- debug("");
- });
-}
-
-// Duplicates are not allowed. We currently raise an exception, although we should reject the promise instead.
-shouldThrow('testWithAESCBC(["encrypt"], {key_ops: ["encrypt", "encrypt"]})');
-debug("");
-
-Promise.all([
- testWithAESCBC(["encrypt"], {key_ops: ["encrypt"]}),
- testWithAESCBC(["decrypt"], {key_ops: ["decrypt"]}),
- testWithAESCBC(["decrypt", "encrypt"], {key_ops: ["encrypt", "decrypt"]}),
- testWithAESCBC(["wrapKey"], {key_ops: ["wrapKey"]}),
- testWithAESCBC(["unwrapKey"], {key_ops: ["unwrapKey"]}),
- testWithAESCBC(["unwrapKey", "wrapKey"], {key_ops: ["wrapKey", "unwrapKey"]}),
- testWithAESCBC(["decrypt", "encrypt", "wrapKey"], {key_ops: ["encrypt", "decrypt", "wrapKey"]}),
- testWithAESCBC(["decrypt", "encrypt", "unwrapKey", "wrapKey"], {use: "enc"}),
- testWithHMAC(["sign"], {key_ops: ["sign"]}),
- testWithHMAC(["verify"], {key_ops: ["verify"]}),
- testWithHMAC(["sign", "verify"], {use: "sig"}),
-
-// Unknown key_ops strings are ignored.
- testWithAESCBC([], {key_ops: ["'encrypt'"]}),
- testWithAESCBC([], {key_ops: ["encrypt "]}),
- testWithAESCBC([], {key_ops: ["Encrypt"]}),
-
-]).then(function() { finishJSTest(); } );
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportgeneratedkeysexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-Test exporting a generated RSA keypair with hash.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Generating RSA-PKCS1-v1.5 keyPair...
-PASS crypto.subtle.exportKey(null, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey({}, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey("", key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
-PASS key.publicKey.algorithm.hash.name is defined.
-PASS key.privateKey.algorithm.hash.name is defined.
-
-Exporting public key as JWK...
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.alg is 'RS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['sign', 'verify']
-
-Exporting private key as JWK...
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.alg is 'RS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['sign', 'verify']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportgeneratedkeyshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test exporting a generated RSA keypair with hash.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var algorithm = {
- name: "RSASSA-PKCS1-v1_5",
- modulusLength: "2048",
- publicExponent: new Uint8Array([1, 0, 1]), // 2^16 + 1 (65537)
- hash: { name: "SHA-256" }
-};
-
-debug("\nGenerating RSA-PKCS1-v1.5 keyPair...");
-crypto.subtle.generateKey(algorithm, extractable, ['sign', 'verify'])
-.then(function(result) {
- key = result;
-
- shouldThrow('crypto.subtle.exportKey(null, key)');
- shouldThrow('crypto.subtle.exportKey(undefined, key)');
- shouldThrow('crypto.subtle.exportKey({}, key)');
- shouldThrow('crypto.subtle.exportKey("", key)');
- shouldThrow('crypto.subtle.exportKey("foobar", key)');
- shouldBeDefined('key.publicKey.algorithm.hash.name');
- shouldBeDefined('key.privateKey.algorithm.hash.name');
-
- debug("\nExporting public key as JWK...");
- return crypto.subtle.exportKey("jwk", key.publicKey);
-}).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
-
- shouldBe("exportedJWK.kty", "'RSA'");
- shouldBe("exportedJWK.alg", "'RS256'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
-
- debug("\nExporting private key as JWK...");
- return crypto.subtle.exportKey("jwk", key.privateKey);
-}).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
-
- shouldBe("exportedJWK.kty", "'RSA'");
- shouldBe("exportedJWK.alg", "'RS256'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportkeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-export-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,25 +0,0 @@
</span><del>-Test exporting an RSA key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Importing a JWK key...
-PASS crypto.subtle.exportKey(null, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey({}, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey("", key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
-
-Exporting the key as JWK...
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.n is publicKeyJSON.n
-PASS exportedJWK.e is publicKeyJSON.e
-PASS exportedJWK.alg is 'RS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['sign', 'verify']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportkeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-export-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,57 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test exporting an RSA key.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB"
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
-
-debug("\nImporting a JWK key...");
-crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, "RSASSA-PKCS1-v1_5", extractable, ['sign', 'verify']).then(function(result) {
- key = result;
-
- shouldThrow('crypto.subtle.exportKey(null, key)');
- shouldThrow('crypto.subtle.exportKey(undefined, key)');
- shouldThrow('crypto.subtle.exportKey({}, key)');
- shouldThrow('crypto.subtle.exportKey("", key)');
- shouldThrow('crypto.subtle.exportKey("foobar", key)');
-
- debug("\nExporting the key as JWK...");
- return crypto.subtle.exportKey("jwk", key);
-}).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
-
- shouldBe("exportedJWK.kty", "'RSA'");
- shouldBe("exportedJWK.n", "publicKeyJSON.n");
- shouldBe("exportedJWK.e", "publicKeyJSON.e");
- shouldBe("exportedJWK.alg", "'RS256'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportprivatekeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,27 +0,0 @@
</span><del>-Test exporting a private RSA key.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Importing a JWK key...
-
-Exporting the key as JWK...
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.n is privateKeyJSON.n
-PASS exportedJWK.e is privateKeyJSON.e
-PASS exportedJWK.d is privateKeyJSON.d
-PASS exportedJWK.p is privateKeyJSON.p
-PASS exportedJWK.q is privateKeyJSON.q
-PASS exportedJWK.dp is privateKeyJSON.dp
-PASS exportedJWK.dq is privateKeyJSON.dq
-PASS exportedJWK.qi is privateKeyJSON.qi
-PASS exportedJWK.oth is privateKeyJSON.oth
-PASS exportedJWK.alg is privateKeyJSON.alg
-PASS exportedJWK.ext is true
-PASS exportedJWK.key_ops is ['sign', 'verify']
-PASS exportedJWK.use is undefined
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportprivatekeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,65 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test exporting a private RSA key.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-// Example from JWK specification.
-var privateKeyJSON = {
- "kty":"RSA",
- "n":"0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",
- "e":"AQAB",
- "d":"X4cTteJY_gn4FYPsXB8rdXix5vwsg1FLN5E3EaG6RJoVH-HLLKD9M7dx5oo7GURknchnrRweUkC7hT5fJLM0WbFAKNLWY2vv7B6NqXSzUvxT0_YSfqijwp3RTzlBaCxWp4doFk5N2o8Gy_nHNKroADIkJ46pRUohsXywbReAdYaMwFs9tv8d_cPVY3i07a3t8MN6TNwm0dSawm9v47UiCl3Sk5ZiG7xojPLu4sbg1U2jx4IBTNBznbJSzFHK66jT8bgkuqsk0GjskDJk19Z4qwjwbsnn4j2WBii3RL-Us2lGVkY8fkFzme1z0HbIkfz0Y6mqnOYtqc0X4jfcKoAC8Q",
- "p":"83i-7IvMGXoMXCskv73TKr8637FiO7Z27zv8oj6pbWUQyLPQBQxtPVnwD20R-60eTDmD2ujnMt5PoqMrm8RfmNhVWDtjjMmCMjOpSXicFHj7XOuVIYQyqVWlWEh6dN36GVZYk93N8Bc9vY41xy8B9RzzOGVQzXvNEvn7O0nVbfs",
- "q":"3dfOR9cuYq-0S-mkFLzgItgMEfFzB2q3hWehMuG0oCuqnb3vobLyumqjVZQO1dIrdwgTnCdpYzBcOfW5r370AFXjiWft_NGEiovonizhKpo9VVS78TzFgxkIdrecRezsZ-1kYd_s1qDbxtkDEgfAITAG9LUnADun4vIcb6yelxk",
- "dp":"G4sPXkc6Ya9y8oJW9_ILj4xuppu0lzi_H7VTkS8xj5SdX3coE0oimYwxIi2emTAue0UOa5dpgFGyBJ4c8tQ2VF402XRugKDTP8akYhFo5tAA77Qe_NmtuYZc3C3m3I24G2GvR5sSDxUyAN2zq8Lfn9EUms6rY3Ob8YeiKkTiBj0",
- "dq":"s9lAH9fggBsoFR8Oac2R_E2gw282rT2kGOAhvIllETE1efrA6huUUvMfBcMpn8lqeW6vzznYY5SSQF7pMdC_agI3nG8Ibp1BUb0JUiraRNqUfLhcQb_d9GF4Dh7e74WbRsobRonujTYN1xCaP6TO61jvWrX-L18txXw494Q_cgk",
- "qi":"GyM_p6JrXySiz1toFgKbWV-JdI3jQ4ypu9rbMWx3rQJBfmt0FoYzgUIZEVFEcOqwemRN81zoDAaa-Bk0KWNGDjJHZDdDmFhW3AN7lI-puxk_mHZGJ11rxyR8O55XLSe3SPmRfKwZI6yU24ZxvQKFYItdldUKGzO6Ia6zTKhAVRU",
- "alg":"RS256",
- "kid":"2011-04-29"
-}
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(privateKeyJSON));
-
-debug("\nImporting a JWK key...");
-crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, "RSASSA-PKCS1-v1_5", extractable, ['sign', 'verify']).then(function(result) {
- key = result;
-
- debug("\nExporting the key as JWK...");
- return crypto.subtle.exportKey("jwk", key);
-}).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
-
- shouldBe("exportedJWK.kty", "'RSA'");
- shouldBe("exportedJWK.n", "privateKeyJSON.n");
- shouldBe("exportedJWK.e", "privateKeyJSON.e");
- shouldBe("exportedJWK.d", "privateKeyJSON.d");
- shouldBe("exportedJWK.p", "privateKeyJSON.p");
- shouldBe("exportedJWK.q", "privateKeyJSON.q");
- shouldBe("exportedJWK.dp", "privateKeyJSON.dp");
- shouldBe("exportedJWK.dq", "privateKeyJSON.dq");
- shouldBe("exportedJWK.qi", "privateKeyJSON.qi");
- shouldBe("exportedJWK.oth", "privateKeyJSON.oth");
- shouldBe("exportedJWK.alg", "privateKeyJSON.alg");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
- shouldBe("exportedJWK.use", "undefined");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test storing a private RSA key in IndexedDB, and retrieving it.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS retrievedKey.type is 'private'
-PASS retrievedKey.extractable is true
-PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS retrievedKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
-PASS retrievedKey.usages is ["sign", "verify"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportableexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test storing a private RSA key in IndexedDB, and retrieving it.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS retrievedKey.type is 'private'
-PASS retrievedKey.extractable is false
-PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS retrievedKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
-PASS retrievedKey.usages is ["sign", "verify"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivateexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test storing a private RSA key in IndexedDB, and retrieving it.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS retrievedKey.type is 'private'
-PASS retrievedKey.extractable is false
-PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS retrievedKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
-PASS retrievedKey.usages is ["sign", "verify"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivatehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script>
-enablePrivateBrowsing = true;
-</script>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<script src="resources/rsa-indexeddb-non-exportable.js"></script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportablehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,11 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<script src="resources/rsa-indexeddb-non-exportable.js"></script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbprivateexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test storing a private RSA key in IndexedDB, and retrieving it.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS retrievedKey.type is 'private'
-PASS retrievedKey.extractable is true
-PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS retrievedKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
-PASS retrievedKey.usages is ["sign", "verify"]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbprivatehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script>
-enablePrivateBrowsing = true;
-</script>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<script src="resources/rsa-indexeddb.js"></script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,11 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<script src="resources/rsa-indexeddb.js"></script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,23 +0,0 @@
</span><del>-Test that even when non-extractability is requested, the public key is still extractable.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Generating a key pair...
-PASS keyPair.toString() is '[object KeyPair]'
-PASS keyPair.publicKey.type is 'public'
-PASS keyPair.publicKey.extractable is true
-PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
-PASS keyPair.publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
-PASS keyPair.publicKey.algorithm.hash is undefined.
-PASS keyPair.privateKey.type is 'private'
-PASS keyPair.privateKey.extractable is false
-PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
-PASS keyPair.privateKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
-PASS keyPair.privateKey.algorithm.hash is undefined.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test that even when non-extractability is requested, the public key is still extractable.");
-
-jsTestIsAsync = true;
-
-var algorithmKeyGen = {
- name: "RSA-OAEP",
- // RsaKeyGenParams
- modulusLength: 2048,
- publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
-};
-var nonExtractable = false;
-
-debug("Generating a key pair...");
-crypto.subtle.generateKey(algorithmKeyGen, nonExtractable, []).then(function(result) {
- keyPair = result;
- shouldBe("keyPair.toString()", "'[object KeyPair]'");
- shouldBe("keyPair.publicKey.type", "'public'");
- shouldBe("keyPair.publicKey.extractable", "true");
- shouldBe("keyPair.publicKey.algorithm.name", "'RSA-OAEP'");
- shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
- shouldBeUndefined("keyPair.publicKey.algorithm.hash");
- shouldBe("keyPair.privateKey.type", "'private'");
- shouldBe("keyPair.privateKey.extractable", "false");
- shouldBe("keyPair.privateKey.algorithm.name", "'RSA-OAEP'");
- shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
- shouldBeUndefined("keyPair.privateKey.algorithm.hash");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepkeymanipulationexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-Test generating, importing and exporting RSA keys for RSA-OAEP. Test that they can't be used with another algorithm.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Generating a key pair...
-PASS keyPair.toString() is '[object KeyPair]'
-PASS keyPair.publicKey.type is 'public'
-PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
-PASS keyPair.publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
-PASS keyPair.publicKey.algorithm.hash is undefined.
-PASS keyPair.privateKey.type is 'private'
-PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
-PASS keyPair.privateKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
-PASS keyPair.privateKey.algorithm.hash is undefined.
-
-Testing that the keys can't be used with different algorithms...
-PASS crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, keyPair.privateKey, hexStringToUint8Array("00")) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, keyPair.publicKey, hexStringToUint8Array("00")) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-
-Trying to export keys to raw...
-PASS Promise rejected for exporting public key
-PASS Promise rejected for exporting private key
-
-Exporting public key to JWK...
-PASS jwkPublicKey.alg is 'RSA-OAEP'
-PASS jwkPublicKey.ext is true
-PASS jwkPublicKey.key_ops is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
-PASS jwkPublicKey.use is undefined
-PASS jwkPublicKey.kty is 'RSA'
-PASS bytesToHexString(Base64URL.parse(jwkPublicKey.e)) is '010001'
-
-Importing it back...
-PASS exportedPublicKey.type is 'public'
-PASS exportedPublicKey.algorithm.name is 'RSA-OAEP'
-PASS exportedPublicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(exportedPublicKey.algorithm.publicExponent) is '010001'
-PASS exportedPublicKey.algorithm.hash.name is 'SHA-1'
-PASS exportedPublicKey.extractable is true
-PASS exportedPublicKey.usages is ['decrypt','encrypt','unwrapKey','wrapKey']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepkeymanipulationhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,82 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test generating, importing and exporting RSA keys for RSA-OAEP. Test that they can't be used with another algorithm.");
-
-jsTestIsAsync = true;
-
-var algorithmKeyGen = {
- name: "RSA-OAEP",
- // RsaKeyGenParams
- modulusLength: 2048,
- publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
-};
-var extractable = true;
-
-debug("Generating a key pair...");
-crypto.subtle.generateKey(algorithmKeyGen, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(result) {
- keyPair = result;
- shouldBe("keyPair.toString()", "'[object KeyPair]'");
- shouldBe("keyPair.publicKey.type", "'public'");
- shouldBe("keyPair.publicKey.algorithm.name", "'RSA-OAEP'");
- shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
- shouldBeUndefined("keyPair.publicKey.algorithm.hash");
- shouldBe("keyPair.privateKey.type", "'private'");
- shouldBe("keyPair.privateKey.algorithm.name", "'RSA-OAEP'");
- shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
- shouldBeUndefined("keyPair.privateKey.algorithm.hash");
-
- debug("\nTesting that the keys can't be used with different algorithms...");
- iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
- shouldThrow('crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, keyPair.privateKey, hexStringToUint8Array("00"))');
- shouldThrow('crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, keyPair.publicKey, hexStringToUint8Array("00"))');
-
- debug("\nTrying to export keys to raw...");
- return crypto.subtle.exportKey('raw', keyPair.publicKey);
-}).then(undefined, function(result) {
- testPassed("Promise rejected for exporting public key");
- return crypto.subtle.exportKey('raw', keyPair.privateKey);
-}).then(undefined, function(result) {
- testPassed("Promise rejected for exporting private key");
-
- debug("\nExporting public key to JWK...");
- return crypto.subtle.exportKey("jwk", keyPair.publicKey);
-}).then(function(result) {
- jwkPublicKeyArray = result;
- jwkPublicKey = JSON.parse(bytesToASCIIString(jwkPublicKeyArray));
- shouldBe("jwkPublicKey.alg", "'RSA-OAEP'");
- shouldBe("jwkPublicKey.ext", "true");
- shouldBe("jwkPublicKey.key_ops", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
- shouldBe("jwkPublicKey.use", "undefined");
- shouldBe("jwkPublicKey.kty", "'RSA'");
- shouldBe("bytesToHexString(Base64URL.parse(jwkPublicKey.e))", "'010001'");
-
- debug("\nImporting it back...");
- return crypto.subtle.importKey("jwk", jwkPublicKeyArray, null, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
-}).then(function(result) {
- exportedPublicKey = result;
- shouldBe("exportedPublicKey.type", "'public'");
- shouldBe("exportedPublicKey.algorithm.name", "'RSA-OAEP'");
- shouldBe("exportedPublicKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(exportedPublicKey.algorithm.publicExponent)", "'010001'");
- shouldBe("exportedPublicKey.algorithm.hash.name", "'SHA-1'");
- shouldBe("exportedPublicKey.extractable", "true");
- shouldBe("exportedPublicKey.usages", "['decrypt','encrypt','unwrapKey','wrapKey']");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepplaintextlengthexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-Test what happens when trying to encrypt a too large plain text with RSA-OAEP.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing RSA keys...
-Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...
-PASS Succeeded
-Encrypting a 215 byte buffer...
-PASS Rejected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepplaintextlengthhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test what happens when trying to encrypt a too large plain text with RSA-OAEP.");
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB"
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- 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 encryptAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
-var extractable = true;
-var nonExtractable = false;
-
-debug("Importing RSA keys...");
-crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["encrypt", "decrypt"]).then(function(result) {
- publicKey = result;
- return crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["encrypt", "decrypt"]);
-}).then(function(result) {
- privateKey = result;
-
- debug("Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...");
- return crypto.subtle.encrypt({name: "RSA-OAEP", hash: "SHA-1"}, publicKey, new Uint8Array(214));
-}).then(function(result) {
- testPassed("Succeeded");
- debug("Encrypting a 215 byte buffer...");
- return crypto.subtle.encrypt({name: "RSA-OAEP", hash: "SHA-1"}, publicKey, new Uint8Array(215));
-}).then(function(result) {
- testFailed("Succeeded");
- finishJSTest();
-}, function(result) {
- testPassed("Rejected");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepwrapunwrapaesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,34 +0,0 @@
</span><del>-Test wrapping and unwrapping AES keys with RSA-OAEP.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing RSA keys...
-Importing an AES key...
-Wrapping it...
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 256
-PASS unwrappedKey.usages is ['decrypt', 'encrypt']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
-
-Wrapping the same key as JWK...
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 256
-PASS unwrappedKey.usages is ['decrypt', 'encrypt']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepwrapunwrapaeshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,103 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test wrapping and unwrapping AES keys with RSA-OAEP.");
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB"
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- 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 wrapAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
-var extractable = true;
-var nonExtractable = false;
-
-debug("Importing RSA keys...");
-crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["wrapKey", "unwrapKey"]).then(function(result) {
- publicKey = result;
- return crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["wrapKey", "unwrapKey"]);
-}).then(function(result) {
- privateKey = result;
-
- debug("Importing an AES key...");
- aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
- return crypto.subtle.importKey("raw", aesKeyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
-}).then(function(result) {
- aesKey = result;
- debug("Wrapping it...");
-
- return crypto.subtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
-
- debug("Unwrapping it...");
- return crypto.subtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
-}).then(function(result) {
- unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'secret'");
- shouldBe("unwrappedKey.extractable", "true");
- shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
- shouldBe("unwrappedKey.algorithm.length", "256");
- shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
-
- debug("Exporting it...");
- return crypto.subtle.exportKey("raw", unwrappedKey);
-}).then(function(result) {
- unwrappedKeyData = result;
- shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData)");
-
- debug("\nWrapping the same key as JWK...");
- return crypto.subtle.wrapKey("jwk", aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
-
- debug("Unwrapping it...");
- return crypto.subtle.unwrapKey("jwk", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
-}).then(function(result) {
- unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'secret'");
- shouldBe("unwrappedKey.extractable", "true");
- shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
- shouldBe("unwrappedKey.algorithm.length", "256");
- shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
-
- debug("Exporting it...");
- return crypto.subtle.exportKey("raw", unwrappedKey);
-}).then(function(result) {
- unwrappedKeyData = result;
- shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData)");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersapostMessageexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-postMessage-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-postMessage-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-postMessage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-Test sending crypto keys via postMessage.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Key received in a message:
-PASS key.type is 'private'
-PASS key.extractable is true
-PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS key.algorithm.modulusLength is 2048
-PASS bytesToHexString(key.algorithm.publicExponent) is '010001'
-PASS key.usages is ["sign", "verify"]
-
-Exported back to JWK:
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.alg is 'RS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.key_ops is ['sign','verify']
-PASS exportedJWK.use is undefined
-PASS exportedJWK.n is privateKeyJSON.n
-PASS exportedJWK.e is privateKeyJSON.e
-PASS exportedJWK.d is privateKeyJSON.d
-PASS exportedJWK.p is privateKeyJSON.p
-PASS exportedJWK.q is privateKeyJSON.q
-PASS exportedJWK.dp is privateKeyJSON.dp
-PASS exportedJWK.dq is privateKeyJSON.dq
-PASS exportedJWK.qi is privateKeyJSON.qi
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersapostMessagehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-postMessage.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-postMessage.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-postMessage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,66 +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.");
-
-jsTestIsAsync = true;
-
-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"
-};
-
-window.addEventListener("message", function(evt) {
- debug("Key received in a message:");
- key = evt.data;
- shouldBe("key.type", "'private'");
- shouldBe("key.extractable", "true");
- shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("key.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(key.algorithm.publicExponent)", "'010001'");
- shouldBe("key.usages", '["sign", "verify"]');
-
- crypto.subtle.exportKey("jwk", key).then(function(result) {
- exportedJWK = JSON.parse(bytesToASCIIString(result));
- debug("\nExported back to JWK:");
- shouldBe("exportedJWK.kty", "'RSA'");
- shouldBe("exportedJWK.alg", "'RS256'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.key_ops", "['sign','verify']");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.n", "privateKeyJSON.n");
- shouldBe("exportedJWK.e", "privateKeyJSON.e");
- shouldBe("exportedJWK.d", "privateKeyJSON.d");
- shouldBe("exportedJWK.p", "privateKeyJSON.p");
- shouldBe("exportedJWK.q", "privateKeyJSON.q");
- shouldBe("exportedJWK.dp", "privateKeyJSON.dp");
- shouldBe("exportedJWK.dq", "privateKeyJSON.dq");
- shouldBe("exportedJWK.qi", "privateKeyJSON.qi");
- debug("");
-
- finishJSTest();
- });
-}, false);
-
-crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, true, ["sign", "verify"]).then(function(result) {
- postMessage(result, "*");
-});
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5decryptexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,12 +0,0 @@
</span><del>-Test decrypting a known message with RSAES-PKCS1-v1_5.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing an RSA key...
-Decrypting...
-PASS bytesToHexString(new Uint8Array(message)) is '2aacec86f423dd925ec158822a748cbe6c31a0'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5decrypthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,49 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test decrypting a known message with RSAES-PKCS1-v1_5.");
-
-jsTestIsAsync = true;
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RSA1_5",
- n: Base64URL.stringify(hexStringToUint8Array("dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1")),
- e: Base64URL.stringify(hexStringToUint8Array("010001")),
- d: Base64URL.stringify(hexStringToUint8Array("21950851cdf25320318b305afa0f371f07ae5a44b314ebd729f5dcb15da7fa3947acdd915daed574bd16df88bf85f61060b387172fae6e01262b3864c2d3c22f94e04a8159422b4ed279c48a4c9d767d4966071a5bbf5d043e16ff46ec1ba0716f00bbc97bff5d5693e214e99c9721f12b3ec6282ae2a485721b96ddcf7403fa037d0c57ab463c448de5cc12265add886d311ea8d8a5903fa56c5f1c9cf2eb11cb657a1a7d3e41352dc3e686898c4ce4305e8b638e1b08a2a86cc9eb9866f3499ac77b6136b81cb276d614cfeb7b6ed3f3bc775e46c00066ebeee2cff7166b57520598947ff6210320b288fb4f2c3f8fe97b279414ebf7203000a19fc0424875")),
- p: Base64URL.stringify(hexStringToUint8Array("f123bfe53de97a569d91adcf556fa625ad30f3fd3d811f9e91e6af44b6e780cb0f327829fb21190ae2806646d728cd9b6531132b1ebfef1272993060f1ce70b124393091ee8593b727367edbba009ec5be17c4acee120c841267d47631a16c36a6d1c99973c1b0b5a835bf39feafe8f6421fd9c2a90bc27976659e67bc83124d")),
- q: Base64URL.stringify(hexStringToUint8Array("ea9839b7e37ea89bbda27e4c93471cb4fd92189a0a96bcb4d75693f18a5c2f742af9e36fde679fbd9eae345fa269527b6965021c4bdf54d685bf08960cc976f68dca21cebf44f268a59dab8d1a25e519f5147e1f45fe287d74cf725bec1326d34212c56cf4fffa202f57b68ee8cca943f3c138c4cde33bdf2c9440df65322445")),
- dp: Base64URL.stringify(hexStringToUint8Array("ca0c9b60b8e4a6066756c65d2088419df6253b7b688a85f4f6e964d85dad52a45262867f1e9618069fccd865e9289e46e39e2022944c5c4487d345cf252d460d977d77edfefedbcbae46a23af7fa470f077da0e50942044cb1a360497cc2760ac0f2ad4a2fcd0e84d7a1d94dfdd2658fd9ce18475c1fa75ee0cebad0cf0ac04d")),
- dq: Base64URL.stringify(hexStringToUint8Array("528171233c4e4a6c63b86764f51338846afddbcb2958344c01c4004a1dd828145a1d02a1507def4f58247a64fc10c0a288c1ae895721d78b8f044db7c00d86da55a9b654292ecd768270be69e4bd5922d4effd1f70955f9627e3e19b749e93b40ef3dd1d61d93915e2b09d930b4b1768bfacc0136f39b0cfdfb4d050011e2e65")),
- qi: Base64URL.stringify(hexStringToUint8Array("df2eb2322cc2daabf4d1465508f41521cda7ceff23ebe61d00d441ee728dda5d16c7bf920cd95f34beb4fe32ee817ef3362e0bcd1d1245f7b07793eaa190dc5a37fdaf4c68e2ca13972d7f5148b796b6fb6d7adda07bd2cd13be98cebed1edc6ca412e395350c59a1d842bc4aa2f3c0b243fde7dfd95356f2439251a1172c45e"))
-};
-
-var extractable = true;
-var nonExtractable = false;
-
-debug("Importing an RSA key...");
-crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["decrypt"]).then(function(result) {
- privateKey = result;
-
- debug("Decrypting...");
- encryptedMessage = hexStringToUint8Array("6042e745589af03af87520f93c45d8c35985ada1161a37d822e9f9460fc75fcf0179d8491b8f5d1e4de8ceb31e07c4865c5a3efdbbb69a8803b89ee65a430a5809c707569150b580bb686a94c5541c46adcd827960ce244ff688387d1616e85b4d1780c6483606cf924b54f080cf4154e66829bf6e532481048ec41fadc07d755bb34bb28145219cb30d47d0d618709180e90303ff9ef09018bed3da75761da794811f96bc9e8d7c4ba1b5946bda0bd313faec4c993ed2748eed8cce4bdb520ba7db165f9fe56aa8454d6ff33874feeebf29de2df5b7f00aa1d9fb073fc4067b58dc50624e127f711dde2cc2cfdab4919ccf28c83660dfc227b0f500ec1f904f");
- return crypto.subtle.decrypt("RSAES-PKCS1-v1_5", privateKey, encryptedMessage);
-}).then(function(result) {
- message = result;
- shouldBe("bytesToHexString(new Uint8Array(message))", "'2aacec86f423dd925ec158822a748cbe6c31a0'");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,34 +0,0 @@
</span><del>-Test wrapping and unwrapping an AES key with RSAES-PKCS1-v1_5.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing RSA keys...
-Importing an AES key...
-Wrapping it...
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 256
-PASS unwrappedKey.usages is ['decrypt', 'encrypt']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
-
-Wrapping the same key as JWK...
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 256
-PASS unwrappedKey.usages is ['decrypt', 'encrypt']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaeshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,103 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test wrapping and unwrapping an AES key with RSAES-PKCS1-v1_5.");
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RSA1_5",
- n: Base64URL.stringify(hexStringToUint8Array("dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1")),
- e: Base64URL.stringify(hexStringToUint8Array("010001"))
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RSA1_5",
- n: Base64URL.stringify(hexStringToUint8Array("dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1")),
- e: Base64URL.stringify(hexStringToUint8Array("010001")),
- d: Base64URL.stringify(hexStringToUint8Array("21950851cdf25320318b305afa0f371f07ae5a44b314ebd729f5dcb15da7fa3947acdd915daed574bd16df88bf85f61060b387172fae6e01262b3864c2d3c22f94e04a8159422b4ed279c48a4c9d767d4966071a5bbf5d043e16ff46ec1ba0716f00bbc97bff5d5693e214e99c9721f12b3ec6282ae2a485721b96ddcf7403fa037d0c57ab463c448de5cc12265add886d311ea8d8a5903fa56c5f1c9cf2eb11cb657a1a7d3e41352dc3e686898c4ce4305e8b638e1b08a2a86cc9eb9866f3499ac77b6136b81cb276d614cfeb7b6ed3f3bc775e46c00066ebeee2cff7166b57520598947ff6210320b288fb4f2c3f8fe97b279414ebf7203000a19fc0424875")),
- p: Base64URL.stringify(hexStringToUint8Array("f123bfe53de97a569d91adcf556fa625ad30f3fd3d811f9e91e6af44b6e780cb0f327829fb21190ae2806646d728cd9b6531132b1ebfef1272993060f1ce70b124393091ee8593b727367edbba009ec5be17c4acee120c841267d47631a16c36a6d1c99973c1b0b5a835bf39feafe8f6421fd9c2a90bc27976659e67bc83124d")),
- q: Base64URL.stringify(hexStringToUint8Array("ea9839b7e37ea89bbda27e4c93471cb4fd92189a0a96bcb4d75693f18a5c2f742af9e36fde679fbd9eae345fa269527b6965021c4bdf54d685bf08960cc976f68dca21cebf44f268a59dab8d1a25e519f5147e1f45fe287d74cf725bec1326d34212c56cf4fffa202f57b68ee8cca943f3c138c4cde33bdf2c9440df65322445")),
- dp: Base64URL.stringify(hexStringToUint8Array("ca0c9b60b8e4a6066756c65d2088419df6253b7b688a85f4f6e964d85dad52a45262867f1e9618069fccd865e9289e46e39e2022944c5c4487d345cf252d460d977d77edfefedbcbae46a23af7fa470f077da0e50942044cb1a360497cc2760ac0f2ad4a2fcd0e84d7a1d94dfdd2658fd9ce18475c1fa75ee0cebad0cf0ac04d")),
- dq: Base64URL.stringify(hexStringToUint8Array("528171233c4e4a6c63b86764f51338846afddbcb2958344c01c4004a1dd828145a1d02a1507def4f58247a64fc10c0a288c1ae895721d78b8f044db7c00d86da55a9b654292ecd768270be69e4bd5922d4effd1f70955f9627e3e19b749e93b40ef3dd1d61d93915e2b09d930b4b1768bfacc0136f39b0cfdfb4d050011e2e65")),
- qi: Base64URL.stringify(hexStringToUint8Array("df2eb2322cc2daabf4d1465508f41521cda7ceff23ebe61d00d441ee728dda5d16c7bf920cd95f34beb4fe32ee817ef3362e0bcd1d1245f7b07793eaa190dc5a37fdaf4c68e2ca13972d7f5148b796b6fb6d7adda07bd2cd13be98cebed1edc6ca412e395350c59a1d842bc4aa2f3c0b243fde7dfd95356f2439251a1172c45e"))
-};
-var wrapAlgorithm = {name: "RSAES-PKCS1-v1_5"};
-var extractable = true;
-var nonExtractable = false;
-
-debug("Importing RSA keys...");
-crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["wrapKey", "unwrapKey"]).then(function(result) {
- publicKey = result;
- return crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["wrapKey", "unwrapKey"]);
-}).then(function(result) {
- privateKey = result;
-
- debug("Importing an AES key...");
- aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
- return crypto.subtle.importKey("raw", aesKeyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
-}).then(function(result) {
- aesKey = result;
- debug("Wrapping it...");
-
- return crypto.subtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
-
- debug("Unwrapping it...");
- return crypto.subtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
-}).then(function(result) {
- unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'secret'");
- shouldBe("unwrappedKey.extractable", "true");
- shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
- shouldBe("unwrappedKey.algorithm.length", "256");
- shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
-
- debug("Exporting it...");
- return crypto.subtle.exportKey("raw", unwrappedKey);
-}).then(function(result) {
- unwrappedKeyData = result;
- shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData)");
-
- debug("\nWrapping the same key as JWK...");
- return crypto.subtle.wrapKey("jwk", aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
-
- debug("Unwrapping it...");
- return crypto.subtle.unwrapKey("jwk", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
-}).then(function(result) {
- unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'secret'");
- shouldBe("unwrappedKey.extractable", "true");
- shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
- shouldBe("unwrappedKey.algorithm.length", "256");
- shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
-
- debug("Exporting it...");
- return crypto.subtle.exportKey("raw", unwrappedKey);
-}).then(function(result) {
- unwrappedKeyData = result;
- shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData)");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,24 +0,0 @@
</span><del>-Test generating an RSA key pair for RSASSA-PKCS1-v1_5.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Generating a key pair...
-PASS keyPair.toString() is '[object KeyPair]'
-PASS keyPair.publicKey.type is 'public'
-PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS keyPair.publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
-PASS keyPair.publicKey.algorithm.hash is undefined.
-PASS keyPair.privateKey.type is 'private'
-PASS keyPair.privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS keyPair.privateKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
-PASS keyPair.privateKey.algorithm.hash is undefined.
-
-Testing that custom attributes on keys survive garbage collection...
-PASS keyPair.publicKey.foo is 'bar'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponentexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,16 +0,0 @@
</span><del>-Test generating an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Generating a key pair...
-PASS keyPair.toString() is '[object KeyPair]'
-PASS keyPair.publicKey.type is 'public'
-PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS keyPair.publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
-PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html (206882 => 206883)</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-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,40 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test generating an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes.");
-
-jsTestIsAsync = true;
-
-var algorithmKeyGen = {
- name: "RSASSA-PKCS1-v1_5",
- // RsaKeyGenParams
- modulusLength: 2048,
- publicExponent: new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01]), // Equivalent to 65537
-};
-var extractable = true;
-
-debug("Generating a key pair...");
-crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
- keyPair = result;
- shouldBe("keyPair.toString()", "'[object KeyPair]'");
- shouldBe("keyPair.publicKey.type", "'public'");
- shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
- shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,54 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test generating an RSA key pair for RSASSA-PKCS1-v1_5.");
-
-jsTestIsAsync = true;
-
-var algorithmKeyGen = {
- name: "RSASSA-PKCS1-v1_5",
- // RsaKeyGenParams
- modulusLength: 2048,
- publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
-};
-var extractable = true;
-
-debug("Generating a key pair...");
-crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
- keyPair = result;
- shouldBe("keyPair.toString()", "'[object KeyPair]'");
- shouldBe("keyPair.publicKey.type", "'public'");
- shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
- shouldBeUndefined("keyPair.publicKey.algorithm.hash");
- shouldBe("keyPair.privateKey.type", "'private'");
- shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
- shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
- shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
- shouldBeUndefined("keyPair.privateKey.algorithm.hash");
-
- debug("\nTesting that custom attributes on keys survive garbage collection...");
- keyPair.publicKey.foo = "bar";
- gc();
- setTimeout(function() {
- gc();
- setTimeout(function() {
- shouldBe("keyPair.publicKey.foo", "'bar'");
- finishJSTest();
- }, 0);
- }, 0);
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,26 +0,0 @@
</span><del>-Test importing an RSA key for RSASSA-PKCS1-v1_5.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a public key...
-PASS publicKey.toString() is '[object CryptoKey]'
-PASS publicKey.type is 'public'
-PASS publicKey.usages is ['sign','verify']
-PASS publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
-PASS publicKey.algorithm.hash.name is 'SHA-256'
-
-Importing a private key...
-PASS privateKey.toString() is '[object CryptoKey]'
-PASS privateKey.type is 'private'
-PASS privateKey.usages is ['sign','verify']
-PASS privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS privateKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(privateKey.algorithm.publicExponent) is '010001'
-PASS privateKey.algorithm.hash.name is 'SHA-256'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwksmallkeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,11 +0,0 @@
</span><del>-A key of size 2048 bits or larger MUST be used with RS256, RS384, RS512 JWK algorithms.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"]) threw exception TypeError: Key size is not valid for RS256.
-PASS crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"]) threw exception TypeError: Key size is not valid for RS512.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwksmallkeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("A key of size 2048 bits or larger MUST be used with RS256, RS384, RS512 JWK algorithms.");
-
-var extractable = true;
-
-// openssl genrsa 1024 >1024.pem
-// openssl asn1parse -in 1024.pem
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: Base64URL.stringify(hexStringToUint8Array("B7F103F8412CCD26F5D54FC3157CD8CE1F134F4EABF0A042350BDD7F00FEA2B77EEF19915B10AA2417BB2CB4EC1D57B9661A20072469B9DF9C6E89CB35CCC8543CC40770DCC30D0BBFF1BF9DA1E2549F40476EDADB9312985DAE8C7527C1C12AAFEDF4584989968CDCC9EFEB197438C534D1BFAAC30B1D41F75EADB86CC581B9")),
- e: Base64URL.stringify(hexStringToUint8Array("010001"))
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RS512",
- n: Base64URL.stringify(hexStringToUint8Array("B7F103F8412CCD26F5D54FC3157CD8CE1F134F4EABF0A042350BDD7F00FEA2B77EEF19915B10AA2417BB2CB4EC1D57B9661A20072469B9DF9C6E89CB35CCC8543CC40770DCC30D0BBFF1BF9DA1E2549F40476EDADB9312985DAE8C7527C1C12AAFEDF4584989968CDCC9EFEB197438C534D1BFAAC30B1D41F75EADB86CC581B9")),
- e: Base64URL.stringify(hexStringToUint8Array("010001")),
- d: Base64URL.stringify(hexStringToUint8Array("5BA6F4F26B0F36BDB5FA6EBEE6E3096853259CFBB742B3A7A9A4DADDE0920063EC149929CB3557819A6D824E37E43B04BF323F492FC49A8028031017B81BECA8EC2A85ABCF193501D80DC251DB8863B8673D8B6772DB2D2AE08CD1829C3F542141461CACE4E8A1F112AD13FF4A4DD865A89AEA94E984D487E5798EF07643B9CD")),
- p: Base64URL.stringify(hexStringToUint8Array("E06BFE5722A68E5D597DD8DB937483CBA352AB817209275ADAD103772B7A8EF4EA946311A2B51805959818CEB362F257D6998B475FEA9E34F2A30205B5F5A7FF")),
- q: Base64URL.stringify(hexStringToUint8Array("D1D2DBDB1F4DCBFE8D16CDD2CF83C7B5FADFC7891F22FC527BF208F81B92F2543569C3AD22224B82D407DEB65F651D09D2558FEE8BC6E5DA51F6F13206CC1647")),
- dp: Base64URL.stringify(hexStringToUint8Array("73ECB4F3D3AD4F6ABEF877D56C84CA339D88ED98AF0C356D040CE58A60462DA42BAC3CC47654AF34EB4226C656F96C8F9D05B1614C1588657754668E06A0FF87")),
- dq: Base64URL.stringify(hexStringToUint8Array("5B9C5ACDB33F3E5FE7AE1B337DD325B138D5D7C2F0CB4FAB9BDE333850A1BA183631F5737441D102501D178A3CE062EB54E072B54E660B19654C12472B5C9425")),
- qi: Base64URL.stringify(hexStringToUint8Array("D6A920B241178923C59BCBD1A815764619225A90F2C090A9FBD594A61561542D0DF179590413C26C8A72FC6E14EC63A377169970671B3A1EB5E4F4DF1A4CA725"))
-};
-
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"])');
-shouldThrow('crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"])');
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,65 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test importing an RSA key for RSASSA-PKCS1-v1_5.");
-
-jsTestIsAsync = true;
-
-var extractable = 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"
-};
-
-debug("Importing a public key...");
-crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"]).then(function(result) {
- publicKey = result;
- shouldBe("publicKey.toString()", "'[object CryptoKey]'");
- shouldBe("publicKey.type", "'public'");
- shouldBe("publicKey.usages", "['sign','verify']");
- 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'");
- debug("\nImporting a private key...");
- return crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"]);
-}).then(function(result) {
- privateKey = result;
- shouldBe("privateKey.toString()", "'[object CryptoKey]'");
- shouldBe("privateKey.type", "'private'");
- shouldBe("privateKey.usages", "['sign','verify']");
- 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'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,21 +0,0 @@
</span><del>-Test importing an RSA key for RSASSA-PKCS1-v1_5.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing a public key...
-
-Importing a private key...
-
-Signing some text...
-PASS bytesToHexString(new Uint8Array(signature)) is '0fd9a8aef4cc1876c0b762545336c6d1fb315ae16ae4b5e4bf34d384d8585ea7a01e76ea09ee7f7ee8d1c122e7dd15b7c94a573b2aa07203e8d13bc6fd16156cd8e5f0c15a15dccb62d152127fca09882fb53bc3e60ab586d15b95cf411e3aab4a1c231a7e91aab09ee3d4b13d11e97505ddff77683470da510ee76e8bd530c56a85f901626a5a710f716f113dfe9cf6c473ee16fa248aea3480a1033abe30f4c1243289a661e64d7818b55698280688097135968c6d4b029496d85cab2a67e4696737781f70e4392c7df71bbd6c92465947f029a1de48160aced11b5721b1cd25039fe2c16c2b38de73df3b9a83e3ea755fd0cfe51ca06b61fadf6d84677f95'
-
-Verifying the signature...
-PASS verificationResult is true
-
-Verifying a bad signature...
-PASS verificationResult is false
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,69 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test importing an RSA key for RSASSA-PKCS1-v1_5.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: Base64URL.stringify(hexStringToUint8Array("ADC0940AFECE7351D56A6D432210B3AA49D38566B03A9F102E4F198B2DA9D740728D01426A3A058B2B805A5F91D565D969FE318AD2D1ADA713F5A829CC8CDCF8C6CB4872068164063B6D651A2226CB97ED67E0FC6C702A473DB2D79A730F8738084A2EED74922C3A119D1D101B932C0E10FAB36815F66C0792BB640B1B4C59D062FBBEDAB3CC069A535195D70E4A06432CAF149C24A00353A0B99F7CF5B17273CB4E38421BD315127CF4B3DCB3D20A7C98CFAF1A0E398A55E347FA283CE7B39273259B1B2132DC18B0EB8AAE9F78EE525356B09DF39E090E76D7985B2B71E50AF85CA36CE91F8CCB2ABBD8A529D369890D98A2CA2825C4C2FF8B7FBF09E79C0B")),
- e: Base64URL.stringify(hexStringToUint8Array("010001")),
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RS256",
- n: Base64URL.stringify(hexStringToUint8Array("ADC0940AFECE7351D56A6D432210B3AA49D38566B03A9F102E4F198B2DA9D740728D01426A3A058B2B805A5F91D565D969FE318AD2D1ADA713F5A829CC8CDCF8C6CB4872068164063B6D651A2226CB97ED67E0FC6C702A473DB2D79A730F8738084A2EED74922C3A119D1D101B932C0E10FAB36815F66C0792BB640B1B4C59D062FBBEDAB3CC069A535195D70E4A06432CAF149C24A00353A0B99F7CF5B17273CB4E38421BD315127CF4B3DCB3D20A7C98CFAF1A0E398A55E347FA283CE7B39273259B1B2132DC18B0EB8AAE9F78EE525356B09DF39E090E76D7985B2B71E50AF85CA36CE91F8CCB2ABBD8A529D369890D98A2CA2825C4C2FF8B7FBF09E79C0B")),
- e: Base64URL.stringify(hexStringToUint8Array("010001")),
- d: Base64URL.stringify(hexStringToUint8Array("78D2D2DFB682CFB45748D3C3FC3B4B049EA3E53F1C4B17734410A33DA23A59C1AA269D7A96ADD44F0BA80CB02A940F681989B6DFC76C216A6EB9C3FF950B5B59EFBB4A9C6823AFEF99819FED85541EFD7E0C5F6A88E992ACC99DC4C9D53B361763C45A4FAB613E39FF27971F2D5DB123F2F0B2B32D9A9752C8D9605F4CD3521C2DB9A86000A3040A16231F61278C7747C3AB18DBEC00A5D71023B50B134A28E51CDB419A66BA170DF618817342F7861174AA8E7499B974DBFEB9FC643B0E95645C1C4D81104BCE53DA6E6CF31B6A0085F79F2E0626482D68A5A0A45C4EAF45640D58D2F8E5164D64560CDEEA0982138CA867A870CD01A63742847ACF3A516F49")),
- p: Base64URL.stringify(hexStringToUint8Array("E26893B808CA31E1F9B89E4A077F7B414C216E46048126DC0369A27E64A4BC4DB4D7C81BE79AA40472B5795AF27F5FE6E372CD95CE8EFDA93A81FCDD64866F4B93421A33E5D2AD3DA65529BBCA85392B2907003AEEA187EFA9459592E7FDDE328254BBC1F2EBBB8FF962CF2A2CBB3E0EA54BBE2C29A2C3A7CB25AAC0CE405E9D")),
- q: Base64URL.stringify(hexStringToUint8Array("C4762BCE48AFB669F3FEC19C867586734ABEA433A42A2729B51A6FDA93052085F19C55F968C7845C866356E8D7B70532D5494520DD866494AFCB9289EFD9AEFD7C8D9C51CCCDE747F80DDE7B7BBC875514AD917EBD4BB5FDEE14FF1EBB34DD5D79DCD448ACA737BA459773A4B9284C056195F9CC3338F75C5407D5B9997150C7")),
- dp: Base64URL.stringify(hexStringToUint8Array("7C1CC3CD80D40660501A8A7B1E7D1DBDFFD3DBB57A46AA5CB56A34EF809065C15B3F66AD155B4A4A3DEF8964F7C62776547CDC8220C775FA4CDE71159443B5C302289C6092BDD8C610E66288554E8EB640395C40F20B8E8F2C85BEA6D791ED3A5703C8215BDF29E494DB3BA16CFFFFD6DB7A17F7F1A30E0A6F6C689C64F41869")),
- dq: Base64URL.stringify(hexStringToUint8Array("8E61360E220F761C0380B5C042921A06A43CD5B3B75DF553FCB4542C0C30C3094FB90575E3C1F4E33961F5327A6361991D8A2457553478E0692717E46FB74B62DA49A6E8818D17F8C88504A06964908FD09499C5485AFE62319175F347A96064C6548C64BEFBD11F662004E7746907EF3E71FABF4AC016450B81421B6860FF31")),
- qi: Base64URL.stringify(hexStringToUint8Array("6025FFA4BC1B3010354E1547D167309A7CADA8D72B3021304E6EC1C80D9E53A9D66D0AD42EF7FB9BDFE4CDF2D4723B27A405650501B924C5CCCB44AAE29B706F2C2C6B9F86F0A00E38E4762F7BF8842F84CACF5FB6014CFF78B4A38D1E7901F86F785A3DB9EDAC878C83C23394EB9560A7FDFB642E283A1679175DECDB1DC539"))
-};
-
-var data = asciiToUint8Array("Hello, world!");
-
-debug("Importing a public key...");
-crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"]).then(function(result) {
- publicKey = result;
- debug("\nImporting a private key...");
- return crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"]);
-}).then(function(result) {
- privateKey = result;
- debug("\nSigning some text...");
- return crypto.subtle.sign({ name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" }, privateKey, data);
-}).then(function(result) {
- signature = result;
- shouldBe("bytesToHexString(new Uint8Array(signature))", "'0fd9a8aef4cc1876c0b762545336c6d1fb315ae16ae4b5e4bf34d384d8585ea7a01e76ea09ee7f7ee8d1c122e7dd15b7c94a573b2aa07203e8d13bc6fd16156cd8e5f0c15a15dccb62d152127fca09882fb53bc3e60ab586d15b95cf411e3aab4a1c231a7e91aab09ee3d4b13d11e97505ddff77683470da510ee76e8bd530c56a85f901626a5a710f716f113dfe9cf6c473ee16fa248aea3480a1033abe30f4c1243289a661e64d7818b55698280688097135968c6d4b029496d85cab2a67e4696737781f70e4392c7df71bbd6c92465947f029a1de48160aced11b5721b1cd25039fe2c16c2b38de73df3b9a83e3ea755fd0cfe51ca06b61fadf6d84677f95'");
-
- debug("\nVerifying the signature...");
- return crypto.subtle.verify({ name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" }, publicKey, signature, data);
-}).then(function(result) {
- verificationResult = result;
- shouldBe("verificationResult", "true");
- debug("\nVerifying a bad signature...");
- return crypto.subtle.verify({ name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" }, publicKey, new Uint8Array(256), data);
-}).then(function(result) {
- verificationResult = result;
- shouldBe("verificationResult", "false");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha1expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-1-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-1-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-1-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,16 +0,0 @@
</span><del>-Test crypto.subtle.digest.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-SHA1 of []
-PASS bytesToHexString(new Uint8Array(digest)) is 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
-SHA1 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is '5ba93c9db0cff93f52b521d7420e43f6eda2784f'
-SHA1 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '2c7e7c384f7829694282b1e3a6216def8082d055'
-PASS crypto.subtle.generateKey('sha-1') threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha1html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-1.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-1.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-1.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test crypto.subtle.digest.");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- debug("SHA1 of []");
- return crypto.subtle.digest('sha-1', new Uint8Array([]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'da39a3ee5e6b4b0d3255bfef95601890afd80709'");
-
- debug("SHA1 of [0x0]")
- return crypto.subtle.digest({name: 'sha-1'}, new Uint8Array([0]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'5ba93c9db0cff93f52b521d7420e43f6eda2784f'");
-
- debug("SHA1 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
- var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
- return crypto.subtle.digest({name: 'sha-1'}, data);
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'2c7e7c384f7829694282b1e3a6216def8082d055'");
-
- // All SHA-1 can do is digest.
- shouldThrow("crypto.subtle.generateKey('sha-1')");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha224expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-224-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-224-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-224-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test crypto.subtle.digest.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-SHA224 of []
-PASS bytesToHexString(new Uint8Array(digest)) is 'd14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f'
-SHA224 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is 'fff9292b4201617bdc4d3053fce02734166a683d7d858a7f5f59b073'
-SHA224 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '767d0cdc11079ba8dca276df5c4b85507de67dce47eda4cd9196d312'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha224html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-224.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-224.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-224.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test crypto.subtle.digest.");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- debug("SHA224 of []");
- return crypto.subtle.digest('sha-224', new Uint8Array([]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f'");
-
- debug("SHA224 of [0x0]")
- return crypto.subtle.digest({name: 'sha-224'}, new Uint8Array([0]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'fff9292b4201617bdc4d3053fce02734166a683d7d858a7f5f59b073'");
-
- debug("SHA224 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
- var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
- return crypto.subtle.digest({name: 'sha-224'}, data);
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'767d0cdc11079ba8dca276df5c4b85507de67dce47eda4cd9196d312'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha256expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-256-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-256-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-256-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test crypto.subtle.digest.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-SHA256 of []
-PASS bytesToHexString(new Uint8Array(digest)) is 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
-SHA256 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is '6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d'
-SHA256 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '78a6273103d17c39a0b6126e226cec70e33337f4bc6a38067401b54a33e78ead'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha256html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-256.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-256.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-256.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test crypto.subtle.digest.");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- debug("SHA256 of []");
- return crypto.subtle.digest('sha-256', new Uint8Array([]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'");
-
- debug("SHA256 of [0x0]")
- return crypto.subtle.digest({name: 'sha-256'}, new Uint8Array([0]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d'");
-
- debug("SHA256 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
- var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
- return crypto.subtle.digest({name: 'sha-256'}, data);
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'78a6273103d17c39a0b6126e226cec70e33337f4bc6a38067401b54a33e78ead'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha384expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-384-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-384-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-384-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test crypto.subtle.digest.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-SHA384 of []
-PASS bytesToHexString(new Uint8Array(digest)) is '38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b'
-SHA384 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is 'bec021b4f368e3069134e012c2b4307083d3a9bdd206e24e5f0d86e13d6636655933ec2b413465966817a9c208a11717'
-SHA384 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '89bfcf569ae4af718510da78c67414109f5739bb5c40d51c9c8c50e2b2cee86f2f80c8b9d68f7c01201a0714572fe602'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha384html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-384.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-384.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-384.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test crypto.subtle.digest.");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- debug("SHA384 of []");
- return crypto.subtle.digest('sha-384', new Uint8Array([]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b'");
-
- debug("SHA384 of [0x0]")
- return crypto.subtle.digest({name: 'sha-384'}, new Uint8Array([0]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'bec021b4f368e3069134e012c2b4307083d3a9bdd206e24e5f0d86e13d6636655933ec2b413465966817a9c208a11717'");
-
- debug("SHA384 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
- var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
- return crypto.subtle.digest({name: 'sha-384'}, data);
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'89bfcf569ae4af718510da78c67414109f5739bb5c40d51c9c8c50e2b2cee86f2f80c8b9d68f7c01201a0714572fe602'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha512expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-512-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-512-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-512-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test crypto.subtle.digest.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-SHA512 of []
-PASS bytesToHexString(new Uint8Array(digest)) is 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'
-SHA512 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is 'b8244d028981d693af7b456af8efa4cad63d282e19ff14942c246e50d9351d22704a802a71c3580b6370de4ceb293c324a8423342557d4e5c38438f0e36910ee'
-SHA512 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '8ffaee0cccc162851faf051ae38667eefd423c0164c50055f8ade00afc3705e3cdeb9900004b0e426ca66ab63aa3b99b075273f44fd37c22a3555c6fd1f37ccb'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha512html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-512.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-512.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-512.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test crypto.subtle.digest.");
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
- debug("SHA512 of []");
- return crypto.subtle.digest('sha-512', new Uint8Array([]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'");
-
- debug("SHA512 of [0x0]")
- return crypto.subtle.digest({name: 'sha-512'}, new Uint8Array([0]));
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'b8244d028981d693af7b456af8efa4cad63d282e19ff14942c246e50d9351d22704a802a71c3580b6370de4ceb293c324a8423342557d4e5c38438f0e36910ee'");
-
- debug("SHA512 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
- var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
- return crypto.subtle.digest({name: 'sha-512'}, data);
-}).then(function(result) {
- digest = result;
- shouldBe("bytesToHexString(new Uint8Array(digest))", "'8ffaee0cccc162851faf051ae38667eefd423c0164c50055f8ade00afc3705e3cdeb9900004b0e426ca66ab63aa3b99b075273f44fd37c22a3555c6fd1f37ccb'");
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleunimplementedunwrapcrashexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,9 +0,0 @@
</span><del>-Make sure that unwrap does not cause a crash.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleunimplementedunwrapcrashhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,26 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Make sure that unwrap does not cause a crash.");
-
-jsTestIsAsync = true;
-
-crypto.subtle.generateKey({name: "AES-KW", length: 256}, false, ["wrapKey"]).then(function(wrappingKey) {
- return crypto.subtle.generateKey({name: "HMAC", hash: {name: "SHA-256"}}, true, ["sign", "verify"]).then(function(aesKey) {
- return crypto.subtle.wrapKey("raw", aesKey, wrappingKey, {name: "AES-KW"});
- });
-}).then(finishJSTest, finishJSTest); // OK if the browser does not crash.
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleunwrapKeycheckusageexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-CONSOLE MESSAGE: line 1: Key usages do not include 'unwrapKey'
-Verify that usage is respected in unwrapKey operation.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing RSA keys...
-Importing an AES key...
-Wrapping it...
-Unwrapping it...
-PASS crypto.subtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleunwrapKeycheckusagehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,67 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Verify that usage is respected in unwrapKey operation.");
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB"
-};
-
-var privateKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- 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 wrapAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
-var extractable = true;
-var nonExtractable = false;
-
-debug("Importing RSA keys...");
-crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["wrapKey"]).then(function(result) {
- publicKey = result;
- return crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["encrypt", "decrypt", "wrapKey"]);
-}).then(function(result) {
- privateKey = result;
-
- debug("Importing an AES key...");
- aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
- return crypto.subtle.importKey("raw", aesKeyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
-}).then(function(result) {
- aesKey = result;
-
- debug("Wrapping it...");
- return crypto.subtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
- wrappedKey = result;
-
- debug("Unwrapping it...");
- // privateKey lacks unwrapKey usage.
- shouldThrow('crypto.subtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"])');
-
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlewrapKeycheckusageexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-CONSOLE MESSAGE: line 1: Key usages do not include 'wrapKey'
-Verify that usage is respected in wrapKey operation.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Importing an RSA key...
-Importing an AES key...
-Wrapping it...
-PASS crypto.subtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlewrapKeycheckusagehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Verify that usage is respected in wrapKey operation.");
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
- kty: "RSA",
- alg: "RSA-OAEP",
- n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
- e: "AQAB"
-};
-
-var wrapAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
-var extractable = true;
-var nonExtractable = false;
-
-debug("Importing an RSA key...");
-crypto.subtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["encrypt", "decrypt", "unwrapKey"]).then(function(result) {
- publicKey = result;
-
- debug("Importing an AES key...");
- aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
- return crypto.subtle.importKey("raw", aesKeyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
-}).then(function(result) {
- aesKey = result;
-
- debug("Wrapping it...");
- // publicKey lacks wrapKey usage.
- shouldThrow('crypto.subtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm)');
- finishJSTest();
-});
-</script>
-
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbc192encryptdecryptexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbc192encryptdecryptexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test AES-CBC encrypt and decrypt functions with a 256 bit key.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a raw AES key from string literal...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 192
+PASS key.usages is ['decrypt', 'encrypt']
+Using the key to encrypt plaintext...
+PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'
+Decrypting it back...
+PASS new Uint8Array(decryptionResult) is plaintext
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbc192encryptdecrypthtmlfromrev206882trunkLayoutTestscryptosubtleaescbc192encryptdecrypthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test AES-CBC encrypt and decrypt functions with a 256 bit key.");
+
+jsTestIsAsync = true;
+
+var keyData = hexStringToUint8Array("8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b");
+var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
+var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
+var extractable = true;
+
+debug("Importing a raw AES key from string literal...");
+crypto.webkitSubtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
+ key = result;
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'AES-CBC'");
+ shouldBe("key.algorithm.length", "192");
+ shouldBe("key.usages", "['decrypt', 'encrypt']");
+
+ debug("Using the key to encrypt plaintext...");
+ return crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
+}).then(function(result) {
+ encryptionResult = result;
+ shouldBe("bytesToHexString(new Uint8Array(encryptionResult))", "'4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'");
+
+ debug("Decrypting it back...");
+ return crypto.webkitSubtle.decrypt({name: "aes-cbc", iv: iv}, key, result);
+}).then(function(result) {
+ decryptionResult = result;
+ shouldBe("new Uint8Array(decryptionResult)", "plaintext");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbc256encryptdecryptexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbc256encryptdecryptexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test AES-CBC encrypt and decrypt functions with a 256 bit key.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a raw AES key from string literal...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 256
+PASS key.usages is ['decrypt', 'encrypt']
+Using the key to encrypt plaintext...
+PASS bytesToHexString(new Uint8Array(encryptionResult)) is 'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644'
+Decrypting it back...
+PASS new Uint8Array(decryptionResult) is plaintext
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbc256encryptdecrypthtmlfromrev206882trunkLayoutTestscryptosubtleaescbc256encryptdecrypthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test AES-CBC encrypt and decrypt functions with a 256 bit key.");
+
+jsTestIsAsync = true;
+
+var keyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
+var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
+var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
+var extractable = true;
+
+debug("Importing a raw AES key from string literal...");
+crypto.webkitSubtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
+ key = result;
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'AES-CBC'");
+ shouldBe("key.algorithm.length", "256");
+ shouldBe("key.usages", "['decrypt', 'encrypt']");
+
+ debug("Using the key to encrypt plaintext...");
+ return crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
+}).then(function(result) {
+ encryptionResult = result;
+ shouldBe("bytesToHexString(new Uint8Array(encryptionResult))", "'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644'");
+
+ debug("Decrypting it back...");
+ return crypto.webkitSubtle.decrypt({name: "aes-cbc", iv: iv}, key, result);
+}).then(function(result) {
+ decryptionResult = result;
+ shouldBe("new Uint8Array(decryptionResult)", "plaintext");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcencryptdecryptexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcencryptdecryptexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+Test AES-CBC encrypt and decrypt functions.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a raw AES key from string literal...
+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']
+Using the key to encrypt plaintext...
+PASS bytesToHexString(new Uint8Array(encryptionResult)) is '7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012'
+Decrypting it back...
+PASS new Uint8Array(decryptionResult) is plaintext
+Testing initialization vector bindings...
+PASS crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: null}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+PASS crypto.webkitSubtle.encrypt({name: 'AES-CBC'}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+PASS crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: 3}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+PASS crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: new Uint8Array([0])}, key, plaintext) threw exception Error: AES-CBC initialization data must be 16 bytes.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcencryptdecryptwithpaddingexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddingexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test AES-CBC encrypt and decrypt functions on a plaintext that is not a multiple of block size in length.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a raw AES key from string literal...
+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']
+Using the key to encrypt plaintext...
+PASS bytesToHexString(new Uint8Array(cyphertext)) is '630199c5f202cc7167bb84c6c72b349d'
+Decrypting it back...
+PASS new Uint8Array(decryptionResult) is plaintext
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcencryptdecryptwithpaddinghtmlfromrev206882trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddinghtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test AES-CBC encrypt and decrypt functions on a plaintext that is not a multiple of block size in length.");
+
+jsTestIsAsync = true;
+
+var keyData = hexStringToUint8Array("2b7e151628aed2a6abf7158809cf4f3c");
+var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
+var plaintext = asciiToUint8Array("test");
+var extractable = true;
+
+debug("Importing a raw AES key from string literal...");
+crypto.webkitSubtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
+ key = result;
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'AES-CBC'");
+ shouldBe("key.algorithm.length", "128");
+ shouldBe("key.usages", "['decrypt', 'encrypt']");
+
+ debug("Using the key to encrypt plaintext...");
+ return crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
+}).then(function(result) {
+ cyphertext = result;
+ shouldBe("bytesToHexString(new Uint8Array(cyphertext))", "'630199c5f202cc7167bb84c6c72b349d'");
+
+ debug("Decrypting it back...");
+ return crypto.webkitSubtle.decrypt({name: "aes-cbc", iv: iv}, key, result);
+}).then(function(result) {
+ decryptionResult = result;
+ shouldBe("new Uint8Array(decryptionResult)", "plaintext");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcencryptdecrypthtmlfromrev206882trunkLayoutTestscryptosubtleaescbcencryptdecrypthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test AES-CBC encrypt and decrypt functions.");
+
+jsTestIsAsync = true;
+
+var keyData = hexStringToUint8Array("2b7e151628aed2a6abf7158809cf4f3c");
+var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
+var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
+var extractable = true;
+
+debug("Importing a raw AES key from string literal...");
+crypto.webkitSubtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
+ key = result;
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'AES-CBC'");
+ shouldBe("key.algorithm.length", "128");
+ shouldBe("key.usages", "['decrypt', 'encrypt']");
+
+ debug("Using the key to encrypt plaintext...");
+ return crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
+}).then(function(result) {
+ encryptionResult = result;
+ shouldBe("bytesToHexString(new Uint8Array(encryptionResult))", "'7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012'");
+
+ debug("Decrypting it back...");
+ return crypto.webkitSubtle.decrypt({name: "aes-cbc", iv: iv}, key, result);
+}).then(function(result) {
+ decryptionResult = result;
+ shouldBe("new Uint8Array(decryptionResult)", "plaintext");
+
+ debug("Testing initialization vector bindings...");
+ shouldThrow("crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: null}, key, plaintext)");
+ shouldThrow("crypto.webkitSubtle.encrypt({name: 'AES-CBC'}, key, plaintext)");
+ shouldThrow("crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: 3}, key, plaintext)");
+ shouldThrow("crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: new Uint8Array([0])}, key, plaintext)");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcgeneratekeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test generating an AES key using AES-CBC algorithm.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS crypto.webkitSubtle.generateKey("aes-cbc", extractable, ["encrypt", "decrypt"]) threw exception TypeError: Type error.
+PASS crypto.webkitSubtle.generateKey({name: "aes-cbc"}, extractable, ["encrypt", "decrypt"]) threw exception TypeError: Value NaN is outside the range [0, 65535].
+PASS crypto.webkitSubtle.generateKey({name: "aes-cbc", length: undefined}, extractable, ["encrypt", "decrypt"]) threw exception TypeError: Value NaN is outside the range [0, 65535].
+PASS crypto.webkitSubtle.generateKey({name: "aes-cbc", length: {}}, extractable, ["encrypt", "decrypt"]) threw exception TypeError: Value NaN is outside the range [0, 65535].
+Generating a key...
+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="trunkLayoutTestscryptowebkitSubtleaescbcgeneratekeyhtmlfromrev206882trunkLayoutTestscryptosubtleaescbcgeneratekeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test generating an AES key using AES-CBC algorithm.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+shouldThrow('crypto.webkitSubtle.generateKey("aes-cbc", extractable, ["encrypt", "decrypt"])');
+shouldThrow('crypto.webkitSubtle.generateKey({name: "aes-cbc"}, extractable, ["encrypt", "decrypt"])');
+shouldThrow('crypto.webkitSubtle.generateKey({name: "aes-cbc", length: undefined}, extractable, ["encrypt", "decrypt"])');
+shouldThrow('crypto.webkitSubtle.generateKey({name: "aes-cbc", length: {}}, extractable, ["encrypt", "decrypt"])');
+
+debug("Generating a key...");
+crypto.webkitSubtle.generateKey({name: "aes-cbc", length: 128}, extractable, ["encrypt", "decrypt"]).then(function(result) {
+ key = result;
+
+ 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();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcimportjwkexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcimportjwkexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test importing a JWK key for AES-CBC.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a key...
+
+PASS key.type is 'secret'
+PASS key.extractable is false
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 192
+PASS key.usages is ["encrypt"]
+
+Using the key to encrypt plaintext...
+PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcimportjwkhtmlfromrev206882trunkLayoutTestscryptosubtleaescbcimportjwkhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test importing a JWK key for AES-CBC.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
+var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
+
+var jwkKey = {
+ "kty": "oct",
+ "alg": "A192CBC",
+ "use": "enc",
+ "ext": true,
+ "k": "jnOw99oOZFLIEPMrgJB55WL46tJSLGt7"
+};
+
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
+
+debug("Importing a key...\n");
+crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, null, false, ["encrypt"]).then(function(result) {
+ key = result;
+
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "false");
+ shouldBe("key.algorithm.name", "'AES-CBC'");
+ shouldBe("key.algorithm.length", "192");
+ shouldBe("key.usages", '["encrypt"]');
+
+ debug("\nUsing the key to encrypt plaintext...");
+ return crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext);
+}).then(function(result) {
+ encryptionResult = result;
+ shouldBe("bytesToHexString(new Uint8Array(encryptionResult))", "'4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcinvalidlengthexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcinvalidlengthexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+Test an unsupported AES key length.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a raw AES key from string literal...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 176
+PASS key.usages is ['decrypt', 'encrypt']
+Using the key to encrypt plaintext...
+Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcinvalidlengthhtmlfromrev206882trunkLayoutTestscryptosubtleaescbcinvalidlengthhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test an unsupported AES key length.");
+
+jsTestIsAsync = true;
+
+var keyData = hexStringToUint8Array("8e73b0f7da0e6452c810f32b809079e562f8ead2522c");
+var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
+var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
+var extractable = true;
+
+debug("Importing a raw AES key from string literal...");
+crypto.webkitSubtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt"]).then(function(result) {
+ key = result;
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'AES-CBC'");
+ shouldBe("key.algorithm.length", "176");
+ shouldBe("key.usages", "['decrypt', 'encrypt']");
+
+ debug("Using the key to encrypt plaintext...");
+ return crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, [plaintext]);
+}).then(undefined, function(result) {
+ debug("Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail.");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcunwrapfailureexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcunwrapfailureexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test unwrapping an RSA key with AES-CBC.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing an unwrapping key...
+PASS unwrappingKey.algorithm.name is 'AES-CBC'
+Unwrapping a key...
+PASS Promise rejected
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcunwrapfailurehtmlfromrev206882trunkLayoutTestscryptosubtleaescbcunwrapfailurehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test unwrapping an RSA key with AES-CBC.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var unwrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
+var wrappedKey = hexStringToUint8Array("b490dedb3abc3fd545e146538e6cc3ca"); // An empty encrypted JSON.
+
+debug("Importing an unwrapping key...");
+crypto.webkitSubtle.importKey("raw", unwrappingKeyOctets, "AES-CBC", nonExtractable, ["unwrapKey"]).then(function(result) {
+ unwrappingKey = result;
+ shouldBe("unwrappingKey.algorithm.name", "'AES-CBC'");
+ var unwrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
+ debug("Unwrapping a key...");
+ return crypto.webkitSubtle.unwrapKey("jwk", wrappedKey, unwrappingKey, unwrapAlgorithm, null, extractable, ["sign", "verify", "encrypt", "decrypt", "wrap", "unwrap"]);
+}).then(undefined, function(result) {
+ testPassed("Promise rejected");
+ finishJSTest();
+});
+
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcunwraprsaexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcunwraprsaexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Test unwrapping an RSA key with AES-CBC.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing an unwrapping key...
+PASS unwrappingKey.algorithm.name is 'AES-CBC'
+Unwrapping a key...
+PASS unwrappedKey.toString() is '[object CryptoKey]'
+PASS unwrappedKey.type is 'public'
+PASS unwrappedKey.usages is ['sign','verify']
+PASS unwrappedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS unwrappedKey.algorithm.modulusLength is 2048
+PASS Base64URL.stringify(unwrappedKey.algorithm.publicExponent) is publicKeyJSON.e
+PASS unwrappedKey.algorithm.hash.name is 'SHA-256'
+PASS unwrappedKey.extractable is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcunwraprsahtmlfromrev206882trunkLayoutTestscryptosubtleaescbcunwraprsahtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test unwrapping an RSA key with AES-CBC.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RS256",
+ n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
+ e: "AQAB",
+ ext: false,
+ use: "sig"
+};
+
+var unwrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
+var wrappedKey = hexStringToUint8Array("3511f6028db04ea97e7cfad3c4cc60837bceff25cb6c88292fbcb4547570afdc32e4003fe4d65f1e7df60dc1fdb3df36c3f58ab228e33aa31005852d46d0c2ad1318435a071bbb5bbb05650ea63d551698b0c040dd95ed0d379b5e2eccb545ae5620acb8051174cd2ad647328ad99dcd462fec40748724eb1e68f209f779faa2c35b4d4d1b6604a74e62a1846249ea6192954a5af10c71ebfea79948142441ed307e9f52e797a51a8007a6f87b57c51f9e7eef54b7e4a1f818ba6ac25ee5935c23b3253d6d9d222262c79ccdb7147d9c07527c22fe7a4ab91af20479edf5930b3c053c0a0b27092cfb53203633d01dcf6e333b5be7c1933c321c953f962b934ebefd9df8cca6c0a25fcd5fb96105435c42d9902406f82bc8daa8ec12fa85d9afa65adbfe3f60828ef64adaf43ad8e3b0af104cbfafd994323732bba08f84d5cac1d157b276233dffecafe47942b83c85ead6d5886c6badf534d4a32d3f545e8032dd5e419d7bff3acde2c37a96fc34fda8747d89500bf9f7ef45873c6b3b2741aaf74ff96a2f950028f38eb62f1be936fe0a994ebfa928021c0c96172d84584e");
+
+debug("Importing an unwrapping key...");
+crypto.webkitSubtle.importKey("raw", unwrappingKeyOctets, "AES-CBC", nonExtractable, ["unwrapKey"]).then(function(result) {
+ unwrappingKey = result;
+ shouldBe("unwrappingKey.algorithm.name", "'AES-CBC'");
+ var unwrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
+ debug("Unwrapping a key...");
+ return crypto.webkitSubtle.unwrapKey("jwk", wrappedKey, unwrappingKey, unwrapAlgorithm, null, extractable, ["sign", "verify", "encrypt", "decrypt", "wrap", "unwrap"]);
+}).then(function(result) {
+ unwrappedKey = result;
+
+ shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
+ shouldBe("unwrappedKey.type", "'public'");
+ shouldBe("unwrappedKey.usages", "['sign','verify']");
+ shouldBe("unwrappedKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+ shouldBe("unwrappedKey.algorithm.modulusLength", "2048");
+ shouldBe("Base64URL.stringify(unwrappedKey.algorithm.publicExponent)", "publicKeyJSON.e");
+ shouldBe("unwrappedKey.algorithm.hash.name", "'SHA-256'");
+ shouldBe("unwrappedKey.extractable", "false");
+ finishJSTest();
+});
+
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcwraprsaexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcwraprsaexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test wrapping an RSA key with AES-CBC.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a key to wrap...
+PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
+Importing a key encryption key...
+PASS wrappingKey.algorithm.name is 'AES-CBC'
+PASS wrappedKey.toString() is '[object ArrayBuffer]'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcwraprsanonextractableexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcwraprsanonextractableexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test wrapping an RSA key with AES-CBC.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a key to wrap...
+PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
+Importing a key encryption key...
+PASS wrappingKey.algorithm.name is 'AES-CBC'
+wrapping the key...
+PASS Rejected
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcwraprsanonextractablehtmlfromrev206882trunkLayoutTestscryptosubtleaescbcwraprsanonextractablehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test wrapping an RSA key with AES-CBC.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RS256",
+ n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
+ e: "AQAB",
+ ext: false,
+ use: "sig"
+};
+
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
+var wrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
+
+debug("Importing a key to wrap...");
+crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, null, extractable, ["sign", "verify"]).then(function(result) {
+ key = result;
+ shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+ debug("Importing a key encryption key...");
+ return crypto.webkitSubtle.importKey("raw", wrappingKeyOctets, "AES-CBC", nonExtractable, ["wrapKey"]);
+}).then(function(result) {
+ wrappingKey = result;
+ shouldBe("wrappingKey.algorithm.name", "'AES-CBC'");
+ var wrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
+ debug("wrapping the key...");
+ return crypto.webkitSubtle.wrapKey("jwk", key, wrappingKey, wrapAlgorithm);
+}).then(undefined, function() {
+ testPassed("Rejected");
+ finishJSTest();
+});
+
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcwraprsahtmlfromrev206882trunkLayoutTestscryptosubtleaescbcwraprsahtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test wrapping an RSA key with AES-CBC.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RS256",
+ n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
+ e: "AQAB",
+ ext: true,
+ use: "sig"
+};
+
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
+var wrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
+
+debug("Importing a key to wrap...");
+crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, null, extractable, ["sign", "verify"]).then(function(result) {
+ key = result;
+ shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+ debug("Importing a key encryption key...");
+ return crypto.webkitSubtle.importKey("raw", wrappingKeyOctets, "AES-CBC", nonExtractable, ["wrapKey"]);
+}).then(function(result) {
+ wrappingKey = result;
+ shouldBe("wrappingKey.algorithm.name", "'AES-CBC'");
+ var wrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
+ return crypto.webkitSubtle.wrapKey("jwk", key, wrappingKey, wrapAlgorithm);
+}).then(function(result) {
+ wrappedKey = result;
+ shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
+ finishJSTest();
+});
+
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcwrongkeyclassexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcwrongkeyclassexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+Test calling AES-CBC encrypt with a HMAC key.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a raw HMAC key from string literal...
+Using the key to encrypt plaintext...
+PASS crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcwrongkeyclasshtmlfromrev206882trunkLayoutTestscryptosubtleaescbcwrongkeyclasshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test calling AES-CBC encrypt with a HMAC key.");
+
+jsTestIsAsync = true;
+
+var iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
+var plaintext = hexStringToUint8Array("6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
+var hmacKey = asciiToUint8Array('a');
+var extractable = true;
+
+debug("Importing a raw HMAC key from string literal...");
+crypto.webkitSubtle.importKey("raw", hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, ["sign", "verify", "encrypt", "decrypt"]).then(function(result) {
+ key = result;
+ debug("Using the key to encrypt plaintext...");
+ shouldThrow('crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, plaintext)')
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaesexportkeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/aes-export-key-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-export-key-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-export-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+Test exporting an AES key.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS crypto.webkitSubtle.exportKey("raw") threw exception TypeError: Not enough arguments.
+PASS crypto.webkitSubtle.exportKey("raw", null) threw exception TypeError: Type error.
+PASS crypto.webkitSubtle.exportKey("raw", undefined) threw exception TypeError: Type error.
+PASS crypto.webkitSubtle.exportKey("raw", {}) threw exception TypeError: Type error.
+PASS crypto.webkitSubtle.exportKey("raw", 1) threw exception TypeError: Type error.
+
+Importing a JWK key...
+PASS crypto.webkitSubtle.exportKey(null, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey({}, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey("", key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
+
+Exporting the key as raw data...
+PASS bytesToHexString(new Uint8Array(exportedData)) is '8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'
+Exporting the key as JWK...
+PASS exportedJWK.kty is 'oct'
+PASS exportedJWK.k is 'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7'
+PASS exportedJWK.alg is 'A192CBC'
+PASS exportedJWK.ext is true
+PASS exportedJWK.use is undefined
+PASS exportedJWK.key_ops is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
+
+Importing a key that's not extractable...
+
+Trying to export as raw...
+PASS Rejected, as expected
+Trying to export as jwk...
+PASS Rejected, as expected
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaesexportkeyhtmlfromrev206882trunkLayoutTestscryptosubtleaesexportkeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-export-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-export-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-export-key.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-export-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test exporting an AES key.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var jwkKey = {
+ kty: "oct",
+ k: "jnOw99oOZFLIEPMrgJB55WL46tJSLGt7"
+};
+
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
+
+shouldThrow('crypto.webkitSubtle.exportKey("raw")');
+shouldThrow('crypto.webkitSubtle.exportKey("raw", null)');
+shouldThrow('crypto.webkitSubtle.exportKey("raw", undefined)');
+shouldThrow('crypto.webkitSubtle.exportKey("raw", {})');
+shouldThrow('crypto.webkitSubtle.exportKey("raw", 1)');
+
+debug("\nImporting a JWK key...");
+crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, "AES-CBC", extractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']).then(function(result) {
+ key = result;
+
+ shouldThrow('crypto.webkitSubtle.exportKey(null, key)');
+ shouldThrow('crypto.webkitSubtle.exportKey(undefined, key)');
+ shouldThrow('crypto.webkitSubtle.exportKey({}, key)');
+ shouldThrow('crypto.webkitSubtle.exportKey("", key)');
+ shouldThrow('crypto.webkitSubtle.exportKey("foobar", key)');
+
+ debug("\nExporting the key as raw data...");
+ return crypto.webkitSubtle.exportKey("raw", key);
+}).then(function(result) {
+ exportedData = result;
+ shouldBe("bytesToHexString(new Uint8Array(exportedData))", "'8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'");
+
+ debug("Exporting the key as JWK...");
+ return crypto.webkitSubtle.exportKey("jwk", key);
+}).then(function(result) {
+ exportedJWK = JSON.parse(bytesToASCIIString(result));
+ shouldBe("exportedJWK.kty", "'oct'");
+ shouldBe("exportedJWK.k", "'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7'");
+ shouldBe("exportedJWK.alg", "'A192CBC'");
+ shouldBe("exportedJWK.ext", "true");
+ shouldBe("exportedJWK.use", "undefined");
+ shouldBe("exportedJWK.key_ops", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
+
+ debug("\nImporting a key that's not extractable...");
+ return crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, "AES-CBC", nonExtractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'])
+}).then(function(result) {
+ key = result;
+
+ debug("\nTrying to export as raw...");
+ return crypto.webkitSubtle.exportKey("raw", key);
+}).then(function(result) {
+ testFailed("Promise wasn't rejected");
+ finishJSTest();
+}, function() {
+ testPassed("Rejected, as expected");
+
+ debug("Trying to export as jwk...");
+ return crypto.webkitSubtle.exportKey("jwk", key);
+}).then(function(result) {
+ testFailed("Promise wasn't rejected");
+ finishJSTest();
+}, function() {
+ testPassed("Rejected, as expected");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaeskwkeymanipulationexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaeskwkeymanipulationexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+Test generating, importing and exporting keys for AES-KW. Test that they can't be used with another algorithm.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Generating a key...
+PASS key.toString() is '[object CryptoKey]'
+PASS key.type is 'secret'
+PASS key.algorithm.name is 'AES-KW'
+PASS key.algorithm.length is 256
+
+Testing that the key can't be used with AES-CBC...
+PASS crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, hexStringToUint8Array("00")) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+
+Exporting the key to raw...
+PASS exportedKey.toString() is '[object ArrayBuffer]'
+Importing it back...
+PASS importedKey.toString() is '[object CryptoKey]'
+PASS importedKey.type is 'secret'
+PASS importedKey.algorithm.name is 'AES-KW'
+PASS importedKey.algorithm.length is 256
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaeskwkeymanipulationhtmlfromrev206882trunkLayoutTestscryptosubtleaeskwkeymanipulationhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test generating, importing and exporting keys for AES-KW. Test that they can't be used with another algorithm.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+debug("Generating a key...");
+crypto.webkitSubtle.generateKey({name: "aes-kw", length: 256}, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(result) {
+ key = result;
+ shouldBe("key.toString()", "'[object CryptoKey]'");
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.algorithm.name", "'AES-KW'");
+ shouldBe("key.algorithm.length", "256");
+
+ debug("\nTesting that the key can't be used with AES-CBC...");
+ iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
+ shouldThrow('crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, key, hexStringToUint8Array("00"))');
+
+ debug("\nExporting the key to raw...");
+ return crypto.webkitSubtle.exportKey('raw', key);
+}).then(function(result) {
+ exportedKey = result;
+ shouldBe("exportedKey.toString()", "'[object ArrayBuffer]'");
+ debug("Importing it back...");
+ return crypto.webkitSubtle.importKey('raw', exportedKey, "aes-kw", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
+}).then(function(result) {
+ importedKey = result;
+
+ shouldBe("importedKey.toString()", "'[object CryptoKey]'");
+ shouldBe("importedKey.type", "'secret'");
+ shouldBe("importedKey.algorithm.name", "'AES-KW'");
+ shouldBe("importedKey.algorithm.length", "256");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaeskwwrapunwrapaesexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaeskwwrapunwrapaesexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+Test wrapping and unwrapping keys with AES-KW.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing key encryption key...
+Importing a key to be wrapped...
+Wrapping it...
+PASS bytesToHexString(wrappedKey) is '1fa68b0a8112b447aef34bd8fb5a7b829d3e862371d2cfe5'
+Unwrapping it...
+PASS unwrappedKey.toString() is '[object CryptoKey]'
+PASS unwrappedKey.type is 'secret'
+PASS unwrappedKey.extractable is true
+PASS unwrappedKey.algorithm.name is 'AES-CBC'
+PASS unwrappedKey.algorithm.length is 128
+PASS unwrappedKey.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
+Exporting it...
+PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(keyData)
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaeskwwrapunwrapaeshtmlfromrev206882trunkLayoutTestscryptosubtleaeskwwrapunwrapaeshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test wrapping and unwrapping keys with AES-KW.");
+
+jsTestIsAsync = true;
+
+var kekData = hexStringToUint8Array("000102030405060708090A0B0C0D0E0F");
+var keyData = hexStringToUint8Array("00112233445566778899AABBCCDDEEFF");
+var extractable = true;
+
+debug("Importing key encryption key...");
+crypto.webkitSubtle.importKey("raw", kekData, "aes-kw", extractable, ["wrapKey", "unwrapKey"]).then(function(result) {
+ kek = result;
+
+ debug("Importing a key to be wrapped...");
+ return crypto.webkitSubtle.importKey("raw", keyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
+}).then(function(result) {
+ key = result;
+
+ debug("Wrapping it...");
+ return crypto.webkitSubtle.wrapKey("raw", key, kek, "aes-kw");
+}).then(function(result) {
+ wrappedKey = result;
+ shouldBe("bytesToHexString(wrappedKey)", "'1fa68b0a8112b447aef34bd8fb5a7b829d3e862371d2cfe5'"); // Result from RFC 3394.
+
+ debug("Unwrapping it...");
+ return crypto.webkitSubtle.unwrapKey("raw", wrappedKey, kek, "aes-kw", "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
+}).then(function(result) {
+ unwrappedKey = result;
+ shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
+ shouldBe("unwrappedKey.type", "'secret'");
+ shouldBe("unwrappedKey.extractable", "true");
+ shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
+ shouldBe("unwrappedKey.algorithm.length", "128");
+ shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']");
+
+ debug("Exporting it...");
+ return crypto.webkitSubtle.exportKey("raw", unwrappedKey);
+}).then(function(result) {
+ unwrappedKeyData = result;
+ shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(keyData)");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaespostMessageexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaespostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test sending crypto keys via postMessage.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+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="trunkLayoutTestscryptowebkitSubtleaespostMessagehtmlfromrev206882trunkLayoutTestscryptosubtleaespostMessagehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-postMessage.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,32 @@
</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 crypto keys via postMessage.");
+
+jsTestIsAsync = true;
+
+window.addEventListener("message", function(evt) {
+ key = evt.data;
+ 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();
+}, false);
+
+crypto.webkitSubtle.importKey("raw", asciiToUint8Array("16 bytes of key!"), {name: "aes-cbc", length: 128}, true, ["encrypt", "decrypt"]).then(function(key) {
+ postMessage(key, "*");
+});
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleargumentconversionexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/argument-conversion-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/argument-conversion-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/argument-conversion-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+Test crypto.webkitSubtle argument conversion
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Passing algorithm name as a string object...
+PASS ...succeeded
+
+Passing algorithm name as a string object in a dictionary...
+PASS ...succeeded
+
+Passing algorithm name as an object with toString
+PASS ...succeeded
+
+Passing invalid data to digest()
+PASS crypto.webkitSubtle.digest({name: 'sha-1'}) threw exception TypeError: Not enough arguments.
+PASS crypto.webkitSubtle.digest({name: 'sha-1'}, null) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+PASS crypto.webkitSubtle.digest({name: 'sha-1'}, 10) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+PASS crypto.webkitSubtle.digest({name: 'sha-1'}, [10]) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+PASS crypto.webkitSubtle.digest({name: 'sha-1'}, [new Uint8Array([0])]) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+
+Passing invalid algorithmIdentifiers to digest()
+PASS crypto.webkitSubtle.digest({ toString:function() { return 'sha-1' } }, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest({name: ''}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest({name: null}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest({name: undefined}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest({name: 'sha'}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest({name: 1}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest('', data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest(null, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest(undefined, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest(1, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest({}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleargumentconversionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/argument-conversion.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/argument-conversion.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/argument-conversion.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test crypto.webkitSubtle argument conversion");
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+ debug("\nPassing algorithm name as a string object...");
+ return crypto.webkitSubtle.digest(new String('sha-1'), new Uint8Array([]));
+}).then(function(result) {
+ testPassed("...succeeded");
+ debug("\nPassing algorithm name as a string object in a dictionary...");
+ return crypto.webkitSubtle.digest({name: new String('sha-1')}, new Uint8Array([]));
+}).then(function(result) {
+ testPassed("...succeeded");
+ debug("\nPassing algorithm name as an object with toString");
+ return crypto.webkitSubtle.digest({name: { toString:function() { return 'sha-1' } } }, new Uint8Array([]));
+}).then(function(result) {
+ testPassed("...succeeded");
+
+ debug("\nPassing invalid data to digest()");
+ shouldThrow("crypto.webkitSubtle.digest({name: 'sha-1'})");
+ shouldThrow("crypto.webkitSubtle.digest({name: 'sha-1'}, null)");
+ shouldThrow("crypto.webkitSubtle.digest({name: 'sha-1'}, 10)");
+ shouldThrow("crypto.webkitSubtle.digest({name: 'sha-1'}, [10])");
+ shouldThrow("crypto.webkitSubtle.digest({name: 'sha-1'}, [new Uint8Array([0])])");
+
+ debug("\nPassing invalid algorithmIdentifiers to digest()");
+ data = new Uint8Array([0]);
+ shouldThrow("crypto.webkitSubtle.digest({ toString:function() { return 'sha-1' } }, data)"); // Algorithm normalization doesn't attempt to call toString.
+ shouldThrow("crypto.webkitSubtle.digest({name: ''}, data)");
+ shouldThrow("crypto.webkitSubtle.digest({name: null}, data)");
+ shouldThrow("crypto.webkitSubtle.digest({name: undefined}, data)");
+ shouldThrow("crypto.webkitSubtle.digest({name: 'sha'}, data)");
+ shouldThrow("crypto.webkitSubtle.digest({name: 1}, data)");
+ shouldThrow("crypto.webkitSubtle.digest('', data)");
+ shouldThrow("crypto.webkitSubtle.digest(null, data)");
+ shouldThrow("crypto.webkitSubtle.digest(undefined, data)");
+ shouldThrow("crypto.webkitSubtle.digest(1, data)");
+ shouldThrow("crypto.webkitSubtle.digest({}, data)");
+}).then(finishJSTest);
+
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlearraybufferviewoffsetexpectedtxtfromrev206882trunkLayoutTestscryptosubtlearraybufferviewoffsetexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Test that an ArrayBufferView with offset is processed correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS bytesToHexString(new Uint8Array(digest)) is '2c7e7c384f7829694282b1e3a6216def8082d055'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlearraybufferviewoffsethtmlfromrev206882trunkLayoutTestscryptosubtlearraybufferviewoffsethtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset.html (from rev 206882, trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test that an ArrayBufferView with offset is processed correctly.");
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+ var originalData = new Uint8Array([0xf, 0xf, 0xf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0xf, 0xf, 0xf]);
+ var slicedData = new Uint8Array(originalData.buffer, 3, 11);
+ return crypto.webkitSubtle.digest({name: 'sha-1'}, slicedData);
+}).then(function(result) {
+ digest = result;
+ // Expected result for [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'2c7e7c384f7829694282b1e3a6216def8082d055'");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgcexpectedtxtfromrev206882trunkLayoutTestscryptosubtlecryptokeyalgorithmgcexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test that CryptoKey.algorithm preserves custom properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Generating a HMAC key with default length...
+PASS key.algorithm === key.algorithm is true
+PASS key.algorithm.foo is "bar"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgchtmlfromrev206882trunkLayoutTestscryptosubtlecryptokeyalgorithmgchtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html (from rev 206882, trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,44 @@
</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 that CryptoKey.algorithm preserves custom properties.");
+jsTestIsAsync = true;
+
+debug("\nGenerating a HMAC key with default length...");
+crypto.webkitSubtle.generateKey({name: "hmac", hash: "sha-1"}, true, ["sign", "verify"]).then(function(result) {
+ key = result;
+ startTest();
+});
+
+function startTest()
+{
+ shouldBeTrue("key.algorithm === key.algorithm");
+ key.algorithm.foo = "bar";
+ gc();
+ setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+ gc();
+ setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+ gc();
+ shouldBeEqualToString('key.algorithm.foo', 'bar');
+ finishJSTest();
+}
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgcexpectedtxtfromrev206882trunkLayoutTestscryptosubtlecryptokeyusagesgcexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test that CryptoKey.usages preserves custom properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Generating a HMAC key with default length...
+PASS key.usages === key.usages is true
+PASS key.usages.foo is "bar"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgchtmlfromrev206882trunkLayoutTestscryptosubtlecryptokeyusagesgchtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html (from rev 206882, trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,44 @@
</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 that CryptoKey.usages preserves custom properties.");
+jsTestIsAsync = true;
+
+debug("\nGenerating a HMAC key with default length...");
+crypto.webkitSubtle.generateKey({name: "hmac", hash: "sha-1"}, true, ["sign", "verify"]).then(function(result) {
+ key = result;
+ startTest();
+});
+
+function startTest()
+{
+ shouldBeTrue("key.usages === key.usages");
+ key.usages.foo = "bar";
+ gc();
+ setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+ gc();
+ setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+ gc();
+ shouldBeEqualToString('key.usages.foo', 'bar');
+ finishJSTest();
+}
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmaccheckalgorithmexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test that HMAC operations only work when hash functions match between invocation and key.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a raw HMAC SHA-1 key from string literal...
+Done
+PASS crypto.webkitSubtle.sign({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('foo')) did not throw exception.
+PASS crypto.webkitSubtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('foo')) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.verify({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo')) did not throw exception.
+PASS crypto.webkitSubtle.verify({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo')) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmaccheckalgorithmhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test that HMAC operations only work when hash functions match between invocation and key.");
+
+jsTestIsAsync = true;
+
+var hmacKey = asciiToUint8Array('a');
+var extractable = true;
+
+debug("Importing a raw HMAC SHA-1 key from string literal...");
+crypto.webkitSubtle.importKey("raw", hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, ["sign", "verify"]).then(function(result) {
+ debug("Done");
+ key = result;
+
+ shouldNotThrow("crypto.webkitSubtle.sign({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('foo'))");
+ shouldThrow("crypto.webkitSubtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('foo'))");
+
+ shouldNotThrow("crypto.webkitSubtle.verify({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo'))");
+ shouldThrow("crypto.webkitSubtle.verify({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo'))");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacexportkeyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlehmacexportkeyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-export-key-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+Test exporting an AES key.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a JWK key...
+PASS crypto.webkitSubtle.exportKey(null, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey({}, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey("", key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
+Exporting the key as raw data...
+PASS bytesToHexString(new Uint8Array(exportedData)) is '6a18e49feff7f3b7e09ec89b7f6deab2f6a18e49feff7f3b7e09ec89b7f6deab'
+Exporting the key as JWK...
+PASS exportedJWK.kty is 'oct'
+PASS exportedJWK.k is 'ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs'
+PASS exportedJWK.alg is 'HS256'
+PASS exportedJWK.ext is true
+PASS exportedJWK.use is undefined
+PASS exportedJWK.key_ops is ['sign', 'verify']
+
+Importing a key that's not extractable...
+
+Trying to export as raw...
+PASS Rejected, as expected
+Trying to export as jwk...
+PASS Rejected, as expected
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacexportkeyhtmlfromrev206882trunkLayoutTestscryptosubtlehmacexportkeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-export-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test exporting an AES key.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var jwkKey = {
+ "kty": "oct",
+ "k": "ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs"
+};
+
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
+
+debug("Importing a JWK key...");
+crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, { name: "HMAC", hash: "SHA-256" }, extractable, ["sign", "verify"]).then(function(result) {
+ key = result;
+
+ shouldThrow('crypto.webkitSubtle.exportKey(null, key)');
+ shouldThrow('crypto.webkitSubtle.exportKey(undefined, key)');
+ shouldThrow('crypto.webkitSubtle.exportKey({}, key)');
+ shouldThrow('crypto.webkitSubtle.exportKey("", key)');
+ shouldThrow('crypto.webkitSubtle.exportKey("foobar", key)');
+
+ debug("Exporting the key as raw data...");
+ return crypto.webkitSubtle.exportKey("raw", key);
+}).then(function(result) {
+ exportedData = result;
+ shouldBe("bytesToHexString(new Uint8Array(exportedData))", "'6a18e49feff7f3b7e09ec89b7f6deab2f6a18e49feff7f3b7e09ec89b7f6deab'");
+
+ debug("Exporting the key as JWK...");
+ return crypto.webkitSubtle.exportKey("jwk", key);
+}).then(function(result) {
+ exportedJWK = JSON.parse(bytesToASCIIString(result));
+ shouldBe("exportedJWK.kty", "'oct'");
+ shouldBe("exportedJWK.k", "'ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs'");
+ shouldBe("exportedJWK.alg", "'HS256'");
+ shouldBe("exportedJWK.ext", "true");
+ shouldBe("exportedJWK.use", "undefined");
+ shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
+
+ debug("\nImporting a key that's not extractable...");
+ return crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, { name: "HMAC", hash: "SHA-256" }, nonExtractable, ["sign", "verify"]);
+}).then(function(result) {
+ key = result;
+
+ debug("\nTrying to export as raw...");
+ return crypto.webkitSubtle.exportKey("raw", key);
+}).then(function(result) {
+ testFailed("Promise wasn't rejected");
+ finishJSTest();
+}, function() {
+ testPassed("Rejected, as expected");
+
+ debug("Trying to export as jwk...");
+ return crypto.webkitSubtle.exportKey("jwk", key);
+}).then(function(result) {
+ testFailed("Promise wasn't rejected");
+ finishJSTest();
+}, function() {
+ testPassed("Rejected, as expected");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacgeneratekeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+Test generating a HMAC key.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS crypto.webkitSubtle.generateKey("hmac", extractable, ["sign", "verify"]) threw exception TypeError: Type error.
+PASS crypto.webkitSubtle.generateKey({name: "hmac"}, extractable, ["sign", "verify"]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.generateKey({name: "hmac", length: undefined}, extractable, ["sign", "verify"]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.generateKey({name: "hmac", length: {}}, extractable, ["sign", "verify"]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+
+Generating a key with default length...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 64
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is ["sign", "verify"]
+
+Generating a key with custom length...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 5
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is ["sign"]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacgeneratekeyhtmlfromrev206882trunkLayoutTestscryptosubtlehmacgeneratekeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-generate-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test generating a HMAC key.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+shouldThrow('crypto.webkitSubtle.generateKey("hmac", extractable, ["sign", "verify"])');
+shouldThrow('crypto.webkitSubtle.generateKey({name: "hmac"}, extractable, ["sign", "verify"])');
+shouldThrow('crypto.webkitSubtle.generateKey({name: "hmac", length: undefined}, extractable, ["sign", "verify"])');
+shouldThrow('crypto.webkitSubtle.generateKey({name: "hmac", length: {}}, extractable, ["sign", "verify"])');
+
+debug("\nGenerating a key with default length...");
+crypto.webkitSubtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]).then(function(result) {
+ key = result;
+
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'HMAC'");
+ shouldBe("key.algorithm.length", "64");
+ shouldBe("key.algorithm.hash.name", "'SHA-1'");
+ shouldBe("key.usages", '["sign", "verify"]');
+
+ debug("\nGenerating a key with custom length...");
+ return crypto.webkitSubtle.generateKey({name: "hmac", hash: "sha-1", length: 5}, extractable, ["sign"]);
+}).then(function(result) {
+ key = result;
+
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'HMAC'");
+ shouldBe("key.algorithm.length", "5");
+ shouldBe("key.algorithm.hash.name", "'SHA-1'");
+ shouldBe("key.usages", '["sign"]');
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacimportjwkexpectedtxtfromrev206882trunkLayoutTestscryptosubtlehmacimportjwkexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+Test importing a JWK key for HMAC.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a key...
+
+PASS key.type is 'secret'
+PASS key.extractable is false
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 32
+PASS key.usages is ["sign", "verify"]
+
+Using the key to sign message 'foo'...
+PASS bytesToHexString(new Uint8Array(signature)) is 'e03736fe098892b2a2da77812431f7c014d32e2fd69f3bcff883ac923a8fa2da'
+
+Verifying the signature...
+PASS verificationResult is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacimportjwkhtmlfromrev206882trunkLayoutTestscryptosubtlehmacimportjwkhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk.html (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test importing a JWK key for HMAC.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var hmacKey = {
+ "kty": "oct",
+ "alg": "HS256",
+ "use": "sig",
+ "ext": false,
+ "k": "ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs"
+};
+
+var hmacKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(hmacKey));
+
+debug("Importing a key...\n");
+crypto.webkitSubtle.importKey("jwk", hmacKeyAsArrayBuffer, null, extractable, ["sign", "verify"]).then(function(result) {
+ key = result;
+
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "false");
+ shouldBe("key.algorithm.name", "'HMAC'");
+ shouldBe("key.algorithm.length", "32");
+ shouldBe("key.usages", '["sign", "verify"]');
+
+ debug("\nUsing the key to sign message 'foo'...");
+ return crypto.webkitSubtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
+}).then(function(result) {
+ signature = result;
+ shouldBe("bytesToHexString(new Uint8Array(signature))", "'e03736fe098892b2a2da77812431f7c014d32e2fd69f3bcff883ac923a8fa2da'");
+
+ debug("\nVerifying the signature...");
+ return crypto.webkitSubtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
+}).then(function(result) {
+ verificationResult = result;
+ shouldBe("verificationResult", "true");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacpostMessageexpectedtxtfromrev206882trunkLayoutTestscryptosubtlehmacpostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test sending crypto keys via postMessage.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 16
+PASS key.usages is ["sign", "verify"]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacpostMessagehtmlfromrev206882trunkLayoutTestscryptosubtlehmacpostMessagehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage.html (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-postMessage.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,32 @@
</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 crypto keys via postMessage.");
+
+jsTestIsAsync = true;
+
+window.addEventListener("message", function(evt) {
+ key = evt.data;
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'HMAC'");
+ shouldBe("key.algorithm.length", "16");
+ shouldBe("key.usages", '["sign", "verify"]');
+
+ finishJSTest();
+}, false);
+
+crypto.webkitSubtle.importKey("raw", asciiToUint8Array("16 bytes of key!"), {name: 'hmac', hash: {name: 'sha-1'}}, true, ['sign', 'verify']).then(function(key) {
+ postMessage(key, "*");
+});
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacsignverifyemptykeyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlehmacsignverifyemptykeyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Test HMAC sign and verify functions with an empty key.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a raw HMAC key from string literal...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 0
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is ['sign', 'verify']
+Using the key to sign 'foo'...
+PASS bytesToHexString(new Uint8Array(signature)) is 'a3cc770fc033e2cb419d42b64e0081a3bd3be30e'
+Verifying the signature...
+PASS verificationResult is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacsignverifyemptykeyhtmlfromrev206882trunkLayoutTestscryptosubtlehmacsignverifyemptykeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test HMAC sign and verify functions with an empty key.");
+
+jsTestIsAsync = true;
+
+var hmacKey = asciiToUint8Array('');
+var extractable = true;
+
+debug("Importing a raw HMAC key from string literal...");
+crypto.webkitSubtle.importKey("raw", hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, ["sign", "verify"]).then(function(result) {
+ key = result;
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'HMAC'");
+ shouldBe("key.algorithm.length", "0"); // See <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098>.
+ shouldBe("key.algorithm.hash.name", "'SHA-1'");
+ shouldBe("key.usages", "['sign', 'verify']");
+
+ debug("Using the key to sign 'foo'...");
+ return crypto.webkitSubtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
+}).then(function(result) {
+ signature = result;
+ shouldBe("bytesToHexString(new Uint8Array(signature))", "'a3cc770fc033e2cb419d42b64e0081a3bd3be30e'");
+
+ debug("Verifying the signature...");
+ return crypto.webkitSubtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
+}).then(function(result) {
+ verificationResult = result;
+ shouldBe("verificationResult", "true");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacsignverifyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlehmacsignverifyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Test HMAC sign and verify functions.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a raw HMAC key from string literal...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 1
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is ['sign', 'verify']
+Using the key to sign 'foo'...
+PASS bytesToHexString(new Uint8Array(signature)) is 'bebbc02e46b0f81183f40c25dce23e5045d65519'
+Verifying the signature...
+PASS verificationResult is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacsignverifyhtmlfromrev206882trunkLayoutTestscryptosubtlehmacsignverifyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify.html (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test HMAC sign and verify functions.");
+
+jsTestIsAsync = true;
+
+var hmacKey = asciiToUint8Array('a');
+var extractable = true;
+
+debug("Importing a raw HMAC key from string literal...");
+crypto.webkitSubtle.importKey("raw", hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, ["sign", "verify"]).then(function(result) {
+ key = result;
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'HMAC'");
+ shouldBe("key.algorithm.length", "1"); // See <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098>.
+ shouldBe("key.algorithm.hash.name", "'SHA-1'");
+ shouldBe("key.usages", "['sign', 'verify']");
+
+ debug("Using the key to sign 'foo'...");
+ return crypto.webkitSubtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
+}).then(function(result) {
+ signature = result;
+ shouldBe("bytesToHexString(new Uint8Array(signature))", "'bebbc02e46b0f81183f40c25dce23e5045d65519'");
+
+ debug("Verifying the signature...");
+ return crypto.webkitSubtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
+}).then(function(result) {
+ verificationResult = result;
+ shouldBe("verificationResult", "true");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleimportjwkexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/import-jwk-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/import-jwk-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+Test error handling for JWK import.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(''), null) threw exception TypeError: Invalid JWK serialization.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{'), null) threw exception TypeError: Invalid JWK serialization.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('null'), null) threw exception TypeError: Invalid JWK serialization.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('undefined'), null) threw exception TypeError: Invalid JWK serialization.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{}'), null) threw exception TypeError: Neither key nor function argument has crypto algorithm specified.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{}'), "aes-cbc") threw exception TypeError: Required JWK "kty" member is missing.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "foobar", "alg": "HS256", "use": "sig", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Unsupported JWK key type foobar.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "foobar", "use": "sig", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Unsupported JWK algorithm foobar.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), "aes-cbc") threw exception TypeError: Algorithm specified in key is not compatible with one passed to importKey as argument.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), { name: "hmac", hash: "sha-1" }) threw exception TypeError: Algorithm specified in key is not compatible with one passed to importKey as argument.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256" }'), null) threw exception TypeError: Secret key data is not present is JWK.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "A128CBC" }'), null) threw exception TypeError: Secret key data is not present is JWK.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "1234" }'), null) threw exception TypeError: Key size is not valid for HS256.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "A128CBC", "use": "sig", "ext": false, "k": "1234" }'), null) threw exception TypeError: Key size is not valid for A128CBC.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "A128CBC", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Key size is not valid for A128CBC.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387f+nsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Cannot decode base64url key data in JWK.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": 1, "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Expected a string value for "kty" JSON key.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": 1, "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Expected a string value for "alg" JSON key.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": 1, "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Expected a string value for "use" JSON key.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": "false", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }'), null) threw exception TypeError: Expected a boolean value for "ext" JSON key.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array('{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": 1 }'), null) threw exception TypeError: Expected a string value for "k" JSON key.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleimportjwkhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/import-jwk.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/import-jwk.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test error handling for JWK import.");
+
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'null\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'undefined\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{}\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{}\'), "aes-cbc")')
+
+// Unknown/invalid JWK values.
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "foobar", "alg": "HS256", "use": "sig", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "foobar", "use": "sig", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
+
+// Algorithm mismatch.
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), "aes-cbc")')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), { name: "hmac", hash: "sha-1" })')
+
+// No key data.
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256" }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "A128CBC" }\'), null)')
+
+// Key data length is incorrect, not allowed in JWK.
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "1234" }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "A128CBC", "use": "sig", "ext": false, "k": "1234" }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "A128CBC", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
+
+// Key data is not valid base64url.
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387f+nsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
+
+// Incorrect data types.
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": 1, "alg": "HS256", "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": 1, "use": "sig", "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": 1, "ext": false, "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": "false", "k": "ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs" }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(\'{ "kty": "oct", "alg": "HS256", "use": "sig", "ext": false, "k": 1 }\'), null)')
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlejwkexportusevaluesexpectedtxtfromrev206882trunkLayoutTestscryptosubtlejwkexportusevaluesexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+Test exporting keys with various usages to JWK.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+encrypt:
+PASS jwk.use is undefined
+PASS jwk.key_ops is ["encrypt"]
+
+decrypt:
+PASS jwk.use is undefined
+PASS jwk.key_ops is ["decrypt"]
+
+encrypt,decrypt:
+PASS jwk.use is undefined
+PASS jwk.key_ops is ["encrypt","decrypt"]
+
+wrapKey:
+PASS jwk.use is undefined
+PASS jwk.key_ops is ["wrapKey"]
+
+unwrapKey:
+PASS jwk.use is undefined
+PASS jwk.key_ops is ["unwrapKey"]
+
+wrapKey,unwrapKey:
+PASS jwk.use is undefined
+PASS jwk.key_ops is ["wrapKey","unwrapKey"]
+
+encrypt,decrypt,wrapKey:
+PASS jwk.use is undefined
+PASS jwk.key_ops is ["encrypt","decrypt","wrapKey"]
+
+encrypt,decrypt,wrapKey,unwrapKey:
+PASS jwk.use is undefined
+PASS jwk.key_ops is ["encrypt","decrypt","wrapKey","unwrapKey"]
+
+sign:
+PASS jwk.use is undefined
+PASS jwk.key_ops is ["sign"]
+
+verify:
+PASS jwk.use is undefined
+PASS jwk.key_ops is ["verify"]
+
+sign,verify:
+PASS jwk.use is undefined
+PASS jwk.key_ops is ["sign","verify"]
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlejwkexportusevalueshtmlfromrev206882trunkLayoutTestscryptosubtlejwkexportusevalueshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values.html (from rev 206882, trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test exporting keys with various usages to JWK.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var aesKeyAsArrayBuffer = Base64URL.parse("jnOw99oOZFLIEPMrgJB55WL46tJSLGt7");
+var hmacKeyAsArrayBuffer = Base64URL.parse("ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs");
+
+function testWithAESCBC(usages, expectedKeyOps)
+{
+ return crypto.webkitSubtle.importKey("raw", aesKeyAsArrayBuffer, "AES-CBC", extractable, usages).then(function(result) {
+ return crypto.webkitSubtle.exportKey("jwk", result);
+ }).then(function(result) {
+ jwk = JSON.parse(bytesToASCIIString(result));
+ debug(usages + ":");
+ shouldBe("jwk.use", "undefined");
+ shouldBe("jwk.key_ops", JSON.stringify(expectedKeyOps));
+ debug("");
+ });
+}
+
+function testWithHMAC(usages, expectedKeyOps)
+{
+ return crypto.webkitSubtle.importKey("raw", hmacKeyAsArrayBuffer, {name: 'hmac', hash: {name: 'sha-256'}}, extractable, usages).then(function(result) {
+ return crypto.webkitSubtle.exportKey("jwk", result);
+ }).then(function(result) {
+ jwk = JSON.parse(bytesToASCIIString(result));
+ debug(usages + ":");
+ shouldBe("jwk.use", "undefined");
+ shouldBe("jwk.key_ops", JSON.stringify(expectedKeyOps));
+ debug("");
+ });
+}
+
+Promise.all([
+ testWithAESCBC(["encrypt"], ["encrypt"]),
+ testWithAESCBC(["decrypt"], ["decrypt"]),
+ testWithAESCBC(["encrypt", "decrypt"], ["encrypt", "decrypt"]),
+ testWithAESCBC(["wrapKey"], ["wrapKey"]),
+ testWithAESCBC(["unwrapKey"], ["unwrapKey"]),
+ testWithAESCBC(["wrapKey", "unwrapKey"], ["wrapKey", "unwrapKey"]),
+ testWithAESCBC(["encrypt", "decrypt", "wrapKey"], ["encrypt", "decrypt", "wrapKey"]),
+ testWithAESCBC(["encrypt", "decrypt", "wrapKey", "unwrapKey"], ["encrypt", "decrypt", "wrapKey", "unwrapKey"]),
+ testWithHMAC(["sign"], ["sign"]),
+ testWithHMAC(["verify"], ["verify"]),
+ testWithHMAC(["sign", "verify"], ["sign", "verify"]),
+]).then(function() { finishJSTest(); } );
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlejwkimportusevaluesexpectedtxtfromrev206882trunkLayoutTestscryptosubtlejwkimportusevaluesexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+Test importing keys with various uses from JWK.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testWithAESCBC(["encrypt"], {key_ops: ["encrypt", "encrypt"]}) threw exception TypeError: JWK key_ops contains a duplicate operation.
+
+{"key_ops":["encrypt"]}:
+PASS key.usages is ["encrypt"]
+
+{"key_ops":["decrypt"]}:
+PASS key.usages is ["decrypt"]
+
+{"key_ops":["encrypt","decrypt"]}:
+PASS key.usages is ["decrypt","encrypt"]
+
+{"key_ops":["wrapKey"]}:
+PASS key.usages is ["wrapKey"]
+
+{"key_ops":["unwrapKey"]}:
+PASS key.usages is ["unwrapKey"]
+
+{"key_ops":["wrapKey","unwrapKey"]}:
+PASS key.usages is ["unwrapKey","wrapKey"]
+
+{"key_ops":["encrypt","decrypt","wrapKey"]}:
+PASS key.usages is ["decrypt","encrypt","wrapKey"]
+
+{"use":"enc"}:
+PASS key.usages is ["decrypt","encrypt","unwrapKey","wrapKey"]
+
+{"key_ops":["sign"]}:
+PASS key.usages is ["sign"]
+
+{"key_ops":["verify"]}:
+PASS key.usages is ["verify"]
+
+{"use":"sig"}:
+PASS key.usages is ["sign","verify"]
+
+{"key_ops":["'encrypt'"]}:
+PASS key.usages is []
+
+{"key_ops":["encrypt "]}:
+PASS key.usages is []
+
+{"key_ops":["Encrypt"]}:
+PASS key.usages is []
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlejwkimportusevalueshtmlfromrev206882trunkLayoutTestscryptosubtlejwkimportusevalueshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values.html (from rev 206882, trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test importing keys with various uses from JWK.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var aesKeyAsJSON = {
+ "alg": "A192CBC",
+ "ext": true,
+ "kty": "oct",
+ "k": "jnOw99oOZFLIEPMrgJB55WL46tJSLGt7"
+};
+
+var hmacKeyAsJSON = {
+ "alg": "HS256",
+ "ext": true,
+ "kty": "oct",
+ "k": "ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs"
+};
+
+function testWithAESCBC(expectedUsages, jwkUsages)
+{
+ if (jwkUsages.key_ops) {
+ aesKeyAsJSON.key_ops = jwkUsages.key_ops;
+ delete aesKeyAsJSON.use;
+ } else {
+ delete aesKeyAsJSON.key_ops;
+ aesKeyAsJSON.use = jwkUsages.use;
+ }
+
+ return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(aesKeyAsJSON)), "AES-CBC", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(result) {
+ key = result;
+ debug(JSON.stringify(jwkUsages) + ":");
+ shouldBe("key.usages", JSON.stringify(expectedUsages));
+ debug("");
+ });
+}
+
+function testWithHMAC(expectedUsages, jwkUsages)
+{
+ if (jwkUsages.key_ops) {
+ hmacKeyAsJSON.key_ops = jwkUsages.key_ops;
+ delete hmacKeyAsJSON.use;
+ } else {
+ delete hmacKeyAsJSON.key_ops;
+ hmacKeyAsJSON.use = jwkUsages.use;
+ }
+
+ return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(hmacKeyAsJSON)), {name: 'hmac', hash: {name: 'sha-256'}}, extractable, ["sign", "verify"]).then(function(result) {
+ key = result;
+ debug(JSON.stringify(jwkUsages) + ":");
+ shouldBe("key.usages", JSON.stringify(expectedUsages));
+ debug("");
+ });
+}
+
+// Duplicates are not allowed. We currently raise an exception, although we should reject the promise instead.
+shouldThrow('testWithAESCBC(["encrypt"], {key_ops: ["encrypt", "encrypt"]})');
+debug("");
+
+Promise.all([
+ testWithAESCBC(["encrypt"], {key_ops: ["encrypt"]}),
+ testWithAESCBC(["decrypt"], {key_ops: ["decrypt"]}),
+ testWithAESCBC(["decrypt", "encrypt"], {key_ops: ["encrypt", "decrypt"]}),
+ testWithAESCBC(["wrapKey"], {key_ops: ["wrapKey"]}),
+ testWithAESCBC(["unwrapKey"], {key_ops: ["unwrapKey"]}),
+ testWithAESCBC(["unwrapKey", "wrapKey"], {key_ops: ["wrapKey", "unwrapKey"]}),
+ testWithAESCBC(["decrypt", "encrypt", "wrapKey"], {key_ops: ["encrypt", "decrypt", "wrapKey"]}),
+ testWithAESCBC(["decrypt", "encrypt", "unwrapKey", "wrapKey"], {use: "enc"}),
+ testWithHMAC(["sign"], {key_ops: ["sign"]}),
+ testWithHMAC(["verify"], {key_ops: ["verify"]}),
+ testWithHMAC(["sign", "verify"], {use: "sig"}),
+
+// Unknown key_ops strings are ignored.
+ testWithAESCBC([], {key_ops: ["'encrypt'"]}),
+ testWithAESCBC([], {key_ops: ["encrypt "]}),
+ testWithAESCBC([], {key_ops: ["Encrypt"]}),
+
+]).then(function() { finishJSTest(); } );
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleresourcesrsaindexeddbnonexportablejsfromrev206882trunkLayoutTestscryptosubtleresourcesrsaindexeddbnonexportablejs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js (from rev 206882, trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+description("Test storing a private RSA key in IndexedDB, and retrieving it.");
+
+jsTestIsAsync = true;
+
+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"
+};
+
+crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, false, ["sign", "verify"]).then(function(key) {
+ var openRequest = indexedDB.open("crypto_webkitSubtle");
+ openRequest.onupgradeneeded = function(event) {
+ var objectStore = event.target.result.createObjectStore("rsa-indexeddb");
+ }
+ openRequest.onerror = function(event) {
+ testFailed("Could not open database: " + event.target.error.name);
+ finishJSTest();
+ }
+ openRequest.onsuccess = function(event) {
+ db = event.target.result;
+ storeKey();
+ }
+
+ function storeKey() {
+ var objectStore = db.transaction("rsa-indexeddb", "readwrite").objectStore("rsa-indexeddb");
+ var req = objectStore.put(key, "mykey");
+ req.onerror = function(event) {
+ testFailed("Could not put a key into database: " + event.target.error.name);
+ finishJSTest();
+ }
+ req.onsuccess = function(event) { readKey(); }
+ }
+
+ function readKey() {
+ var objectStore = db.transaction("rsa-indexeddb").objectStore("rsa-indexeddb");
+ var req = objectStore.get("mykey");
+ req.onerror = function(event) {
+ testFailed("Could not get a key from database: " + event.target.error.name);
+ finishJSTest();
+ }
+ req.onsuccess = function(event) {
+ window.retrievedKey = event.target.result;
+ shouldBe("retrievedKey.type", "'private'");
+ shouldBe("retrievedKey.extractable", "false");
+ shouldBe("retrievedKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+ shouldBe("retrievedKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(retrievedKey.algorithm.publicExponent)", "'010001'");
+ shouldBe("retrievedKey.usages", '["sign", "verify"]');
+
+ finishJSTest();
+ }
+ }
+});
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleresourcesrsaindexeddbjsfromrev206882trunkLayoutTestscryptosubtleresourcesrsaindexeddbjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb.js (from rev 206882, trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb.js) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb.js         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+description("Test storing a private RSA key in IndexedDB, and retrieving it.");
+
+jsTestIsAsync = true;
+
+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"
+};
+
+crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, true, ["sign", "verify"]).then(function(key) {
+ var openRequest = indexedDB.open("crypto_webkitSubtle");
+ openRequest.onupgradeneeded = function(event) {
+ var objectStore = event.target.result.createObjectStore("rsa-indexeddb");
+ }
+ openRequest.onerror = function(event) {
+ testFailed("Could not open database: " + event.target.error.name);
+ finishJSTest();
+ }
+ openRequest.onsuccess = function(event) {
+ db = event.target.result;
+ storeKey();
+ }
+
+ function storeKey() {
+ var objectStore = db.transaction("rsa-indexeddb", "readwrite").objectStore("rsa-indexeddb");
+ var req = objectStore.put(key, "mykey");
+ req.onerror = function(event) {
+ testFailed("Could not put a key into database: " + event.target.error.name);
+ finishJSTest();
+ }
+ req.onsuccess = function(event) { readKey(); }
+ }
+
+ function readKey() {
+ var objectStore = db.transaction("rsa-indexeddb").objectStore("rsa-indexeddb");
+ var req = objectStore.get("mykey");
+ req.onerror = function(event) {
+ testFailed("Could not get a key from database: " + event.target.error.name);
+ finishJSTest();
+ }
+ req.onsuccess = function(event) {
+ window.retrievedKey = event.target.result;
+ shouldBe("retrievedKey.type", "'private'");
+ shouldBe("retrievedKey.extractable", "true");
+ shouldBe("retrievedKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+ shouldBe("retrievedKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(retrievedKey.algorithm.publicExponent)", "'010001'");
+ shouldBe("retrievedKey.usages", '["sign", "verify"]');
+
+ finishJSTest();
+ }
+ }
+});
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaexportgeneratedkeysexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaexportgeneratedkeysexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+Test exporting a generated RSA keypair with hash.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Generating RSA-PKCS1-v1.5 keyPair...
+PASS crypto.webkitSubtle.exportKey(null, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey({}, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey("", key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
+PASS key.publicKey.algorithm.hash.name is defined.
+PASS key.privateKey.algorithm.hash.name is defined.
+
+Exporting public key as JWK...
+PASS exportedJWK.kty is 'RSA'
+PASS exportedJWK.alg is 'RS256'
+PASS exportedJWK.ext is true
+PASS exportedJWK.use is undefined
+PASS exportedJWK.key_ops is ['sign', 'verify']
+
+Exporting private key as JWK...
+PASS exportedJWK.kty is 'RSA'
+PASS exportedJWK.alg is 'RS256'
+PASS exportedJWK.ext is true
+PASS exportedJWK.use is undefined
+PASS exportedJWK.key_ops is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaexportgeneratedkeyshtmlfromrev206882trunkLayoutTestscryptosubtlersaexportgeneratedkeyshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test exporting a generated RSA keypair with hash.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var algorithm = {
+ name: "RSASSA-PKCS1-v1_5",
+ modulusLength: "2048",
+ publicExponent: new Uint8Array([1, 0, 1]), // 2^16 + 1 (65537)
+ hash: { name: "SHA-256" }
+};
+
+debug("\nGenerating RSA-PKCS1-v1.5 keyPair...");
+crypto.webkitSubtle.generateKey(algorithm, extractable, ['sign', 'verify'])
+.then(function(result) {
+ key = result;
+
+ shouldThrow('crypto.webkitSubtle.exportKey(null, key)');
+ shouldThrow('crypto.webkitSubtle.exportKey(undefined, key)');
+ shouldThrow('crypto.webkitSubtle.exportKey({}, key)');
+ shouldThrow('crypto.webkitSubtle.exportKey("", key)');
+ shouldThrow('crypto.webkitSubtle.exportKey("foobar", key)');
+ shouldBeDefined('key.publicKey.algorithm.hash.name');
+ shouldBeDefined('key.privateKey.algorithm.hash.name');
+
+ debug("\nExporting public key as JWK...");
+ return crypto.webkitSubtle.exportKey("jwk", key.publicKey);
+}).then(function(result) {
+ exportedJWK = JSON.parse(bytesToASCIIString(result));
+
+ shouldBe("exportedJWK.kty", "'RSA'");
+ shouldBe("exportedJWK.alg", "'RS256'");
+ shouldBe("exportedJWK.ext", "true");
+ shouldBe("exportedJWK.use", "undefined");
+ shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
+
+ debug("\nExporting private key as JWK...");
+ return crypto.webkitSubtle.exportKey("jwk", key.privateKey);
+}).then(function(result) {
+ exportedJWK = JSON.parse(bytesToASCIIString(result));
+
+ shouldBe("exportedJWK.kty", "'RSA'");
+ shouldBe("exportedJWK.alg", "'RS256'");
+ shouldBe("exportedJWK.ext", "true");
+ shouldBe("exportedJWK.use", "undefined");
+ shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaexportkeyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaexportkeyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-export-key-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+Test exporting an RSA key.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Importing a JWK key...
+PASS crypto.webkitSubtle.exportKey(null, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey({}, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey("", key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
+
+Exporting the key as JWK...
+PASS exportedJWK.kty is 'RSA'
+PASS exportedJWK.n is publicKeyJSON.n
+PASS exportedJWK.e is publicKeyJSON.e
+PASS exportedJWK.alg is 'RS256'
+PASS exportedJWK.ext is true
+PASS exportedJWK.use is undefined
+PASS exportedJWK.key_ops is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaexportkeyhtmlfromrev206882trunkLayoutTestscryptosubtlersaexportkeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-export-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test exporting an RSA key.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RS256",
+ n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
+ e: "AQAB"
+};
+
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
+
+debug("\nImporting a JWK key...");
+crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, "RSASSA-PKCS1-v1_5", extractable, ['sign', 'verify']).then(function(result) {
+ key = result;
+
+ shouldThrow('crypto.webkitSubtle.exportKey(null, key)');
+ shouldThrow('crypto.webkitSubtle.exportKey(undefined, key)');
+ shouldThrow('crypto.webkitSubtle.exportKey({}, key)');
+ shouldThrow('crypto.webkitSubtle.exportKey("", key)');
+ shouldThrow('crypto.webkitSubtle.exportKey("foobar", key)');
+
+ debug("\nExporting the key as JWK...");
+ return crypto.webkitSubtle.exportKey("jwk", key);
+}).then(function(result) {
+ exportedJWK = JSON.parse(bytesToASCIIString(result));
+
+ shouldBe("exportedJWK.kty", "'RSA'");
+ shouldBe("exportedJWK.n", "publicKeyJSON.n");
+ shouldBe("exportedJWK.e", "publicKeyJSON.e");
+ shouldBe("exportedJWK.alg", "'RS256'");
+ shouldBe("exportedJWK.ext", "true");
+ shouldBe("exportedJWK.use", "undefined");
+ shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaexportprivatekeyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaexportprivatekeyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+Test exporting a private RSA key.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Importing a JWK key...
+
+Exporting the key as JWK...
+PASS exportedJWK.kty is 'RSA'
+PASS exportedJWK.n is privateKeyJSON.n
+PASS exportedJWK.e is privateKeyJSON.e
+PASS exportedJWK.d is privateKeyJSON.d
+PASS exportedJWK.p is privateKeyJSON.p
+PASS exportedJWK.q is privateKeyJSON.q
+PASS exportedJWK.dp is privateKeyJSON.dp
+PASS exportedJWK.dq is privateKeyJSON.dq
+PASS exportedJWK.qi is privateKeyJSON.qi
+PASS exportedJWK.oth is privateKeyJSON.oth
+PASS exportedJWK.alg is privateKeyJSON.alg
+PASS exportedJWK.ext is true
+PASS exportedJWK.key_ops is ['sign', 'verify']
+PASS exportedJWK.use is undefined
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaexportprivatekeyhtmlfromrev206882trunkLayoutTestscryptosubtlersaexportprivatekeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test exporting a private RSA key.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+// Example from JWK specification.
+var privateKeyJSON = {
+ "kty":"RSA",
+ "n":"0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",
+ "e":"AQAB",
+ "d":"X4cTteJY_gn4FYPsXB8rdXix5vwsg1FLN5E3EaG6RJoVH-HLLKD9M7dx5oo7GURknchnrRweUkC7hT5fJLM0WbFAKNLWY2vv7B6NqXSzUvxT0_YSfqijwp3RTzlBaCxWp4doFk5N2o8Gy_nHNKroADIkJ46pRUohsXywbReAdYaMwFs9tv8d_cPVY3i07a3t8MN6TNwm0dSawm9v47UiCl3Sk5ZiG7xojPLu4sbg1U2jx4IBTNBznbJSzFHK66jT8bgkuqsk0GjskDJk19Z4qwjwbsnn4j2WBii3RL-Us2lGVkY8fkFzme1z0HbIkfz0Y6mqnOYtqc0X4jfcKoAC8Q",
+ "p":"83i-7IvMGXoMXCskv73TKr8637FiO7Z27zv8oj6pbWUQyLPQBQxtPVnwD20R-60eTDmD2ujnMt5PoqMrm8RfmNhVWDtjjMmCMjOpSXicFHj7XOuVIYQyqVWlWEh6dN36GVZYk93N8Bc9vY41xy8B9RzzOGVQzXvNEvn7O0nVbfs",
+ "q":"3dfOR9cuYq-0S-mkFLzgItgMEfFzB2q3hWehMuG0oCuqnb3vobLyumqjVZQO1dIrdwgTnCdpYzBcOfW5r370AFXjiWft_NGEiovonizhKpo9VVS78TzFgxkIdrecRezsZ-1kYd_s1qDbxtkDEgfAITAG9LUnADun4vIcb6yelxk",
+ "dp":"G4sPXkc6Ya9y8oJW9_ILj4xuppu0lzi_H7VTkS8xj5SdX3coE0oimYwxIi2emTAue0UOa5dpgFGyBJ4c8tQ2VF402XRugKDTP8akYhFo5tAA77Qe_NmtuYZc3C3m3I24G2GvR5sSDxUyAN2zq8Lfn9EUms6rY3Ob8YeiKkTiBj0",
+ "dq":"s9lAH9fggBsoFR8Oac2R_E2gw282rT2kGOAhvIllETE1efrA6huUUvMfBcMpn8lqeW6vzznYY5SSQF7pMdC_agI3nG8Ibp1BUb0JUiraRNqUfLhcQb_d9GF4Dh7e74WbRsobRonujTYN1xCaP6TO61jvWrX-L18txXw494Q_cgk",
+ "qi":"GyM_p6JrXySiz1toFgKbWV-JdI3jQ4ypu9rbMWx3rQJBfmt0FoYzgUIZEVFEcOqwemRN81zoDAaa-Bk0KWNGDjJHZDdDmFhW3AN7lI-puxk_mHZGJ11rxyR8O55XLSe3SPmRfKwZI6yU24ZxvQKFYItdldUKGzO6Ia6zTKhAVRU",
+ "alg":"RS256",
+ "kid":"2011-04-29"
+}
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(privateKeyJSON));
+
+debug("\nImporting a JWK key...");
+crypto.webkitSubtle.importKey("jwk", jwkKeyAsArrayBuffer, "RSASSA-PKCS1-v1_5", extractable, ['sign', 'verify']).then(function(result) {
+ key = result;
+
+ debug("\nExporting the key as JWK...");
+ return crypto.webkitSubtle.exportKey("jwk", key);
+}).then(function(result) {
+ exportedJWK = JSON.parse(bytesToASCIIString(result));
+
+ shouldBe("exportedJWK.kty", "'RSA'");
+ shouldBe("exportedJWK.n", "privateKeyJSON.n");
+ shouldBe("exportedJWK.e", "privateKeyJSON.e");
+ shouldBe("exportedJWK.d", "privateKeyJSON.d");
+ shouldBe("exportedJWK.p", "privateKeyJSON.p");
+ shouldBe("exportedJWK.q", "privateKeyJSON.q");
+ shouldBe("exportedJWK.dp", "privateKeyJSON.dp");
+ shouldBe("exportedJWK.dq", "privateKeyJSON.dq");
+ shouldBe("exportedJWK.qi", "privateKeyJSON.qi");
+ shouldBe("exportedJWK.oth", "privateKeyJSON.oth");
+ shouldBe("exportedJWK.alg", "privateKeyJSON.alg");
+ shouldBe("exportedJWK.ext", "true");
+ shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
+ shouldBe("exportedJWK.use", "undefined");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaindexeddbexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test storing a private RSA key in IndexedDB, and retrieving it.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS retrievedKey.type is 'private'
+PASS retrievedKey.extractable is true
+PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS retrievedKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
+PASS retrievedKey.usages is ["sign", "verify"]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportableexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaindexeddbnonexportableexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test storing a private RSA key in IndexedDB, and retrieving it.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS retrievedKey.type is 'private'
+PASS retrievedKey.extractable is false
+PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS retrievedKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
+PASS retrievedKey.usages is ["sign", "verify"]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportableprivateexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivateexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test storing a private RSA key in IndexedDB, and retrieving it.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS retrievedKey.type is 'private'
+PASS retrievedKey.extractable is false
+PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS retrievedKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
+PASS retrievedKey.usages is ["sign", "verify"]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportableprivatehtmlfromrev206882trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivatehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script>
+enablePrivateBrowsing = true;
+</script>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<script src="resources/rsa-indexeddb-non-exportable.js"></script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportablehtmlfromrev206882trunkLayoutTestscryptosubtlersaindexeddbnonexportablehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<script src="resources/rsa-indexeddb-non-exportable.js"></script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbprivateexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaindexeddbprivateexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test storing a private RSA key in IndexedDB, and retrieving it.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS retrievedKey.type is 'private'
+PASS retrievedKey.extractable is true
+PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS retrievedKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
+PASS retrievedKey.usages is ["sign", "verify"]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbprivatehtmlfromrev206882trunkLayoutTestscryptosubtlersaindexeddbprivatehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script>
+enablePrivateBrowsing = true;
+</script>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<script src="resources/rsa-indexeddb.js"></script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbhtmlfromrev206882trunkLayoutTestscryptosubtlersaindexeddbhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<script src="resources/rsa-indexeddb.js"></script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepgeneratenonextractablekeyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+Test that even when non-extractability is requested, the public key is still extractable.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Generating a key pair...
+PASS keyPair.toString() is '[object CryptoKeyPair]'
+PASS keyPair.publicKey.type is 'public'
+PASS keyPair.publicKey.extractable is true
+PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
+PASS keyPair.publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
+PASS keyPair.publicKey.algorithm.hash is undefined.
+PASS keyPair.privateKey.type is 'private'
+PASS keyPair.privateKey.extractable is false
+PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
+PASS keyPair.privateKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
+PASS keyPair.privateKey.algorithm.hash is undefined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepgeneratenonextractablekeyhtmlfromrev206882trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test that even when non-extractability is requested, the public key is still extractable.");
+
+jsTestIsAsync = true;
+
+var algorithmKeyGen = {
+ name: "RSA-OAEP",
+ // RsaKeyGenParams
+ modulusLength: 2048,
+ publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
+};
+var nonExtractable = false;
+
+debug("Generating a key pair...");
+crypto.webkitSubtle.generateKey(algorithmKeyGen, nonExtractable, []).then(function(result) {
+ keyPair = result;
+ shouldBe("keyPair.toString()", "'[object CryptoKeyPair]'");
+ shouldBe("keyPair.publicKey.type", "'public'");
+ shouldBe("keyPair.publicKey.extractable", "true");
+ shouldBe("keyPair.publicKey.algorithm.name", "'RSA-OAEP'");
+ shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
+ shouldBeUndefined("keyPair.publicKey.algorithm.hash");
+ shouldBe("keyPair.privateKey.type", "'private'");
+ shouldBe("keyPair.privateKey.extractable", "false");
+ shouldBe("keyPair.privateKey.algorithm.name", "'RSA-OAEP'");
+ shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
+ shouldBeUndefined("keyPair.privateKey.algorithm.hash");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepkeymanipulationexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaoaepkeymanipulationexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+Test generating, importing and exporting RSA keys for RSA-OAEP. Test that they can't be used with another algorithm.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Generating a key pair...
+PASS keyPair.toString() is '[object CryptoKeyPair]'
+PASS keyPair.publicKey.type is 'public'
+PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
+PASS keyPair.publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
+PASS keyPair.publicKey.algorithm.hash is undefined.
+PASS keyPair.privateKey.type is 'private'
+PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
+PASS keyPair.privateKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
+PASS keyPair.privateKey.algorithm.hash is undefined.
+
+Testing that the keys can't be used with different algorithms...
+PASS crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, keyPair.privateKey, hexStringToUint8Array("00")) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, keyPair.publicKey, hexStringToUint8Array("00")) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+
+Trying to export keys to raw...
+PASS Promise rejected for exporting public key
+PASS Promise rejected for exporting private key
+
+Exporting public key to JWK...
+PASS jwkPublicKey.alg is 'RSA-OAEP'
+PASS jwkPublicKey.ext is true
+PASS jwkPublicKey.key_ops is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
+PASS jwkPublicKey.use is undefined
+PASS jwkPublicKey.kty is 'RSA'
+PASS bytesToHexString(Base64URL.parse(jwkPublicKey.e)) is '010001'
+
+Importing it back...
+PASS exportedPublicKey.type is 'public'
+PASS exportedPublicKey.algorithm.name is 'RSA-OAEP'
+PASS exportedPublicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(exportedPublicKey.algorithm.publicExponent) is '010001'
+PASS exportedPublicKey.algorithm.hash.name is 'SHA-1'
+PASS exportedPublicKey.extractable is true
+PASS exportedPublicKey.usages is ['decrypt','encrypt','unwrapKey','wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepkeymanipulationhtmlfromrev206882trunkLayoutTestscryptosubtlersaoaepkeymanipulationhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test generating, importing and exporting RSA keys for RSA-OAEP. Test that they can't be used with another algorithm.");
+
+jsTestIsAsync = true;
+
+var algorithmKeyGen = {
+ name: "RSA-OAEP",
+ // RsaKeyGenParams
+ modulusLength: 2048,
+ publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
+};
+var extractable = true;
+
+debug("Generating a key pair...");
+crypto.webkitSubtle.generateKey(algorithmKeyGen, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]).then(function(result) {
+ keyPair = result;
+ shouldBe("keyPair.toString()", "'[object CryptoKeyPair]'");
+ shouldBe("keyPair.publicKey.type", "'public'");
+ shouldBe("keyPair.publicKey.algorithm.name", "'RSA-OAEP'");
+ shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
+ shouldBeUndefined("keyPair.publicKey.algorithm.hash");
+ shouldBe("keyPair.privateKey.type", "'private'");
+ shouldBe("keyPair.privateKey.algorithm.name", "'RSA-OAEP'");
+ shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
+ shouldBeUndefined("keyPair.privateKey.algorithm.hash");
+
+ debug("\nTesting that the keys can't be used with different algorithms...");
+ iv = hexStringToUint8Array("000102030405060708090a0b0c0d0e0f");
+ shouldThrow('crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, keyPair.privateKey, hexStringToUint8Array("00"))');
+ shouldThrow('crypto.webkitSubtle.encrypt({name: "aes-cbc", iv: iv}, keyPair.publicKey, hexStringToUint8Array("00"))');
+
+ debug("\nTrying to export keys to raw...");
+ return crypto.webkitSubtle.exportKey('raw', keyPair.publicKey);
+}).then(undefined, function(result) {
+ testPassed("Promise rejected for exporting public key");
+ return crypto.webkitSubtle.exportKey('raw', keyPair.privateKey);
+}).then(undefined, function(result) {
+ testPassed("Promise rejected for exporting private key");
+
+ debug("\nExporting public key to JWK...");
+ return crypto.webkitSubtle.exportKey("jwk", keyPair.publicKey);
+}).then(function(result) {
+ jwkPublicKeyArray = result;
+ jwkPublicKey = JSON.parse(bytesToASCIIString(jwkPublicKeyArray));
+ shouldBe("jwkPublicKey.alg", "'RSA-OAEP'");
+ shouldBe("jwkPublicKey.ext", "true");
+ shouldBe("jwkPublicKey.key_ops", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
+ shouldBe("jwkPublicKey.use", "undefined");
+ shouldBe("jwkPublicKey.kty", "'RSA'");
+ shouldBe("bytesToHexString(Base64URL.parse(jwkPublicKey.e))", "'010001'");
+
+ debug("\nImporting it back...");
+ return crypto.webkitSubtle.importKey("jwk", jwkPublicKeyArray, null, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
+}).then(function(result) {
+ exportedPublicKey = result;
+ shouldBe("exportedPublicKey.type", "'public'");
+ shouldBe("exportedPublicKey.algorithm.name", "'RSA-OAEP'");
+ shouldBe("exportedPublicKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(exportedPublicKey.algorithm.publicExponent)", "'010001'");
+ shouldBe("exportedPublicKey.algorithm.hash.name", "'SHA-1'");
+ shouldBe("exportedPublicKey.extractable", "true");
+ shouldBe("exportedPublicKey.usages", "['decrypt','encrypt','unwrapKey','wrapKey']");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepplaintextlengthexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaoaepplaintextlengthexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test what happens when trying to encrypt a too large plain text with RSA-OAEP.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing RSA keys...
+Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...
+PASS Succeeded
+Encrypting a 215 byte buffer...
+PASS Rejected
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepplaintextlengthhtmlfromrev206882trunkLayoutTestscryptosubtlersaoaepplaintextlengthhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test what happens when trying to encrypt a too large plain text with RSA-OAEP.");
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RSA-OAEP",
+ n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
+ e: "AQAB"
+};
+
+var privateKeyJSON = {
+ kty: "RSA",
+ alg: "RSA-OAEP",
+ 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 encryptAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
+var extractable = true;
+var nonExtractable = false;
+
+debug("Importing RSA keys...");
+crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["encrypt", "decrypt"]).then(function(result) {
+ publicKey = result;
+ return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["encrypt", "decrypt"]);
+}).then(function(result) {
+ privateKey = result;
+
+ debug("Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...");
+ return crypto.webkitSubtle.encrypt({name: "RSA-OAEP", hash: "SHA-1"}, publicKey, new Uint8Array(214));
+}).then(function(result) {
+ testPassed("Succeeded");
+ debug("Encrypting a 215 byte buffer...");
+ return crypto.webkitSubtle.encrypt({name: "RSA-OAEP", hash: "SHA-1"}, publicKey, new Uint8Array(215));
+}).then(function(result) {
+ testFailed("Succeeded");
+ finishJSTest();
+}, function(result) {
+ testPassed("Rejected");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepwrapunwrapaesexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaoaepwrapunwrapaesexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+Test wrapping and unwrapping AES keys with RSA-OAEP.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing RSA keys...
+Importing an AES key...
+Wrapping it...
+PASS wrappedKey.toString() is '[object ArrayBuffer]'
+Unwrapping it...
+PASS unwrappedKey.toString() is '[object CryptoKey]'
+PASS unwrappedKey.type is 'secret'
+PASS unwrappedKey.extractable is true
+PASS unwrappedKey.algorithm.name is 'AES-CBC'
+PASS unwrappedKey.algorithm.length is 256
+PASS unwrappedKey.usages is ['decrypt', 'encrypt']
+Exporting it...
+PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
+
+Wrapping the same key as JWK...
+PASS wrappedKey.toString() is '[object ArrayBuffer]'
+Unwrapping it...
+PASS unwrappedKey.toString() is '[object CryptoKey]'
+PASS unwrappedKey.type is 'secret'
+PASS unwrappedKey.extractable is true
+PASS unwrappedKey.algorithm.name is 'AES-CBC'
+PASS unwrappedKey.algorithm.length is 256
+PASS unwrappedKey.usages is ['decrypt', 'encrypt']
+Exporting it...
+PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepwrapunwrapaeshtmlfromrev206882trunkLayoutTestscryptosubtlersaoaepwrapunwrapaeshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test wrapping and unwrapping AES keys with RSA-OAEP.");
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RSA-OAEP",
+ n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
+ e: "AQAB"
+};
+
+var privateKeyJSON = {
+ kty: "RSA",
+ alg: "RSA-OAEP",
+ 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 wrapAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
+var extractable = true;
+var nonExtractable = false;
+
+debug("Importing RSA keys...");
+crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["wrapKey", "unwrapKey"]).then(function(result) {
+ publicKey = result;
+ return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["wrapKey", "unwrapKey"]);
+}).then(function(result) {
+ privateKey = result;
+
+ debug("Importing an AES key...");
+ aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
+ return crypto.webkitSubtle.importKey("raw", aesKeyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
+}).then(function(result) {
+ aesKey = result;
+ debug("Wrapping it...");
+
+ return crypto.webkitSubtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm);
+}).then(function(result) {
+ wrappedKey = result;
+ shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
+
+ debug("Unwrapping it...");
+ return crypto.webkitSubtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
+}).then(function(result) {
+ unwrappedKey = result;
+ shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
+ shouldBe("unwrappedKey.type", "'secret'");
+ shouldBe("unwrappedKey.extractable", "true");
+ shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
+ shouldBe("unwrappedKey.algorithm.length", "256");
+ shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
+
+ debug("Exporting it...");
+ return crypto.webkitSubtle.exportKey("raw", unwrappedKey);
+}).then(function(result) {
+ unwrappedKeyData = result;
+ shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData)");
+
+ debug("\nWrapping the same key as JWK...");
+ return crypto.webkitSubtle.wrapKey("jwk", aesKey, publicKey, wrapAlgorithm);
+}).then(function(result) {
+ wrappedKey = result;
+ shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
+
+ debug("Unwrapping it...");
+ return crypto.webkitSubtle.unwrapKey("jwk", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
+}).then(function(result) {
+ unwrappedKey = result;
+ shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
+ shouldBe("unwrappedKey.type", "'secret'");
+ shouldBe("unwrappedKey.extractable", "true");
+ shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
+ shouldBe("unwrappedKey.algorithm.length", "256");
+ shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
+
+ debug("Exporting it...");
+ return crypto.webkitSubtle.exportKey("raw", unwrappedKey);
+}).then(function(result) {
+ unwrappedKeyData = result;
+ shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData)");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersapostMessageexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersapostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-postMessage-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+Test sending crypto keys via postMessage.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Key received in a message:
+PASS key.type is 'private'
+PASS key.extractable is true
+PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS key.algorithm.modulusLength is 2048
+PASS bytesToHexString(key.algorithm.publicExponent) is '010001'
+PASS key.usages is ["sign", "verify"]
+
+Exported back to JWK:
+PASS exportedJWK.kty is 'RSA'
+PASS exportedJWK.alg is 'RS256'
+PASS exportedJWK.ext is true
+PASS exportedJWK.key_ops is ['sign','verify']
+PASS exportedJWK.use is undefined
+PASS exportedJWK.n is privateKeyJSON.n
+PASS exportedJWK.e is privateKeyJSON.e
+PASS exportedJWK.d is privateKeyJSON.d
+PASS exportedJWK.p is privateKeyJSON.p
+PASS exportedJWK.q is privateKeyJSON.q
+PASS exportedJWK.dp is privateKeyJSON.dp
+PASS exportedJWK.dq is privateKeyJSON.dq
+PASS exportedJWK.qi is privateKeyJSON.qi
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersapostMessagehtmlfromrev206882trunkLayoutTestscryptosubtlersapostMessagehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-postMessage.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,66 @@
</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 crypto keys via postMessage.");
+
+jsTestIsAsync = true;
+
+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"
+};
+
+window.addEventListener("message", function(evt) {
+ debug("Key received in a message:");
+ key = evt.data;
+ shouldBe("key.type", "'private'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+ shouldBe("key.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(key.algorithm.publicExponent)", "'010001'");
+ shouldBe("key.usages", '["sign", "verify"]');
+
+ crypto.webkitSubtle.exportKey("jwk", key).then(function(result) {
+ exportedJWK = JSON.parse(bytesToASCIIString(result));
+ debug("\nExported back to JWK:");
+ shouldBe("exportedJWK.kty", "'RSA'");
+ shouldBe("exportedJWK.alg", "'RS256'");
+ shouldBe("exportedJWK.ext", "true");
+ shouldBe("exportedJWK.key_ops", "['sign','verify']");
+ shouldBe("exportedJWK.use", "undefined");
+ shouldBe("exportedJWK.n", "privateKeyJSON.n");
+ shouldBe("exportedJWK.e", "privateKeyJSON.e");
+ shouldBe("exportedJWK.d", "privateKeyJSON.d");
+ shouldBe("exportedJWK.p", "privateKeyJSON.p");
+ shouldBe("exportedJWK.q", "privateKeyJSON.q");
+ shouldBe("exportedJWK.dp", "privateKeyJSON.dp");
+ shouldBe("exportedJWK.dq", "privateKeyJSON.dq");
+ shouldBe("exportedJWK.qi", "privateKeyJSON.qi");
+ debug("");
+
+ finishJSTest();
+ });
+}, false);
+
+crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, true, ["sign", "verify"]).then(function(result) {
+ postMessage(result, "*");
+});
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5decryptexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaespkcs1v1_5decryptexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+Test decrypting a known message with RSAES-PKCS1-v1_5.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing an RSA key...
+Decrypting...
+PASS bytesToHexString(new Uint8Array(message)) is '2aacec86f423dd925ec158822a748cbe6c31a0'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5decrypthtmlfromrev206882trunkLayoutTestscryptosubtlersaespkcs1v1_5decrypthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test decrypting a known message with RSAES-PKCS1-v1_5.");
+
+jsTestIsAsync = true;
+
+var privateKeyJSON = {
+ kty: "RSA",
+ alg: "RSA1_5",
+ n: Base64URL.stringify(hexStringToUint8Array("dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1")),
+ e: Base64URL.stringify(hexStringToUint8Array("010001")),
+ d: Base64URL.stringify(hexStringToUint8Array("21950851cdf25320318b305afa0f371f07ae5a44b314ebd729f5dcb15da7fa3947acdd915daed574bd16df88bf85f61060b387172fae6e01262b3864c2d3c22f94e04a8159422b4ed279c48a4c9d767d4966071a5bbf5d043e16ff46ec1ba0716f00bbc97bff5d5693e214e99c9721f12b3ec6282ae2a485721b96ddcf7403fa037d0c57ab463c448de5cc12265add886d311ea8d8a5903fa56c5f1c9cf2eb11cb657a1a7d3e41352dc3e686898c4ce4305e8b638e1b08a2a86cc9eb9866f3499ac77b6136b81cb276d614cfeb7b6ed3f3bc775e46c00066ebeee2cff7166b57520598947ff6210320b288fb4f2c3f8fe97b279414ebf7203000a19fc0424875")),
+ p: Base64URL.stringify(hexStringToUint8Array("f123bfe53de97a569d91adcf556fa625ad30f3fd3d811f9e91e6af44b6e780cb0f327829fb21190ae2806646d728cd9b6531132b1ebfef1272993060f1ce70b124393091ee8593b727367edbba009ec5be17c4acee120c841267d47631a16c36a6d1c99973c1b0b5a835bf39feafe8f6421fd9c2a90bc27976659e67bc83124d")),
+ q: Base64URL.stringify(hexStringToUint8Array("ea9839b7e37ea89bbda27e4c93471cb4fd92189a0a96bcb4d75693f18a5c2f742af9e36fde679fbd9eae345fa269527b6965021c4bdf54d685bf08960cc976f68dca21cebf44f268a59dab8d1a25e519f5147e1f45fe287d74cf725bec1326d34212c56cf4fffa202f57b68ee8cca943f3c138c4cde33bdf2c9440df65322445")),
+ dp: Base64URL.stringify(hexStringToUint8Array("ca0c9b60b8e4a6066756c65d2088419df6253b7b688a85f4f6e964d85dad52a45262867f1e9618069fccd865e9289e46e39e2022944c5c4487d345cf252d460d977d77edfefedbcbae46a23af7fa470f077da0e50942044cb1a360497cc2760ac0f2ad4a2fcd0e84d7a1d94dfdd2658fd9ce18475c1fa75ee0cebad0cf0ac04d")),
+ dq: Base64URL.stringify(hexStringToUint8Array("528171233c4e4a6c63b86764f51338846afddbcb2958344c01c4004a1dd828145a1d02a1507def4f58247a64fc10c0a288c1ae895721d78b8f044db7c00d86da55a9b654292ecd768270be69e4bd5922d4effd1f70955f9627e3e19b749e93b40ef3dd1d61d93915e2b09d930b4b1768bfacc0136f39b0cfdfb4d050011e2e65")),
+ qi: Base64URL.stringify(hexStringToUint8Array("df2eb2322cc2daabf4d1465508f41521cda7ceff23ebe61d00d441ee728dda5d16c7bf920cd95f34beb4fe32ee817ef3362e0bcd1d1245f7b07793eaa190dc5a37fdaf4c68e2ca13972d7f5148b796b6fb6d7adda07bd2cd13be98cebed1edc6ca412e395350c59a1d842bc4aa2f3c0b243fde7dfd95356f2439251a1172c45e"))
+};
+
+var extractable = true;
+var nonExtractable = false;
+
+debug("Importing an RSA key...");
+crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["decrypt"]).then(function(result) {
+ privateKey = result;
+
+ debug("Decrypting...");
+ encryptedMessage = hexStringToUint8Array("6042e745589af03af87520f93c45d8c35985ada1161a37d822e9f9460fc75fcf0179d8491b8f5d1e4de8ceb31e07c4865c5a3efdbbb69a8803b89ee65a430a5809c707569150b580bb686a94c5541c46adcd827960ce244ff688387d1616e85b4d1780c6483606cf924b54f080cf4154e66829bf6e532481048ec41fadc07d755bb34bb28145219cb30d47d0d618709180e90303ff9ef09018bed3da75761da794811f96bc9e8d7c4ba1b5946bda0bd313faec4c993ed2748eed8cce4bdb520ba7db165f9fe56aa8454d6ff33874feeebf29de2df5b7f00aa1d9fb073fc4067b58dc50624e127f711dde2cc2cfdab4919ccf28c83660dfc227b0f500ec1f904f");
+ return crypto.webkitSubtle.decrypt("RSAES-PKCS1-v1_5", privateKey, encryptedMessage);
+}).then(function(result) {
+ message = result;
+ shouldBe("bytesToHexString(new Uint8Array(message))", "'2aacec86f423dd925ec158822a748cbe6c31a0'");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5wrapunwrapaesexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaesexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+Test wrapping and unwrapping an AES key with RSAES-PKCS1-v1_5.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing RSA keys...
+Importing an AES key...
+Wrapping it...
+PASS wrappedKey.toString() is '[object ArrayBuffer]'
+Unwrapping it...
+PASS unwrappedKey.toString() is '[object CryptoKey]'
+PASS unwrappedKey.type is 'secret'
+PASS unwrappedKey.extractable is true
+PASS unwrappedKey.algorithm.name is 'AES-CBC'
+PASS unwrappedKey.algorithm.length is 256
+PASS unwrappedKey.usages is ['decrypt', 'encrypt']
+Exporting it...
+PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
+
+Wrapping the same key as JWK...
+PASS wrappedKey.toString() is '[object ArrayBuffer]'
+Unwrapping it...
+PASS unwrappedKey.toString() is '[object CryptoKey]'
+PASS unwrappedKey.type is 'secret'
+PASS unwrappedKey.extractable is true
+PASS unwrappedKey.algorithm.name is 'AES-CBC'
+PASS unwrappedKey.algorithm.length is 256
+PASS unwrappedKey.usages is ['decrypt', 'encrypt']
+Exporting it...
+PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5wrapunwrapaeshtmlfromrev206882trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaeshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test wrapping and unwrapping an AES key with RSAES-PKCS1-v1_5.");
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RSA1_5",
+ n: Base64URL.stringify(hexStringToUint8Array("dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1")),
+ e: Base64URL.stringify(hexStringToUint8Array("010001"))
+};
+
+var privateKeyJSON = {
+ kty: "RSA",
+ alg: "RSA1_5",
+ n: Base64URL.stringify(hexStringToUint8Array("dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1")),
+ e: Base64URL.stringify(hexStringToUint8Array("010001")),
+ d: Base64URL.stringify(hexStringToUint8Array("21950851cdf25320318b305afa0f371f07ae5a44b314ebd729f5dcb15da7fa3947acdd915daed574bd16df88bf85f61060b387172fae6e01262b3864c2d3c22f94e04a8159422b4ed279c48a4c9d767d4966071a5bbf5d043e16ff46ec1ba0716f00bbc97bff5d5693e214e99c9721f12b3ec6282ae2a485721b96ddcf7403fa037d0c57ab463c448de5cc12265add886d311ea8d8a5903fa56c5f1c9cf2eb11cb657a1a7d3e41352dc3e686898c4ce4305e8b638e1b08a2a86cc9eb9866f3499ac77b6136b81cb276d614cfeb7b6ed3f3bc775e46c00066ebeee2cff7166b57520598947ff6210320b288fb4f2c3f8fe97b279414ebf7203000a19fc0424875")),
+ p: Base64URL.stringify(hexStringToUint8Array("f123bfe53de97a569d91adcf556fa625ad30f3fd3d811f9e91e6af44b6e780cb0f327829fb21190ae2806646d728cd9b6531132b1ebfef1272993060f1ce70b124393091ee8593b727367edbba009ec5be17c4acee120c841267d47631a16c36a6d1c99973c1b0b5a835bf39feafe8f6421fd9c2a90bc27976659e67bc83124d")),
+ q: Base64URL.stringify(hexStringToUint8Array("ea9839b7e37ea89bbda27e4c93471cb4fd92189a0a96bcb4d75693f18a5c2f742af9e36fde679fbd9eae345fa269527b6965021c4bdf54d685bf08960cc976f68dca21cebf44f268a59dab8d1a25e519f5147e1f45fe287d74cf725bec1326d34212c56cf4fffa202f57b68ee8cca943f3c138c4cde33bdf2c9440df65322445")),
+ dp: Base64URL.stringify(hexStringToUint8Array("ca0c9b60b8e4a6066756c65d2088419df6253b7b688a85f4f6e964d85dad52a45262867f1e9618069fccd865e9289e46e39e2022944c5c4487d345cf252d460d977d77edfefedbcbae46a23af7fa470f077da0e50942044cb1a360497cc2760ac0f2ad4a2fcd0e84d7a1d94dfdd2658fd9ce18475c1fa75ee0cebad0cf0ac04d")),
+ dq: Base64URL.stringify(hexStringToUint8Array("528171233c4e4a6c63b86764f51338846afddbcb2958344c01c4004a1dd828145a1d02a1507def4f58247a64fc10c0a288c1ae895721d78b8f044db7c00d86da55a9b654292ecd768270be69e4bd5922d4effd1f70955f9627e3e19b749e93b40ef3dd1d61d93915e2b09d930b4b1768bfacc0136f39b0cfdfb4d050011e2e65")),
+ qi: Base64URL.stringify(hexStringToUint8Array("df2eb2322cc2daabf4d1465508f41521cda7ceff23ebe61d00d441ee728dda5d16c7bf920cd95f34beb4fe32ee817ef3362e0bcd1d1245f7b07793eaa190dc5a37fdaf4c68e2ca13972d7f5148b796b6fb6d7adda07bd2cd13be98cebed1edc6ca412e395350c59a1d842bc4aa2f3c0b243fde7dfd95356f2439251a1172c45e"))
+};
+var wrapAlgorithm = {name: "RSAES-PKCS1-v1_5"};
+var extractable = true;
+var nonExtractable = false;
+
+debug("Importing RSA keys...");
+crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["wrapKey", "unwrapKey"]).then(function(result) {
+ publicKey = result;
+ return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["wrapKey", "unwrapKey"]);
+}).then(function(result) {
+ privateKey = result;
+
+ debug("Importing an AES key...");
+ aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
+ return crypto.webkitSubtle.importKey("raw", aesKeyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
+}).then(function(result) {
+ aesKey = result;
+ debug("Wrapping it...");
+
+ return crypto.webkitSubtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm);
+}).then(function(result) {
+ wrappedKey = result;
+ shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
+
+ debug("Unwrapping it...");
+ return crypto.webkitSubtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
+}).then(function(result) {
+ unwrappedKey = result;
+ shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
+ shouldBe("unwrappedKey.type", "'secret'");
+ shouldBe("unwrappedKey.extractable", "true");
+ shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
+ shouldBe("unwrappedKey.algorithm.length", "256");
+ shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
+
+ debug("Exporting it...");
+ return crypto.webkitSubtle.exportKey("raw", unwrappedKey);
+}).then(function(result) {
+ unwrappedKeyData = result;
+ shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData)");
+
+ debug("\nWrapping the same key as JWK...");
+ return crypto.webkitSubtle.wrapKey("jwk", aesKey, publicKey, wrapAlgorithm);
+}).then(function(result) {
+ wrappedKey = result;
+ shouldBe("wrappedKey.toString()", "'[object ArrayBuffer]'");
+
+ debug("Unwrapping it...");
+ return crypto.webkitSubtle.unwrapKey("jwk", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]);
+}).then(function(result) {
+ unwrappedKey = result;
+ shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
+ shouldBe("unwrappedKey.type", "'secret'");
+ shouldBe("unwrappedKey.extractable", "true");
+ shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
+ shouldBe("unwrappedKey.algorithm.length", "256");
+ shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']");
+
+ debug("Exporting it...");
+ return crypto.webkitSubtle.exportKey("raw", unwrappedKey);
+}).then(function(result) {
+ unwrappedKeyData = result;
+ shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(aesKeyData)");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+Test generating an RSA key pair for RSASSA-PKCS1-v1_5.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Generating a key pair...
+PASS keyPair.toString() is '[object CryptoKeyPair]'
+PASS keyPair.publicKey.type is 'public'
+PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS keyPair.publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
+PASS keyPair.publicKey.algorithm.hash is undefined.
+PASS keyPair.privateKey.type is 'private'
+PASS keyPair.privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS keyPair.privateKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
+PASS keyPair.privateKey.algorithm.hash is undefined.
+
+Testing that custom attributes on keys survive garbage collection...
+PASS keyPair.publicKey.foo is 'bar'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponentexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponentexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test generating an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Generating a key pair...
+PASS keyPair.toString() is '[object CryptoKeyPair]'
+PASS keyPair.publicKey.type is 'public'
+PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS keyPair.publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
+PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtmlfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test generating an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes.");
+
+jsTestIsAsync = true;
+
+var algorithmKeyGen = {
+ name: "RSASSA-PKCS1-v1_5",
+ // RsaKeyGenParams
+ modulusLength: 2048,
+ publicExponent: new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01]), // Equivalent to 65537
+};
+var extractable = true;
+
+debug("Generating a key pair...");
+crypto.webkitSubtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
+ keyPair = result;
+ shouldBe("keyPair.toString()", "'[object CryptoKeyPair]'");
+ shouldBe("keyPair.publicKey.type", "'public'");
+ shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+ shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
+ shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeyhtmlfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test generating an RSA key pair for RSASSA-PKCS1-v1_5.");
+
+jsTestIsAsync = true;
+
+var algorithmKeyGen = {
+ name: "RSASSA-PKCS1-v1_5",
+ // RsaKeyGenParams
+ modulusLength: 2048,
+ publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
+};
+var extractable = true;
+
+debug("Generating a key pair...");
+crypto.webkitSubtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) {
+ keyPair = result;
+ shouldBe("keyPair.toString()", "'[object CryptoKeyPair]'");
+ shouldBe("keyPair.publicKey.type", "'public'");
+ shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+ shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
+ shouldBeUndefined("keyPair.publicKey.algorithm.hash");
+ shouldBe("keyPair.privateKey.type", "'private'");
+ shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+ shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048");
+ shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
+ shouldBeUndefined("keyPair.privateKey.algorithm.hash");
+
+ debug("\nTesting that custom attributes on keys survive garbage collection...");
+ keyPair.publicKey.foo = "bar";
+ gc();
+ setTimeout(function() {
+ gc();
+ setTimeout(function() {
+ shouldBe("keyPair.publicKey.foo", "'bar'");
+ finishJSTest();
+ }, 0);
+ }, 0);
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwkexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+Test importing an RSA key for RSASSA-PKCS1-v1_5.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a public key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.usages is ['sign','verify']
+PASS publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash.name is 'SHA-256'
+
+Importing a private key...
+PASS privateKey.toString() is '[object CryptoKey]'
+PASS privateKey.type is 'private'
+PASS privateKey.usages is ['sign','verify']
+PASS privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS privateKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(privateKey.algorithm.publicExponent) is '010001'
+PASS privateKey.algorithm.hash.name is 'SHA-256'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwksmallkeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+A key of size 2048 bits or larger MUST be used with RS256, RS384, RS512 JWK algorithms.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"]) threw exception TypeError: Key size is not valid for RS256.
+PASS crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"]) threw exception TypeError: Key size is not valid for RS512.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwksmallkeyhtmlfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwksmallkeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("A key of size 2048 bits or larger MUST be used with RS256, RS384, RS512 JWK algorithms.");
+
+var extractable = true;
+
+// openssl genrsa 1024 >1024.pem
+// openssl asn1parse -in 1024.pem
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RS256",
+ n: Base64URL.stringify(hexStringToUint8Array("B7F103F8412CCD26F5D54FC3157CD8CE1F134F4EABF0A042350BDD7F00FEA2B77EEF19915B10AA2417BB2CB4EC1D57B9661A20072469B9DF9C6E89CB35CCC8543CC40770DCC30D0BBFF1BF9DA1E2549F40476EDADB9312985DAE8C7527C1C12AAFEDF4584989968CDCC9EFEB197438C534D1BFAAC30B1D41F75EADB86CC581B9")),
+ e: Base64URL.stringify(hexStringToUint8Array("010001"))
+};
+
+var privateKeyJSON = {
+ kty: "RSA",
+ alg: "RS512",
+ n: Base64URL.stringify(hexStringToUint8Array("B7F103F8412CCD26F5D54FC3157CD8CE1F134F4EABF0A042350BDD7F00FEA2B77EEF19915B10AA2417BB2CB4EC1D57B9661A20072469B9DF9C6E89CB35CCC8543CC40770DCC30D0BBFF1BF9DA1E2549F40476EDADB9312985DAE8C7527C1C12AAFEDF4584989968CDCC9EFEB197438C534D1BFAAC30B1D41F75EADB86CC581B9")),
+ e: Base64URL.stringify(hexStringToUint8Array("010001")),
+ d: Base64URL.stringify(hexStringToUint8Array("5BA6F4F26B0F36BDB5FA6EBEE6E3096853259CFBB742B3A7A9A4DADDE0920063EC149929CB3557819A6D824E37E43B04BF323F492FC49A8028031017B81BECA8EC2A85ABCF193501D80DC251DB8863B8673D8B6772DB2D2AE08CD1829C3F542141461CACE4E8A1F112AD13FF4A4DD865A89AEA94E984D487E5798EF07643B9CD")),
+ p: Base64URL.stringify(hexStringToUint8Array("E06BFE5722A68E5D597DD8DB937483CBA352AB817209275ADAD103772B7A8EF4EA946311A2B51805959818CEB362F257D6998B475FEA9E34F2A30205B5F5A7FF")),
+ q: Base64URL.stringify(hexStringToUint8Array("D1D2DBDB1F4DCBFE8D16CDD2CF83C7B5FADFC7891F22FC527BF208F81B92F2543569C3AD22224B82D407DEB65F651D09D2558FEE8BC6E5DA51F6F13206CC1647")),
+ dp: Base64URL.stringify(hexStringToUint8Array("73ECB4F3D3AD4F6ABEF877D56C84CA339D88ED98AF0C356D040CE58A60462DA42BAC3CC47654AF34EB4226C656F96C8F9D05B1614C1588657754668E06A0FF87")),
+ dq: Base64URL.stringify(hexStringToUint8Array("5B9C5ACDB33F3E5FE7AE1B337DD325B138D5D7C2F0CB4FAB9BDE333850A1BA183631F5737441D102501D178A3CE062EB54E072B54E660B19654C12472B5C9425")),
+ qi: Base64URL.stringify(hexStringToUint8Array("D6A920B241178923C59BCBD1A815764619225A90F2C090A9FBD594A61561542D0DF179590413C26C8A72FC6E14EC63A377169970671B3A1EB5E4F4DF1A4CA725"))
+};
+
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"])');
+shouldThrow('crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"])');
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwkhtmlfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test importing an RSA key for RSASSA-PKCS1-v1_5.");
+
+jsTestIsAsync = true;
+
+var extractable = 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"
+};
+
+debug("Importing a public key...");
+crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"]).then(function(result) {
+ publicKey = result;
+ shouldBe("publicKey.toString()", "'[object CryptoKey]'");
+ shouldBe("publicKey.type", "'public'");
+ shouldBe("publicKey.usages", "['sign','verify']");
+ 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'");
+ debug("\nImporting a private key...");
+ return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"]);
+}).then(function(result) {
+ privateKey = result;
+ shouldBe("privateKey.toString()", "'[object CryptoKey]'");
+ shouldBe("privateKey.type", "'private'");
+ shouldBe("privateKey.usages", "['sign','verify']");
+ 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'");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5signverifyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+Test importing an RSA key for RSASSA-PKCS1-v1_5.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing a public key...
+
+Importing a private key...
+
+Signing some text...
+PASS bytesToHexString(new Uint8Array(signature)) is '0fd9a8aef4cc1876c0b762545336c6d1fb315ae16ae4b5e4bf34d384d8585ea7a01e76ea09ee7f7ee8d1c122e7dd15b7c94a573b2aa07203e8d13bc6fd16156cd8e5f0c15a15dccb62d152127fca09882fb53bc3e60ab586d15b95cf411e3aab4a1c231a7e91aab09ee3d4b13d11e97505ddff77683470da510ee76e8bd530c56a85f901626a5a710f716f113dfe9cf6c473ee16fa248aea3480a1033abe30f4c1243289a661e64d7818b55698280688097135968c6d4b029496d85cab2a67e4696737781f70e4392c7df71bbd6c92465947f029a1de48160aced11b5721b1cd25039fe2c16c2b38de73df3b9a83e3ea755fd0cfe51ca06b61fadf6d84677f95'
+
+Verifying the signature...
+PASS verificationResult is true
+
+Verifying a bad signature...
+PASS verificationResult is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5signverifyhtmlfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test importing an RSA key for RSASSA-PKCS1-v1_5.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RS256",
+ n: Base64URL.stringify(hexStringToUint8Array("ADC0940AFECE7351D56A6D432210B3AA49D38566B03A9F102E4F198B2DA9D740728D01426A3A058B2B805A5F91D565D969FE318AD2D1ADA713F5A829CC8CDCF8C6CB4872068164063B6D651A2226CB97ED67E0FC6C702A473DB2D79A730F8738084A2EED74922C3A119D1D101B932C0E10FAB36815F66C0792BB640B1B4C59D062FBBEDAB3CC069A535195D70E4A06432CAF149C24A00353A0B99F7CF5B17273CB4E38421BD315127CF4B3DCB3D20A7C98CFAF1A0E398A55E347FA283CE7B39273259B1B2132DC18B0EB8AAE9F78EE525356B09DF39E090E76D7985B2B71E50AF85CA36CE91F8CCB2ABBD8A529D369890D98A2CA2825C4C2FF8B7FBF09E79C0B")),
+ e: Base64URL.stringify(hexStringToUint8Array("010001")),
+};
+
+var privateKeyJSON = {
+ kty: "RSA",
+ alg: "RS256",
+ n: Base64URL.stringify(hexStringToUint8Array("ADC0940AFECE7351D56A6D432210B3AA49D38566B03A9F102E4F198B2DA9D740728D01426A3A058B2B805A5F91D565D969FE318AD2D1ADA713F5A829CC8CDCF8C6CB4872068164063B6D651A2226CB97ED67E0FC6C702A473DB2D79A730F8738084A2EED74922C3A119D1D101B932C0E10FAB36815F66C0792BB640B1B4C59D062FBBEDAB3CC069A535195D70E4A06432CAF149C24A00353A0B99F7CF5B17273CB4E38421BD315127CF4B3DCB3D20A7C98CFAF1A0E398A55E347FA283CE7B39273259B1B2132DC18B0EB8AAE9F78EE525356B09DF39E090E76D7985B2B71E50AF85CA36CE91F8CCB2ABBD8A529D369890D98A2CA2825C4C2FF8B7FBF09E79C0B")),
+ e: Base64URL.stringify(hexStringToUint8Array("010001")),
+ d: Base64URL.stringify(hexStringToUint8Array("78D2D2DFB682CFB45748D3C3FC3B4B049EA3E53F1C4B17734410A33DA23A59C1AA269D7A96ADD44F0BA80CB02A940F681989B6DFC76C216A6EB9C3FF950B5B59EFBB4A9C6823AFEF99819FED85541EFD7E0C5F6A88E992ACC99DC4C9D53B361763C45A4FAB613E39FF27971F2D5DB123F2F0B2B32D9A9752C8D9605F4CD3521C2DB9A86000A3040A16231F61278C7747C3AB18DBEC00A5D71023B50B134A28E51CDB419A66BA170DF618817342F7861174AA8E7499B974DBFEB9FC643B0E95645C1C4D81104BCE53DA6E6CF31B6A0085F79F2E0626482D68A5A0A45C4EAF45640D58D2F8E5164D64560CDEEA0982138CA867A870CD01A63742847ACF3A516F49")),
+ p: Base64URL.stringify(hexStringToUint8Array("E26893B808CA31E1F9B89E4A077F7B414C216E46048126DC0369A27E64A4BC4DB4D7C81BE79AA40472B5795AF27F5FE6E372CD95CE8EFDA93A81FCDD64866F4B93421A33E5D2AD3DA65529BBCA85392B2907003AEEA187EFA9459592E7FDDE328254BBC1F2EBBB8FF962CF2A2CBB3E0EA54BBE2C29A2C3A7CB25AAC0CE405E9D")),
+ q: Base64URL.stringify(hexStringToUint8Array("C4762BCE48AFB669F3FEC19C867586734ABEA433A42A2729B51A6FDA93052085F19C55F968C7845C866356E8D7B70532D5494520DD866494AFCB9289EFD9AEFD7C8D9C51CCCDE747F80DDE7B7BBC875514AD917EBD4BB5FDEE14FF1EBB34DD5D79DCD448ACA737BA459773A4B9284C056195F9CC3338F75C5407D5B9997150C7")),
+ dp: Base64URL.stringify(hexStringToUint8Array("7C1CC3CD80D40660501A8A7B1E7D1DBDFFD3DBB57A46AA5CB56A34EF809065C15B3F66AD155B4A4A3DEF8964F7C62776547CDC8220C775FA4CDE71159443B5C302289C6092BDD8C610E66288554E8EB640395C40F20B8E8F2C85BEA6D791ED3A5703C8215BDF29E494DB3BA16CFFFFD6DB7A17F7F1A30E0A6F6C689C64F41869")),
+ dq: Base64URL.stringify(hexStringToUint8Array("8E61360E220F761C0380B5C042921A06A43CD5B3B75DF553FCB4542C0C30C3094FB90575E3C1F4E33961F5327A6361991D8A2457553478E0692717E46FB74B62DA49A6E8818D17F8C88504A06964908FD09499C5485AFE62319175F347A96064C6548C64BEFBD11F662004E7746907EF3E71FABF4AC016450B81421B6860FF31")),
+ qi: Base64URL.stringify(hexStringToUint8Array("6025FFA4BC1B3010354E1547D167309A7CADA8D72B3021304E6EC1C80D9E53A9D66D0AD42EF7FB9BDFE4CDF2D4723B27A405650501B924C5CCCB44AAE29B706F2C2C6B9F86F0A00E38E4762F7BF8842F84CACF5FB6014CFF78B4A38D1E7901F86F785A3DB9EDAC878C83C23394EB9560A7FDFB642E283A1679175DECDB1DC539"))
+};
+
+var data = asciiToUint8Array("Hello, world!");
+
+debug("Importing a public key...");
+crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["sign", "verify"]).then(function(result) {
+ publicKey = result;
+ debug("\nImporting a private key...");
+ return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["sign", "verify"]);
+}).then(function(result) {
+ privateKey = result;
+ debug("\nSigning some text...");
+ return crypto.webkitSubtle.sign({ name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" }, privateKey, data);
+}).then(function(result) {
+ signature = result;
+ shouldBe("bytesToHexString(new Uint8Array(signature))", "'0fd9a8aef4cc1876c0b762545336c6d1fb315ae16ae4b5e4bf34d384d8585ea7a01e76ea09ee7f7ee8d1c122e7dd15b7c94a573b2aa07203e8d13bc6fd16156cd8e5f0c15a15dccb62d152127fca09882fb53bc3e60ab586d15b95cf411e3aab4a1c231a7e91aab09ee3d4b13d11e97505ddff77683470da510ee76e8bd530c56a85f901626a5a710f716f113dfe9cf6c473ee16fa248aea3480a1033abe30f4c1243289a661e64d7818b55698280688097135968c6d4b029496d85cab2a67e4696737781f70e4392c7df71bbd6c92465947f029a1de48160aced11b5721b1cd25039fe2c16c2b38de73df3b9a83e3ea755fd0cfe51ca06b61fadf6d84677f95'");
+
+ debug("\nVerifying the signature...");
+ return crypto.webkitSubtle.verify({ name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" }, publicKey, signature, data);
+}).then(function(result) {
+ verificationResult = result;
+ shouldBe("verificationResult", "true");
+ debug("\nVerifying a bad signature...");
+ return crypto.webkitSubtle.verify({ name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" }, publicKey, new Uint8Array(256), data);
+}).then(function(result) {
+ verificationResult = result;
+ shouldBe("verificationResult", "false");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha1expectedtxtfromrev206882trunkLayoutTestscryptosubtlesha1expectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-1-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-1-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-1-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-1-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test crypto.webkitSubtle.digest.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+SHA1 of []
+PASS bytesToHexString(new Uint8Array(digest)) is 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
+SHA1 of [0x0]
+PASS bytesToHexString(new Uint8Array(digest)) is '5ba93c9db0cff93f52b521d7420e43f6eda2784f'
+SHA1 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+PASS bytesToHexString(new Uint8Array(digest)) is '2c7e7c384f7829694282b1e3a6216def8082d055'
+PASS crypto.webkitSubtle.generateKey('sha-1') threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha1htmlfromrev206882trunkLayoutTestscryptosubtlesha1html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-1.html (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-1.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-1.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-1.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test crypto.webkitSubtle.digest.");
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+ debug("SHA1 of []");
+ return crypto.webkitSubtle.digest('sha-1', new Uint8Array([]));
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'da39a3ee5e6b4b0d3255bfef95601890afd80709'");
+
+ debug("SHA1 of [0x0]")
+ return crypto.webkitSubtle.digest({name: 'sha-1'}, new Uint8Array([0]));
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'5ba93c9db0cff93f52b521d7420e43f6eda2784f'");
+
+ debug("SHA1 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
+ var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
+ return crypto.webkitSubtle.digest({name: 'sha-1'}, data);
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'2c7e7c384f7829694282b1e3a6216def8082d055'");
+
+ // All SHA-1 can do is digest.
+ shouldThrow("crypto.webkitSubtle.generateKey('sha-1')");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha224expectedtxtfromrev206882trunkLayoutTestscryptosubtlesha224expectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-224-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-224-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-224-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-224-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test crypto.webkitSubtle.digest.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+SHA224 of []
+PASS bytesToHexString(new Uint8Array(digest)) is 'd14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f'
+SHA224 of [0x0]
+PASS bytesToHexString(new Uint8Array(digest)) is 'fff9292b4201617bdc4d3053fce02734166a683d7d858a7f5f59b073'
+SHA224 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+PASS bytesToHexString(new Uint8Array(digest)) is '767d0cdc11079ba8dca276df5c4b85507de67dce47eda4cd9196d312'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha224htmlfromrev206882trunkLayoutTestscryptosubtlesha224html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-224.html (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-224.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-224.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-224.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test crypto.webkitSubtle.digest.");
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+ debug("SHA224 of []");
+ return crypto.webkitSubtle.digest('sha-224', new Uint8Array([]));
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f'");
+
+ debug("SHA224 of [0x0]")
+ return crypto.webkitSubtle.digest({name: 'sha-224'}, new Uint8Array([0]));
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'fff9292b4201617bdc4d3053fce02734166a683d7d858a7f5f59b073'");
+
+ debug("SHA224 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
+ var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
+ return crypto.webkitSubtle.digest({name: 'sha-224'}, data);
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'767d0cdc11079ba8dca276df5c4b85507de67dce47eda4cd9196d312'");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha256expectedtxtfromrev206882trunkLayoutTestscryptosubtlesha256expectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-256-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-256-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-256-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-256-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test crypto.webkitSubtle.digest.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+SHA256 of []
+PASS bytesToHexString(new Uint8Array(digest)) is 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
+SHA256 of [0x0]
+PASS bytesToHexString(new Uint8Array(digest)) is '6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d'
+SHA256 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+PASS bytesToHexString(new Uint8Array(digest)) is '78a6273103d17c39a0b6126e226cec70e33337f4bc6a38067401b54a33e78ead'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha256htmlfromrev206882trunkLayoutTestscryptosubtlesha256html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-256.html (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-256.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-256.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-256.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test crypto.webkitSubtle.digest.");
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+ debug("SHA256 of []");
+ return crypto.webkitSubtle.digest('sha-256', new Uint8Array([]));
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'");
+
+ debug("SHA256 of [0x0]")
+ return crypto.webkitSubtle.digest({name: 'sha-256'}, new Uint8Array([0]));
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d'");
+
+ debug("SHA256 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
+ var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
+ return crypto.webkitSubtle.digest({name: 'sha-256'}, data);
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'78a6273103d17c39a0b6126e226cec70e33337f4bc6a38067401b54a33e78ead'");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha384expectedtxtfromrev206882trunkLayoutTestscryptosubtlesha384expectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-384-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-384-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-384-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-384-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test crypto.webkitSubtle.digest.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+SHA384 of []
+PASS bytesToHexString(new Uint8Array(digest)) is '38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b'
+SHA384 of [0x0]
+PASS bytesToHexString(new Uint8Array(digest)) is 'bec021b4f368e3069134e012c2b4307083d3a9bdd206e24e5f0d86e13d6636655933ec2b413465966817a9c208a11717'
+SHA384 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+PASS bytesToHexString(new Uint8Array(digest)) is '89bfcf569ae4af718510da78c67414109f5739bb5c40d51c9c8c50e2b2cee86f2f80c8b9d68f7c01201a0714572fe602'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha384htmlfromrev206882trunkLayoutTestscryptosubtlesha384html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-384.html (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-384.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-384.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-384.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test crypto.webkitSubtle.digest.");
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+ debug("SHA384 of []");
+ return crypto.webkitSubtle.digest('sha-384', new Uint8Array([]));
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b'");
+
+ debug("SHA384 of [0x0]")
+ return crypto.webkitSubtle.digest({name: 'sha-384'}, new Uint8Array([0]));
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'bec021b4f368e3069134e012c2b4307083d3a9bdd206e24e5f0d86e13d6636655933ec2b413465966817a9c208a11717'");
+
+ debug("SHA384 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
+ var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
+ return crypto.webkitSubtle.digest({name: 'sha-384'}, data);
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'89bfcf569ae4af718510da78c67414109f5739bb5c40d51c9c8c50e2b2cee86f2f80c8b9d68f7c01201a0714572fe602'");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha512expectedtxtfromrev206882trunkLayoutTestscryptosubtlesha512expectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-512-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-512-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-512-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-512-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test crypto.webkitSubtle.digest.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+SHA512 of []
+PASS bytesToHexString(new Uint8Array(digest)) is 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'
+SHA512 of [0x0]
+PASS bytesToHexString(new Uint8Array(digest)) is 'b8244d028981d693af7b456af8efa4cad63d282e19ff14942c246e50d9351d22704a802a71c3580b6370de4ceb293c324a8423342557d4e5c38438f0e36910ee'
+SHA512 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+PASS bytesToHexString(new Uint8Array(digest)) is '8ffaee0cccc162851faf051ae38667eefd423c0164c50055f8ade00afc3705e3cdeb9900004b0e426ca66ab63aa3b99b075273f44fd37c22a3555c6fd1f37ccb'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha512htmlfromrev206882trunkLayoutTestscryptosubtlesha512html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-512.html (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-512.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-512.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-512.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test crypto.webkitSubtle.digest.");
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+ debug("SHA512 of []");
+ return crypto.webkitSubtle.digest('sha-512', new Uint8Array([]));
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'");
+
+ debug("SHA512 of [0x0]")
+ return crypto.webkitSubtle.digest({name: 'sha-512'}, new Uint8Array([0]));
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'b8244d028981d693af7b456af8efa4cad63d282e19ff14942c246e50d9351d22704a802a71c3580b6370de4ceb293c324a8423342557d4e5c38438f0e36910ee'");
+
+ debug("SHA512 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
+ var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
+ return crypto.webkitSubtle.digest({name: 'sha-512'}, data);
+}).then(function(result) {
+ digest = result;
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'8ffaee0cccc162851faf051ae38667eefd423c0164c50055f8ade00afc3705e3cdeb9900004b0e426ca66ab63aa3b99b075273f44fd37c22a3555c6fd1f37ccb'");
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleunimplementedunwrapcrashexpectedtxtfromrev206882trunkLayoutTestscryptosubtleunimplementedunwrapcrashexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+Make sure that unwrap does not cause a crash.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleunimplementedunwrapcrashhtmlfromrev206882trunkLayoutTestscryptosubtleunimplementedunwrapcrashhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash.html (from rev 206882, trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Make sure that unwrap does not cause a crash.");
+
+jsTestIsAsync = true;
+
+crypto.webkitSubtle.generateKey({name: "AES-KW", length: 256}, false, ["wrapKey"]).then(function(wrappingKey) {
+ return crypto.webkitSubtle.generateKey({name: "HMAC", hash: {name: "SHA-256"}}, true, ["sign", "verify"]).then(function(aesKey) {
+ return crypto.webkitSubtle.wrapKey("raw", aesKey, wrappingKey, {name: "AES-KW"});
+ });
+}).then(finishJSTest, finishJSTest); // OK if the browser does not crash.
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleunwrapKeycheckusageexpectedtxtfromrev206882trunkLayoutTestscryptosubtleunwrapKeycheckusageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+CONSOLE MESSAGE: line 1: Key usages do not include 'unwrapKey'
+Verify that usage is respected in unwrapKey operation.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing RSA keys...
+Importing an AES key...
+Wrapping it...
+Unwrapping it...
+PASS crypto.webkitSubtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleunwrapKeycheckusagehtmlfromrev206882trunkLayoutTestscryptosubtleunwrapKeycheckusagehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage.html (from rev 206882, trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Verify that usage is respected in unwrapKey operation.");
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RSA-OAEP",
+ n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
+ e: "AQAB"
+};
+
+var privateKeyJSON = {
+ kty: "RSA",
+ alg: "RSA-OAEP",
+ 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 wrapAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
+var extractable = true;
+var nonExtractable = false;
+
+debug("Importing RSA keys...");
+crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["wrapKey"]).then(function(result) {
+ publicKey = result;
+ return crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, ["encrypt", "decrypt", "wrapKey"]);
+}).then(function(result) {
+ privateKey = result;
+
+ debug("Importing an AES key...");
+ aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
+ return crypto.webkitSubtle.importKey("raw", aesKeyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
+}).then(function(result) {
+ aesKey = result;
+
+ debug("Wrapping it...");
+ return crypto.webkitSubtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm);
+}).then(function(result) {
+ wrappedKey = result;
+
+ debug("Unwrapping it...");
+ // privateKey lacks unwrapKey usage.
+ shouldThrow('crypto.webkitSubtle.unwrapKey("raw", wrappedKey, privateKey, wrapAlgorithm, "aes-cbc", extractable, ["encrypt", "decrypt"])');
+
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlewrapKeycheckusageexpectedtxtfromrev206882trunkLayoutTestscryptosubtlewrapKeycheckusageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+CONSOLE MESSAGE: line 1: Key usages do not include 'wrapKey'
+Verify that usage is respected in wrapKey operation.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Importing an RSA key...
+Importing an AES key...
+Wrapping it...
+PASS crypto.webkitSubtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlewrapKeycheckusagehtmlfromrev206882trunkLayoutTestscryptosubtlewrapKeycheckusagehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage.html (from rev 206882, trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage.html         (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Verify that usage is respected in wrapKey operation.");
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+ kty: "RSA",
+ alg: "RSA-OAEP",
+ n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
+ e: "AQAB"
+};
+
+var wrapAlgorithm = {name: "RSA-OAEP", hash: "sha-1"};
+var extractable = true;
+var nonExtractable = false;
+
+debug("Importing an RSA key...");
+crypto.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, ["encrypt", "decrypt", "unwrapKey"]).then(function(result) {
+ publicKey = result;
+
+ debug("Importing an AES key...");
+ aesKeyData = hexStringToUint8Array("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4");
+ return crypto.webkitSubtle.importKey("raw", aesKeyData, "aes-cbc", extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"])
+}).then(function(result) {
+ aesKey = result;
+
+ debug("Wrapping it...");
+ // publicKey lacks wrapKey usage.
+ shouldThrow('crypto.webkitSubtle.wrapKey("raw", aesKey, publicKey, wrapAlgorithm)');
+ finishJSTest();
+});
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkersaespostMessageworkerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-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
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersaespostMessageworkerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 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>
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkershmacpostMessageworkerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,16 +0,0 @@
</span><del>-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
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkershmacpostMessageworkerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,37 +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 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>
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkershrsapostMessageworkerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,25 +0,0 @@
</span><del>-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
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkershrsapostMessageworkerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,84 +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 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>
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersmultiplepostMessageworkerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,69 +0,0 @@
</span><del>-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
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersmultiplepostMessageworkerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,47 +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 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>
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersresourcesaespostMessageworkerjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,18 +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 != "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 });
-}
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersresourceshmacpostMessageworkerjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,20 +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.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 });
-}
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersresourceshrsapostMessageworkerjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-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 });
- }
-}
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersresourcesrsapostMessageworkerjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-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 });
- }
-}
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersrsapostMessageworkerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,25 +0,0 @@
</span><del>-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
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersrsapostMessageworkerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,84 +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 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>
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleaespostMessageworkerexpectedtxtfromrev206882trunkLayoutTestscryptoworkersaespostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker-expected.txt (from rev 206882, trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</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="trunkLayoutTestscryptoworkerssubtleaespostMessageworkerhtmlfromrev206882trunkLayoutTestscryptoworkersaespostMessageworkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker.html (from rev 206882, trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker.html         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</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.webkitSubtle.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="trunkLayoutTestscryptoworkerssubtlegcworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/gc-worker-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/gc-worker-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/gc-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+[Worker] Test that self.crypto.subtle wrapper preserves custom properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Starting worker: resources/gc-worker.js
+PASS [Worker] self.crypto.subtle.foo is "bar"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlegcworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/gc-worker.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/gc-worker.html         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/gc-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+ <script src="../../../resources/js-test-pre.js"></script>
+</head>
+<body>
+ <script>
+ worker = startWorker('resources/gc-worker.js');
+ </script>
+ <script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerexpectedtxtfromrev206882trunkLayoutTestscryptoworkershmacpostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt (from rev 206882, trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</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="trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerhtmlfromrev206882trunkLayoutTestscryptoworkershmacpostMessageworkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker.html (from rev 206882, trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker.html         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</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.webkitSubtle.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="trunkLayoutTestscryptoworkerssubtlehrsapostMessageworkerexpectedtxtfromrev206882trunkLayoutTestscryptoworkershrsapostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker-expected.txt (from rev 206882, trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</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="trunkLayoutTestscryptoworkerssubtlehrsapostMessageworkerhtmlfromrev206882trunkLayoutTestscryptoworkershrsapostMessageworkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker.html (from rev 206882, trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker.html         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</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.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), algorithmKeyGen, true, ['encrypt']).then(function(localPublicKey) {
+ worker.postMessage({ publicKey: localPublicKey });
+});
+crypto.webkitSubtle.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="trunkLayoutTestscryptoworkerssubtlemultiplepostMessageworkerexpectedtxtfromrev206882trunkLayoutTestscryptoworkersmultiplepostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker-expected.txt (from rev 206882, trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</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="trunkLayoutTestscryptoworkerssubtlemultiplepostMessageworkerhtmlfromrev206882trunkLayoutTestscryptoworkersmultiplepostMessageworkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker.html (from rev 206882, trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker.html         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</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.webkitSubtle.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="trunkLayoutTestscryptoworkerssubtleresourcesaespostMessageworkerjsfromrev206882trunkLayoutTestscryptoworkersresourcesaespostMessageworkerjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/resources/aes-postMessage-worker.js (from rev 206882, trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/aes-postMessage-worker.js         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/aes-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</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="trunkLayoutTestscryptoworkerssubtleresourcesgcworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/resources/gc-worker.js (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/gc-worker.js         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/gc-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+importScripts('../../../../resources/js-test-pre.js');
+
+description("Test that self.crypto.subtle wrapper preserves custom properties.");
+jsTestIsAsync = true;
+
+function startTest()
+{
+ self.crypto.subtle.foo = "bar";
+ gc();
+ setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+ gc();
+ setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+ gc();
+ shouldBe('self.crypto.subtle.foo', '"bar"');
+ finishJSTest();
+}
+
+startTest();
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleresourceshmacpostMessageworkerjsfromrev206882trunkLayoutTestscryptoworkersresourceshmacpostMessageworkerjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js (from rev 206882, trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</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="trunkLayoutTestscryptoworkerssubtleresourceshrsapostMessageworkerjsfromrev206882trunkLayoutTestscryptoworkersresourceshrsapostMessageworkerjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/resources/hrsa-postMessage-worker.js (from rev 206882, trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/hrsa-postMessage-worker.js         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/hrsa-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</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="trunkLayoutTestscryptoworkerssubtleresourcesrsapostMessageworkerjsfromrev206882trunkLayoutTestscryptoworkersresourcesrsapostMessageworkerjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/resources/rsa-postMessage-worker.js (from rev 206882, trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/rsa-postMessage-worker.js         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/rsa-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</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="trunkLayoutTestscryptoworkerssubtlersapostMessageworkerexpectedtxtfromrev206882trunkLayoutTestscryptoworkersrsapostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker-expected.txt (from rev 206882, trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker-expected.txt         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</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="trunkLayoutTestscryptoworkerssubtlersapostMessageworkerhtmlfromrev206882trunkLayoutTestscryptoworkersrsapostMessageworkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker.html (from rev 206882, trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker.html         (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</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.webkitSubtle.importKey("jwk", asciiToUint8Array(JSON.stringify(publicKeyJSON)), algorithmKeyGen, true, ['encrypt']).then(function(localPublicKey) {
+ worker.postMessage({ publicKey: localPublicKey });
+});
+crypto.webkitSubtle.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="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-10-06 Jiewen Tan <jiewen_tan@apple.com>
+
+ Add a dummy SubtleCrypto interface
+ https://bugs.webkit.org/show_bug.cgi?id=162992
+ <rdar://problem/28643573>
+
+ Reviewed by Brent Fulgham.
+
+ * WebCryptoAPI/digest/test_digest-expected.txt:
+ * WebCryptoAPI/idlharness-expected.txt:
+
</ins><span class="cx"> 2016-10-06 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed, drop bad tests that were included by mistake in r206874.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIdigesttest_digestexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,84 +1,84 @@
</span><span class="cx"> encrypt Tests for digest method
</span><span class="cx">
</span><span class="cx">
</span><del>-FAIL SHA-1 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-1 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-1 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with empty source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-256 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-256 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with empty source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-384 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-384 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with empty source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-512 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-512 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with empty source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-1 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-1 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with short source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-256 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-256 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with short source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-384 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-384 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with short source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-512 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-512 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with short source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-1 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-1 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with medium source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-256 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-256 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with medium source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-384 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-384 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with medium source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-512 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-512 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with medium source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-1 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-1 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with long source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-256 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-256 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with long source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-384 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-384 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with long source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-512 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-512 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with long source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-GCM with empty undefined is not an object (evaluating 'subtle.digest')
-FAIL RSA-OAEP with empty undefined is not an object (evaluating 'subtle.digest')
-FAIL PBKDF2 with empty undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-KW with empty undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-GCM with short undefined is not an object (evaluating 'subtle.digest')
-FAIL RSA-OAEP with short undefined is not an object (evaluating 'subtle.digest')
-FAIL PBKDF2 with short undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-KW with short undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-GCM with medium undefined is not an object (evaluating 'subtle.digest')
-FAIL RSA-OAEP with medium undefined is not an object (evaluating 'subtle.digest')
-FAIL PBKDF2 with medium undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-KW with medium undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-GCM with long undefined is not an object (evaluating 'subtle.digest')
-FAIL RSA-OAEP with long undefined is not an object (evaluating 'subtle.digest')
-FAIL PBKDF2 with long undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-KW with long undefined is not an object (evaluating 'subtle.digest')
</del><ins>+FAIL SHA-1 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-1 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-1 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-1 with empty source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-256 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-256 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-256 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-256 with empty source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-384 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-384 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-384 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-384 with empty source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-512 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-512 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-512 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-512 with empty source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-1 with short source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-1 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-1 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-1 with short source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-256 with short source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-256 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-256 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-256 with short source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-384 with short source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-384 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-384 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-384 with short source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-512 with short source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-512 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-512 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-512 with short source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-1 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-1 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-1 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-1 with medium source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-256 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-256 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-256 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-256 with medium source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-384 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-384 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-384 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-384 with medium source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-512 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-512 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-512 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-512 with medium source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-1 with long source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-1 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-1 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-1 with long source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-256 with long source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-256 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-256 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-256 with long source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-384 with long source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-384 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-384 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-384 with long source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-512 with long source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-512 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-512 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-512 with long source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL AES-GCM with empty subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL RSA-OAEP with empty subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL PBKDF2 with empty subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-KW with empty subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-GCM with short subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL RSA-OAEP with short subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL PBKDF2 with short subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-KW with short subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-GCM with medium subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL RSA-OAEP with medium subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL PBKDF2 with medium subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-KW with medium subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-GCM with long subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL RSA-OAEP with long subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL PBKDF2 with long subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-KW with long subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIidlharnessexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -8,11 +8,11 @@
</span><span class="cx"> PASS Crypto interface object name
</span><span class="cx"> PASS Crypto interface: existence and properties of interface prototype object
</span><span class="cx"> PASS Crypto interface: existence and properties of interface prototype object's "constructor" property
</span><del>-FAIL Crypto interface: attribute subtle assert_true: The prototype object must have a property "subtle" expected true got false
</del><ins>+PASS Crypto interface: attribute subtle
</ins><span class="cx"> PASS Crypto interface: operation getRandomValues(ArrayBufferView)
</span><span class="cx"> PASS Crypto must be primary interface of crypto
</span><span class="cx"> PASS Stringification of crypto
</span><del>-FAIL Crypto interface: crypto must inherit property "subtle" with the proper type (0) assert_inherits: property "subtle" not found in prototype chain
</del><ins>+PASS Crypto interface: crypto must inherit property "subtle" with the proper type (0)
</ins><span class="cx"> PASS Crypto interface: crypto must inherit property "getRandomValues" with the proper type (1)
</span><span class="cx"> PASS Crypto interface: calling getRandomValues(ArrayBufferView) on crypto with too few arguments must throw TypeError
</span><span class="cx"> PASS CryptoKey interface: existence and properties of interface object
</span><span class="lines">@@ -41,30 +41,30 @@
</span><span class="cx"> FAIL SubtleCrypto interface: operation exportKey(KeyFormat,CryptoKey) assert_own_property: self does not have own property "SubtleCrypto" expected property "SubtleCrypto" missing
</span><span class="cx"> FAIL SubtleCrypto interface: operation wrapKey(KeyFormat,CryptoKey,CryptoKey,AlgorithmIdentifier) assert_own_property: self does not have own property "SubtleCrypto" expected property "SubtleCrypto" missing
</span><span class="cx"> FAIL SubtleCrypto interface: operation unwrapKey(KeyFormat,BufferSource,CryptoKey,AlgorithmIdentifier,AlgorithmIdentifier,boolean,[object Object]) assert_own_property: self does not have own property "SubtleCrypto" expected property "SubtleCrypto" missing
</span><del>-FAIL SubtleCrypto must be primary interface of crypto.subtle assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL Stringification of crypto.subtle assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: crypto.subtle must inherit property "encrypt" with the proper type (0) assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: calling encrypt(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: crypto.subtle must inherit property "decrypt" with the proper type (1) assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: calling decrypt(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: crypto.subtle must inherit property "sign" with the proper type (2) assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: calling sign(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: crypto.subtle must inherit property "verify" with the proper type (3) assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: calling verify(AlgorithmIdentifier,CryptoKey,BufferSource,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: crypto.subtle must inherit property "digest" with the proper type (4) assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: calling digest(AlgorithmIdentifier,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: crypto.subtle must inherit property "generateKey" with the proper type (5) assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: calling generateKey(AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: crypto.subtle must inherit property "deriveKey" with the proper type (6) assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: calling deriveKey(AlgorithmIdentifier,CryptoKey,AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: crypto.subtle must inherit property "deriveBits" with the proper type (7) assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: calling deriveBits(AlgorithmIdentifier,CryptoKey,unsigned long) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: crypto.subtle must inherit property "importKey" with the proper type (8) assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: calling importKey(KeyFormat,[object Object],[object Object],AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: crypto.subtle must inherit property "exportKey" with the proper type (9) assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: calling exportKey(KeyFormat,CryptoKey) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: crypto.subtle must inherit property "wrapKey" with the proper type (10) assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: calling wrapKey(KeyFormat,CryptoKey,CryptoKey,AlgorithmIdentifier) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: crypto.subtle must inherit property "unwrapKey" with the proper type (11) assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL SubtleCrypto interface: calling unwrapKey(KeyFormat,BufferSource,CryptoKey,AlgorithmIdentifier,AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
</del><ins>+FAIL SubtleCrypto must be primary interface of crypto.subtle assert_own_property: self does not have own property "SubtleCrypto" expected property "SubtleCrypto" missing
+PASS Stringification of crypto.subtle
+FAIL SubtleCrypto interface: crypto.subtle must inherit property "encrypt" with the proper type (0) assert_inherits: property "encrypt" not found in prototype chain
+FAIL SubtleCrypto interface: calling encrypt(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "encrypt" not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property "decrypt" with the proper type (1) assert_inherits: property "decrypt" not found in prototype chain
+FAIL SubtleCrypto interface: calling decrypt(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "decrypt" not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property "sign" with the proper type (2) assert_inherits: property "sign" not found in prototype chain
+FAIL SubtleCrypto interface: calling sign(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "sign" not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property "verify" with the proper type (3) assert_inherits: property "verify" not found in prototype chain
+FAIL SubtleCrypto interface: calling verify(AlgorithmIdentifier,CryptoKey,BufferSource,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "verify" not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property "digest" with the proper type (4) assert_inherits: property "digest" not found in prototype chain
+FAIL SubtleCrypto interface: calling digest(AlgorithmIdentifier,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "digest" not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property "generateKey" with the proper type (5) assert_inherits: property "generateKey" not found in prototype chain
+FAIL SubtleCrypto interface: calling generateKey(AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "generateKey" not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property "deriveKey" with the proper type (6) assert_inherits: property "deriveKey" not found in prototype chain
+FAIL SubtleCrypto interface: calling deriveKey(AlgorithmIdentifier,CryptoKey,AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "deriveKey" not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property "deriveBits" with the proper type (7) assert_inherits: property "deriveBits" not found in prototype chain
+FAIL SubtleCrypto interface: calling deriveBits(AlgorithmIdentifier,CryptoKey,unsigned long) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "deriveBits" not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property "importKey" with the proper type (8) assert_inherits: property "importKey" not found in prototype chain
+FAIL SubtleCrypto interface: calling importKey(KeyFormat,[object Object],[object Object],AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "importKey" not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property "exportKey" with the proper type (9) assert_inherits: property "exportKey" not found in prototype chain
+FAIL SubtleCrypto interface: calling exportKey(KeyFormat,CryptoKey) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "exportKey" not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property "wrapKey" with the proper type (10) assert_inherits: property "wrapKey" not found in prototype chain
+FAIL SubtleCrypto interface: calling wrapKey(KeyFormat,CryptoKey,CryptoKey,AlgorithmIdentifier) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "wrapKey" not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property "unwrapKey" with the proper type (11) assert_inherits: property "unwrapKey" not found in prototype chain
+FAIL SubtleCrypto interface: calling unwrapKey(KeyFormat,BufferSource,CryptoKey,AlgorithmIdentifier,AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property "unwrapKey" not found in prototype chain
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsplatformeflTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/TestExpectations (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/TestExpectations        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/platform/efl/TestExpectations        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -375,7 +375,7 @@
</span><span class="cx"> http/tests/security/cross-origin-worker-indexeddb-allowed.html [ Skip ]
</span><span class="cx"> http/tests/security/cross-origin-worker-indexeddb.html [ Skip ]
</span><span class="cx">
</span><del>-webkit.org/b/87661 crypto/subtle/rsa-indexeddb.html [ Skip ]
</del><ins>+webkit.org/b/87661 crypto/webkitSubtle/rsa-indexeddb.html [ Skip ]
</ins><span class="cx"> storage/indexeddb/database-odd-names.html [ Skip ]
</span><span class="cx">
</span><span class="cx"> # EFL port has not supported selection gap painting since r200412
</span><span class="lines">@@ -1957,17 +1957,17 @@
</span><span class="cx"> # and their tests are whitelisted
</span><span class="cx"> webkit.org/b/133122 crypto/subtle [ Skip ]
</span><span class="cx"> webkit.org/b/133122 crypto/webkitSubtle [ Skip ]
</span><del>-webkit.org/b/133319 crypto/subtle/sha-1.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-224.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-256.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-384.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-512.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-check-algorithm.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-export-key.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-generate-key.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-import-jwk.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-sign-verify-empty-key.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-sign-verify.html [ Pass ]
</del><ins>+webkit.org/b/133319 crypto/webkitSubtle/sha-1.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-224.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-256.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-384.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-512.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-check-algorithm.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-export-key.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-generate-key.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-import-jwk.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-sign-verify-empty-key.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-sign-verify.html [ Pass ]
</ins><span class="cx">
</span><span class="cx"> # Missing EFL's accessibility functions
</span><span class="cx"> webkit.org/b/111984 accessibility/aria-hidden-updates-alldescendants.html [ Failure ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -377,17 +377,17 @@
</span><span class="cx"> # and their tests are whitelisted
</span><span class="cx"> webkit.org/b/133122 crypto/subtle [ Skip ]
</span><span class="cx"> webkit.org/b/133122 crypto/webkitSubtle [ Skip ]
</span><del>-webkit.org/b/133319 crypto/subtle/sha-1.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-224.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-256.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-384.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-512.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-check-algorithm.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-export-key.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-generate-key.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-import-jwk.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-sign-verify-empty-key.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-sign-verify.html [ Pass ]
</del><ins>+webkit.org/b/133319 crypto/webkitSubtle/sha-1.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-224.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-256.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-384.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-512.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-check-algorithm.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-export-key.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-generate-key.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-import-jwk.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-sign-verify-empty-key.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-sign-verify.html [ Pass ]
</ins><span class="cx">
</span><span class="cx"> # GTK does not implement setAutomaticLinkDetectionEnabled
</span><span class="cx"> editing/inserting/typing-space-to-trigger-smart-link.html [ Skip ]
</span><span class="lines">@@ -2261,7 +2261,7 @@
</span><span class="cx"> webkit.org/b/107825 media/nodesFromRect-shadowContent.html [ Failure ]
</span><span class="cx"> webkit.org/b/107825 media/video-controls-fullscreen-volume.html [ Failure ]
</span><span class="cx">
</span><del>-webkit.org/b/107194 crypto/subtle/rsa-indexeddb.html [ Skip ]
</del><ins>+webkit.org/b/107194 crypto/webkitSubtle/rsa-indexeddb.html [ Skip ]
</ins><span class="cx">
</span><span class="cx"> # Test marked in TestExpectations as failing on non-retina displays, passing on GTK port
</span><span class="cx"> webkit.org/b/129113 fast/multicol/newmulticol/clipping.html [ Pass ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -996,10 +996,10 @@
</span><span class="cx"> storage/indexeddb
</span><span class="cx"> imported/w3c/IndexedDB-private-browsing
</span><span class="cx"> imported/w3c/web-platform-tests/IndexedDB
</span><del>-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
</del><ins>+crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
+crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
+crypto/webkitSubtle/rsa-indexeddb-private.html
+crypto/webkitSubtle/rsa-indexeddb.html
</ins><span class="cx"> fast/history/page-cache-indexed-closed-db.html
</span><span class="cx"> fast/history/page-cache-indexed-opened-db.html
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/TestExpectations        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/platform/win/TestExpectations        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -257,10 +257,10 @@
</span><span class="cx"> http/tests/security/cross-origin-worker-indexeddb-allowed.html [ Skip ]
</span><span class="cx"> http/tests/security/cross-origin-worker-indexeddb.html [ Skip ]
</span><span class="cx"> http/tests/security/no-indexeddb-from-sandbox.html [ Skip ]
</span><del>-crypto/subtle/rsa-indexeddb-non-exportable-private.html [ Skip ]
-crypto/subtle/rsa-indexeddb-non-exportable.html [ Skip ]
-crypto/subtle/rsa-indexeddb-private.html [ Skip ]
-crypto/subtle/rsa-indexeddb.html [ Skip ]
</del><ins>+crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html [ Skip ]
+crypto/webkitSubtle/rsa-indexeddb-non-exportable.html [ Skip ]
+crypto/webkitSubtle/rsa-indexeddb-private.html [ Skip ]
+crypto/webkitSubtle/rsa-indexeddb.html [ Skip ]
</ins><span class="cx"> fast/history/page-cache-indexed-closed-db.html [ Skip ]
</span><span class="cx"> fast/history/page-cache-indexed-opened-db.html [ Skip ]
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -327,6 +327,7 @@
</span><span class="cx">
</span><span class="cx"> crypto/CryptoKey.idl
</span><span class="cx"> crypto/CryptoKeyPair.idl
</span><ins>+ crypto/SubtleCrypto.idl
</ins><span class="cx"> crypto/WebKitSubtleCrypto.idl
</span><span class="cx">
</span><span class="cx"> css/CSSCharsetRule.idl
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/ChangeLog        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,3 +1,99 @@
</span><ins>+2016-10-06 Jiewen Tan <jiewen_tan@apple.com>
+
+ Add a dummy SubtleCrypto interface
+ https://bugs.webkit.org/show_bug.cgi?id=162992
+ <rdar://problem/28643573>
+
+ Reviewed by Brent Fulgham.
+
+ Add a dummy SubtleCrypto interface and rename KeyPair to CryptoKeyPair.
+
+ Tests: crypto/subtle/gc-2.html
+ crypto/subtle/gc-3.html
+ crypto/subtle/gc.html
+ crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html
+ crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html
+ crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html
+ crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html
+ crypto/webkitSubtle/aes-cbc-generate-key.html
+ crypto/webkitSubtle/aes-cbc-import-jwk.html
+ crypto/webkitSubtle/aes-cbc-invalid-length.html
+ crypto/webkitSubtle/aes-cbc-unwrap-failure.html
+ crypto/webkitSubtle/aes-cbc-unwrap-rsa.html
+ crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html
+ crypto/webkitSubtle/aes-cbc-wrap-rsa.html
+ crypto/webkitSubtle/aes-cbc-wrong-key-class.html
+ crypto/webkitSubtle/aes-export-key.html
+ crypto/webkitSubtle/aes-kw-key-manipulation.html
+ crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html
+ crypto/webkitSubtle/aes-postMessage.html
+ crypto/webkitSubtle/argument-conversion.html
+ crypto/webkitSubtle/array-buffer-view-offset.html
+ crypto/webkitSubtle/crypto-key-algorithm-gc.html
+ crypto/webkitSubtle/crypto-key-usages-gc.html
+ crypto/webkitSubtle/hmac-check-algorithm.html
+ crypto/webkitSubtle/hmac-export-key.html
+ crypto/webkitSubtle/hmac-generate-key.html
+ crypto/webkitSubtle/hmac-import-jwk.html
+ crypto/webkitSubtle/hmac-postMessage.html
+ crypto/webkitSubtle/hmac-sign-verify-empty-key.html
+ crypto/webkitSubtle/hmac-sign-verify.html
+ crypto/webkitSubtle/import-jwk.html
+ crypto/webkitSubtle/jwk-export-use-values.html
+ crypto/webkitSubtle/jwk-import-use-values.html
+ crypto/webkitSubtle/rsa-export-generated-keys.html
+ crypto/webkitSubtle/rsa-export-key.html
+ crypto/webkitSubtle/rsa-export-private-key.html
+ crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
+ crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
+ crypto/webkitSubtle/rsa-indexeddb-private.html
+ crypto/webkitSubtle/rsa-indexeddb.html
+ crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html
+ crypto/webkitSubtle/rsa-oaep-key-manipulation.html
+ crypto/webkitSubtle/rsa-oaep-plaintext-length.html
+ crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html
+ crypto/webkitSubtle/rsa-postMessage.html
+ crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html
+ crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
+ crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html
+ crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html
+ crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html
+ crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html
+ crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html
+ crypto/webkitSubtle/sha-1.html
+ crypto/webkitSubtle/sha-224.html
+ crypto/webkitSubtle/sha-256.html
+ crypto/webkitSubtle/sha-384.html
+ crypto/webkitSubtle/sha-512.html
+ crypto/webkitSubtle/unimplemented-unwrap-crash.html
+ crypto/webkitSubtle/unwrapKey-check-usage.html
+ crypto/webkitSubtle/wrapKey-check-usage.html
+ crypto/workers/subtle/aes-postMessage-worker.html
+ crypto/workers/subtle/gc-worker.html
+ crypto/workers/subtle/hmac-postMessage-worker.html
+ crypto/workers/subtle/hrsa-postMessage-worker.html
+ crypto/workers/subtle/multiple-postMessage-worker.html
+ crypto/workers/subtle/rsa-postMessage-worker.html
+
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * PlatformEfl.cmake:
+ * PlatformGTK.cmake:
+ * PlatformMac.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * crypto/CryptoKeyPair.idl:
+ * crypto/SubtleCrypto.cpp:
+ (WebCore::SubtleCrypto::SubtleCrypto):
+ * crypto/SubtleCrypto.h:
+ (WebCore::SubtleCrypto::create):
+ * crypto/SubtleCrypto.idl: Added.
+ * page/Crypto.cpp:
+ (WebCore::Crypto::Crypto):
+ (WebCore::Crypto::subtle):
+ * page/Crypto.h:
+ * page/Crypto.idl:
+
</ins><span class="cx"> 2016-10-06 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Crash when ApplePaySession.completeMerchantValidation is not passed a dictionary
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/DerivedSources.cpp        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -599,6 +599,7 @@
</span><span class="cx"> #include "JSStyleMedia.cpp"
</span><span class="cx"> #include "JSStyleSheet.cpp"
</span><span class="cx"> #include "JSStyleSheetList.cpp"
</span><ins>+#include "JSSubtleCrypto.cpp"
</ins><span class="cx"> #include "JSText.cpp"
</span><span class="cx"> #include "JSTextEvent.cpp"
</span><span class="cx"> #include "JSTextMetrics.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/DerivedSources.make        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -238,6 +238,7 @@
</span><span class="cx"> $(WebCore)/animation/WebAnimation.idl \
</span><span class="cx"> $(WebCore)/crypto/CryptoKey.idl \
</span><span class="cx"> $(WebCore)/crypto/CryptoKeyPair.idl \
</span><ins>+ $(WebCore)/crypto/SubtleCrypto.idl \
</ins><span class="cx"> $(WebCore)/crypto/WebKitSubtleCrypto.idl \
</span><span class="cx"> $(WebCore)/css/CSSCharsetRule.idl \
</span><span class="cx"> $(WebCore)/css/CSSFontFaceLoadEvent.idl \
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformEfl.cmake (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformEfl.cmake        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/PlatformEfl.cmake        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -407,6 +407,7 @@
</span><span class="cx"> crypto/CryptoAlgorithmRegistry.cpp
</span><span class="cx"> crypto/CryptoKey.cpp
</span><span class="cx"> crypto/CryptoKeyPair.cpp
</span><ins>+ crypto/SubtleCrypto.cpp
</ins><span class="cx"> crypto/WebKitSubtleCrypto.cpp
</span><span class="cx">
</span><span class="cx"> crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -400,6 +400,7 @@
</span><span class="cx"> crypto/CryptoAlgorithmRegistry.cpp
</span><span class="cx"> crypto/CryptoKey.cpp
</span><span class="cx"> crypto/CryptoKeyPair.cpp
</span><ins>+ crypto/SubtleCrypto.cpp
</ins><span class="cx"> crypto/WebKitSubtleCrypto.cpp
</span><span class="cx">
</span><span class="cx"> crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformMac.cmake (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformMac.cmake        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/PlatformMac.cmake        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -180,6 +180,7 @@
</span><span class="cx"> crypto/CryptoAlgorithmRegistry.cpp
</span><span class="cx"> crypto/CryptoKey.cpp
</span><span class="cx"> crypto/CryptoKeyPair.cpp
</span><ins>+ crypto/SubtleCrypto.cpp
</ins><span class="cx"> crypto/WebKitSubtleCrypto.cpp
</span><span class="cx">
</span><span class="cx"> crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -2282,8 +2282,12 @@
</span><span class="cx">                 5709E8CF1D413D9A003244AC /* WebKitSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */; };
</span><span class="cx">                 570A99DA1D417408004EC630 /* JSWebKitSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F62180745D800132674 /* JSWebKitSubtleCrypto.cpp */; };
</span><span class="cx">                 570A99DB1D41A2F3004EC630 /* JSWebKitSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F63180745D800132674 /* JSWebKitSubtleCrypto.h */; };
</span><ins>+                571F21891DA57C54005C9EFD /* JSSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */; };
+                571F218B1DA57C7B005C9EFD /* JSSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */; };
</ins><span class="cx">                 572A7F211C6E5719009C6149 /* SimulatedClick.h in Headers */ = {isa = PBXBuildFile; fileRef = 572A7F201C6E5719009C6149 /* SimulatedClick.h */; };
</span><span class="cx">                 572A7F231C6E5A66009C6149 /* SimulatedClick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */; };
</span><ins>+                5778BD821DA4806C009E3009 /* SubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 5778BD811DA4802C009E3009 /* SubtleCrypto.h */; };
+                5778BD841DA4817B009E3009 /* SubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */; };
</ins><span class="cx">                 57EF5E601D20C83900171E60 /* TextCodecReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 57EF5E5F1D20C83900171E60 /* TextCodecReplacement.h */; };
</span><span class="cx">                 57EF5E621D20D28700171E60 /* TextCodecReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57EF5E611D20D28700171E60 /* TextCodecReplacement.cpp */; };
</span><span class="cx">                 580371611A66F00A00BAF519 /* ClipRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5803715F1A66F00A00BAF519 /* ClipRect.cpp */; };
</span><span class="lines">@@ -9323,9 +9327,14 @@
</span><span class="cx">                 5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitSubtleCrypto.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitSubtleCrypto.h; sourceTree = "<group>"; };
</span><span class="cx">                 5709E8CC1D413CE3003244AC /* WebKitSubtleCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitSubtleCrypto.idl; sourceTree = "<group>"; };
</span><ins>+                571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSubtleCrypto.h; sourceTree = "<group>"; };
+                571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCrypto.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 572A7F201C6E5719009C6149 /* SimulatedClick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimulatedClick.h; sourceTree = "<group>"; };
</span><span class="cx">                 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimulatedClick.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 574D42791D594FF6002CF50E /* GlobalCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GlobalCrypto.idl; sourceTree = "<group>"; };
</span><ins>+                5778BD801DA4733E009E3009 /* SubtleCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SubtleCrypto.idl; sourceTree = "<group>"; };
+                5778BD811DA4802C009E3009 /* SubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtleCrypto.h; sourceTree = "<group>"; };
+                5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtleCrypto.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 57EF5E5F1D20C83900171E60 /* TextCodecReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCodecReplacement.h; sourceTree = "<group>"; };
</span><span class="cx">                 57EF5E611D20D28700171E60 /* TextCodecReplacement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextCodecReplacement.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 5803715F1A66F00A00BAF519 /* ClipRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClipRect.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -22248,6 +22257,9 @@
</span><span class="cx">                                 E19727151820549E00592D51 /* CryptoKeyType.h */,
</span><span class="cx">                                 E172AF6F180F289500FBADB9 /* CryptoKeyUsage.h */,
</span><span class="cx">                                 E18DF33418AAF12C00773E59 /* SerializedCryptoKeyWrap.h */,
</span><ins>+                                5778BD811DA4802C009E3009 /* SubtleCrypto.h */,
+                                5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */,
+                                5778BD801DA4733E009E3009 /* SubtleCrypto.idl */,
</ins><span class="cx">                                 5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */,
</span><span class="cx">                                 5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */,
</span><span class="cx">                                 5709E8CC1D413CE3003244AC /* WebKitSubtleCrypto.idl */,
</span><span class="lines">@@ -22262,6 +22274,8 @@
</span><span class="cx">                                 E157A8DF1817331C009F821D /* JSCryptoKey.h */,
</span><span class="cx">                                 E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */,
</span><span class="cx">                                 E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */,
</span><ins>+                                571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */,
+                                571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */,
</ins><span class="cx">                                 E1FF8F62180745D800132674 /* JSWebKitSubtleCrypto.cpp */,
</span><span class="cx">                                 E1FF8F63180745D800132674 /* JSWebKitSubtleCrypto.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -24502,6 +24516,7 @@
</span><span class="cx">                                 84730D891248F0B300D3A9C9 /* FESpecularLighting.h in Headers */,
</span><span class="cx">                                 416E6FE81BBD12DF000A6023 /* FetchInternalsBuiltins.h in Headers */,
</span><span class="cx">                                 41AD753A1CEF6BD100A31486 /* FetchOptions.h in Headers */,
</span><ins>+                                5778BD821DA4806C009E3009 /* SubtleCrypto.h in Headers */,
</ins><span class="cx">                                 84730D8B1248F0B300D3A9C9 /* FETile.h in Headers */,
</span><span class="cx">                                 84730D8D1248F0B300D3A9C9 /* FETurbulence.h in Headers */,
</span><span class="cx">                                 FD31609512B026F700C1A359 /* FFTConvolver.h in Headers */,
</span><span class="lines">@@ -25170,6 +25185,7 @@
</span><span class="cx">                                 E446143C0CD689CC00FADA75 /* JSHTMLSourceElement.h in Headers */,
</span><span class="cx">                                 9752D38E1413104B003305BD /* JSHTMLSpanElement.h in Headers */,
</span><span class="cx">                                 A80E7B0E0A19D606007FB8C5 /* JSHTMLStyleElement.h in Headers */,
</span><ins>+                                571F21891DA57C54005C9EFD /* JSSubtleCrypto.h in Headers */,
</ins><span class="cx">                                 BCA169A30BFD55B40019CA76 /* JSHTMLTableCaptionElement.h in Headers */,
</span><span class="cx">                                 BC06EDE40BFD6D0D00856E9D /* JSHTMLTableCellElement.h in Headers */,
</span><span class="cx">                                 BC06ED9E0BFD660600856E9D /* JSHTMLTableColElement.h in Headers */,
</span><span class="lines">@@ -27550,6 +27566,7 @@
</span><span class="cx">                         isa = PBXSourcesBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><ins>+                                571F218B1DA57C7B005C9EFD /* JSSubtleCrypto.cpp in Sources */,
</ins><span class="cx">                                 41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */,
</span><span class="cx">                                 37F57AB91A50726900876F98 /* AccessibilityARIAGrid.cpp in Sources */,
</span><span class="cx">                                 37F57ABA1A50726F00876F98 /* AccessibilityARIAGridCell.cpp in Sources */,
</span><span class="lines">@@ -30299,6 +30316,7 @@
</span><span class="cx">                                 442ABCD617D9262F00D30715 /* SynchronousLoaderClientCFNet.cpp in Sources */,
</span><span class="cx">                                 26FAE4CE1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.cpp in Sources */,
</span><span class="cx">                                 E45390AE0EAFF4B5003695C8 /* SystemMemoryIOS.cpp in Sources */,
</span><ins>+                                5778BD841DA4817B009E3009 /* SubtleCrypto.cpp in Sources */,
</ins><span class="cx">                                 CDA07FBD18E0A16A004699FA /* SystemSleepListener.cpp in Sources */,
</span><span class="cx">                                 CDA07FC118E0A22B004699FA /* SystemSleepListenerMac.mm in Sources */,
</span><span class="cx">                                 5D5975B419635F1100D00878 /* SystemVersion.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoCryptoKeyPairidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/CryptoKeyPair.idl (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/CryptoKeyPair.idl        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/crypto/CryptoKeyPair.idl        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> [
</span><span class="cx"> Conditional=SUBTLE_CRYPTO,
</span><span class="cx"> ImplementationLacksVTable,
</span><del>- InterfaceName=KeyPair,
</del><span class="cx"> JSCustomMarkFunction,
</span><span class="cx"> NoInterfaceObject
</span><span class="cx"> ] interface CryptoKeyPair {
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoSubtleCryptocppfromrev206882trunkSourceWebCorecryptoCryptoKeyPairidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/SubtleCrypto.cpp (from rev 206882, trunk/Source/WebCore/crypto/CryptoKeyPair.idl) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/SubtleCrypto.cpp         (rev 0)
+++ trunk/Source/WebCore/crypto/SubtleCrypto.cpp        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,40 @@
</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.
+ */
+
+#include "config.h"
+#include "SubtleCrypto.h"
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+SubtleCrypto::SubtleCrypto(ScriptExecutionContext& context)
+ : ContextDestructionObserver(&context)
+{
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoSubtleCryptohfromrev206882trunkSourceWebCorecryptoCryptoKeyPairidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/SubtleCrypto.h (from rev 206882, trunk/Source/WebCore/crypto/CryptoKeyPair.idl) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/SubtleCrypto.h         (rev 0)
+++ trunk/Source/WebCore/crypto/SubtleCrypto.h        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,46 @@
</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.
+ */
+
+#pragma once
+
+#include "ContextDestructionObserver.h"
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+class SubtleCrypto : public ContextDestructionObserver, public RefCounted<SubtleCrypto> {
+public:
+ static Ref<SubtleCrypto> create(ScriptExecutionContext& context) { return adoptRef(*new SubtleCrypto(context)); }
+
+private:
+ SubtleCrypto(ScriptExecutionContext&);
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoSubtleCryptoidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/crypto/SubtleCrypto.idl (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/SubtleCrypto.idl         (rev 0)
+++ trunk/Source/WebCore/crypto/SubtleCrypto.idl        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,32 @@
</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.
+*/
+
+[
+ Conditional=SUBTLE_CRYPTO,
+ Exposed=(Window,Worker),
+ GenerateIsReachable=ImplScriptExecutionContext,
+ NoInterfaceObject,
+] interface SubtleCrypto {
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorepageCryptocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Crypto.cpp (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Crypto.cpp        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/page/Crypto.cpp        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "ExceptionCode.h"
</span><ins>+#include "SubtleCrypto.h"
</ins><span class="cx"> #include "WebKitSubtleCrypto.h"
</span><span class="cx"> #include <runtime/ArrayBufferView.h>
</span><span class="cx"> #include <wtf/CryptographicallyRandomNumber.h>
</span><span class="lines">@@ -41,6 +42,9 @@
</span><span class="cx">
</span><span class="cx"> Crypto::Crypto(ScriptExecutionContext& context)
</span><span class="cx"> : ContextDestructionObserver(&context)
</span><ins>+#if ENABLE(SUBTLE_CRYPTO)
+ , m_subtle(SubtleCrypto::create(context))
+#endif
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -62,6 +66,11 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><ins>+SubtleCrypto& Crypto::subtle()
+{
+ return m_subtle;
+}
+
</ins><span class="cx"> WebKitSubtleCrypto* Crypto::webkitSubtle(ExceptionCode& ec)
</span><span class="cx"> {
</span><span class="cx"> if (!isMainThread()) {
</span></span></pre></div>
<a id="trunkSourceWebCorepageCryptoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Crypto.h (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Crypto.h        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/page/Crypto.h        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">
</span><span class="cx"> class Document;
</span><span class="cx"> class WebKitSubtleCrypto;
</span><ins>+class SubtleCrypto;
</ins><span class="cx">
</span><span class="cx"> class Crypto : public ContextDestructionObserver, public RefCounted<Crypto> {
</span><span class="cx"> public:
</span><span class="lines">@@ -54,6 +55,9 @@
</span><span class="cx"> void getRandomValues(JSC::ArrayBufferView*, ExceptionCode&);
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><ins>+ SubtleCrypto& subtle();
+
+ // Will be deprecated.
</ins><span class="cx"> WebKitSubtleCrypto* webkitSubtle(ExceptionCode&);
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -61,6 +65,9 @@
</span><span class="cx"> Crypto(ScriptExecutionContext&);
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><ins>+ Ref<SubtleCrypto> m_subtle;
+
+ // Will be deprecated.
</ins><span class="cx"> RefPtr<WebKitSubtleCrypto> m_webkitSubtle;
</span><span class="cx"> #endif
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepageCryptoidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Crypto.idl (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Crypto.idl        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/page/Crypto.idl        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -31,7 +31,9 @@
</span><span class="cx"> Exposed=(Window,Worker),
</span><span class="cx"> GenerateIsReachable=ImplScriptExecutionContext,
</span><span class="cx"> ] interface Crypto {
</span><ins>+ [Conditional=SUBTLE_CRYPTO] readonly attribute SubtleCrypto subtle;
</ins><span class="cx"> [Custom, MayThrowLegacyException] ArrayBufferView getRandomValues(ArrayBufferView array);
</span><span class="cx">
</span><ins>+ // Will be deprecated.
</ins><span class="cx"> [Conditional=SUBTLE_CRYPTO, GetterMayThrowLegacyException] readonly attribute WebKitSubtleCrypto webkitSubtle;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>
</body>
</html>