<!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>[160502] 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/160502">160502</a></dd>
<dt>Author</dt> <dd>ap@apple.com</dd>
<dt>Date</dt> <dd>2013-12-12 12:12:10 -0800 (Thu, 12 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add support for RSAES-PKCS1-v1_5
https://bugs.webkit.org/show_bug.cgi?id=125647

Reviewed by Anders Carlsson.

Source/WebCore: 

Tests: crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html
       crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html

* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
Removed meaningless parameters arguments from private functions. The base arguments
class is always empty.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt):
(WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt):
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
(WebCore::JSCryptoKeySerializationJWK::keySizeIsValid):
(WebCore::JSCryptoKeySerializationJWK::addJWKAlgorithmToJSON):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp: Added.
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::CryptoAlgorithmRSAES_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::~CryptoAlgorithmRSAES_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::create):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::identifier):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::keyAlgorithmMatches):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h: Added.
* crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp: Added.
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
Added support for this algorithm.

LayoutTests: 

* crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCryptoAlgorithmDictionarycpp">trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCryptoKeySerializationJWKcpp">trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmAES_KWcpp">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmAES_KWh">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.h</a></li>
<li><a href="#trunkSourceWebCorecryptomacCryptoAlgorithmRegistryMaccpp">trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRegistryMac.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<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="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSAES_PKCS1_v1_5cpp">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSAES_PKCS1_v1_5h">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h</a></li>
<li><a href="#trunkSourceWebCorecryptomacCryptoAlgorithmRSAES_PKCS1_v1_5Maccpp">trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (160501 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-12 19:57:27 UTC (rev 160501)
+++ trunk/LayoutTests/ChangeLog        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2013-12-12  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Add support for RSAES-PKCS1-v1_5
+        https://bugs.webkit.org/show_bug.cgi?id=125647
+
+        Reviewed by Anders Carlsson.
+
+        * crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html: Added.
+
+2013-12-12  Alexey Proskuryakov  &lt;ap@apple.com&gt;
+
</ins><span class="cx">         Public key in a generated KeyPair should always be extractable
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=125643
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5decryptexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt (0 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt        2013-12-12 20:12:10 UTC (rev 160502)
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing an RSA key...
+Decrypting...
+PASS bytesToHexString(new Uint8Array(message)) is '2aacec86f423dd925ec158822a748cbe6c31a0'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5decrypthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html (0 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+description(&quot;Test decrypting a known message with RSAES-PKCS1-v1_5.&quot;);
+
+jsTestIsAsync = true;
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA1_5&quot;,
+    n: Base64URL.stringify(hexStringToUint8Array(&quot;dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1&quot;)),
+    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;)),
+    d: Base64URL.stringify(hexStringToUint8Array(&quot;21950851cdf25320318b305afa0f371f07ae5a44b314ebd729f5dcb15da7fa3947acdd915daed574bd16df88bf85f61060b387172fae6e01262b3864c2d3c22f94e04a8159422b4ed279c48a4c9d767d4966071a5bbf5d043e16ff46ec1ba0716f00bbc97bff5d5693e214e99c9721f12b3ec6282ae2a485721b96ddcf7403fa037d0c57ab463c448de5cc12265add886d311ea8d8a5903fa56c5f1c9cf2eb11cb657a1a7d3e41352dc3e686898c4ce4305e8b638e1b08a2a86cc9eb9866f3499ac77b6136b81cb276d614cfeb7b6ed3f3bc775e46c00066ebeee2cff7166b57520598947ff6210320b288fb4f2c3f8fe97b279414ebf7203000a19fc0424875&quot;)),
+    p: Base64URL.stringify(hexStringToUint8Array(&quot;f123bfe53de97a569d91adcf556fa625ad30f3fd3d811f9e91e6af44b6e780cb0f327829fb21190ae2806646d728cd9b6531132b1ebfef1272993060f1ce70b124393091ee8593b727367edbba009ec5be17c4acee120c841267d47631a16c36a6d1c99973c1b0b5a835bf39feafe8f6421fd9c2a90bc27976659e67bc83124d&quot;)),
+    q: Base64URL.stringify(hexStringToUint8Array(&quot;ea9839b7e37ea89bbda27e4c93471cb4fd92189a0a96bcb4d75693f18a5c2f742af9e36fde679fbd9eae345fa269527b6965021c4bdf54d685bf08960cc976f68dca21cebf44f268a59dab8d1a25e519f5147e1f45fe287d74cf725bec1326d34212c56cf4fffa202f57b68ee8cca943f3c138c4cde33bdf2c9440df65322445&quot;)),
+    dp: Base64URL.stringify(hexStringToUint8Array(&quot;ca0c9b60b8e4a6066756c65d2088419df6253b7b688a85f4f6e964d85dad52a45262867f1e9618069fccd865e9289e46e39e2022944c5c4487d345cf252d460d977d77edfefedbcbae46a23af7fa470f077da0e50942044cb1a360497cc2760ac0f2ad4a2fcd0e84d7a1d94dfdd2658fd9ce18475c1fa75ee0cebad0cf0ac04d&quot;)),
+    dq: Base64URL.stringify(hexStringToUint8Array(&quot;528171233c4e4a6c63b86764f51338846afddbcb2958344c01c4004a1dd828145a1d02a1507def4f58247a64fc10c0a288c1ae895721d78b8f044db7c00d86da55a9b654292ecd768270be69e4bd5922d4effd1f70955f9627e3e19b749e93b40ef3dd1d61d93915e2b09d930b4b1768bfacc0136f39b0cfdfb4d050011e2e65&quot;)),
+    qi: Base64URL.stringify(hexStringToUint8Array(&quot;df2eb2322cc2daabf4d1465508f41521cda7ceff23ebe61d00d441ee728dda5d16c7bf920cd95f34beb4fe32ee817ef3362e0bcd1d1245f7b07793eaa190dc5a37fdaf4c68e2ca13972d7f5148b796b6fb6d7adda07bd2cd13be98cebed1edc6ca412e395350c59a1d842bc4aa2f3c0b243fde7dfd95356f2439251a1172c45e&quot;))
+};
+
+var extractable = true;
+var nonExtractable = false;
+
+debug(&quot;Importing an RSA key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;decrypt&quot;]).then(function(result) {
+    privateKey = result;
+
+    debug(&quot;Decrypting...&quot;);
+    encryptedMessage = hexStringToUint8Array(&quot;6042e745589af03af87520f93c45d8c35985ada1161a37d822e9f9460fc75fcf0179d8491b8f5d1e4de8ceb31e07c4865c5a3efdbbb69a8803b89ee65a430a5809c707569150b580bb686a94c5541c46adcd827960ce244ff688387d1616e85b4d1780c6483606cf924b54f080cf4154e66829bf6e532481048ec41fadc07d755bb34bb28145219cb30d47d0d618709180e90303ff9ef09018bed3da75761da794811f96bc9e8d7c4ba1b5946bda0bd313faec4c993ed2748eed8cce4bdb520ba7db165f9fe56aa8454d6ff33874feeebf29de2df5b7f00aa1d9fb073fc4067b58dc50624e127f711dde2cc2cfdab4919ccf28c83660dfc227b0f500ec1f904f&quot;);
+    return crypto.subtle.decrypt(&quot;RSAES-PKCS1-v1_5&quot;, privateKey, encryptedMessage);
+}).then(function(result) {
+    message = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(message))&quot;, &quot;'2aacec86f423dd925ec158822a748cbe6c31a0'&quot;);
+
+    finishJSTest();
+});
+&lt;/script&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt (0 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt        2013-12-12 20:12:10 UTC (rev 160502)
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing RSA keys...
+Importing an AES key...
+Wrapping it...
+PASS wrappedKey.toString() is '[object ArrayBuffer]'
+Unwrapping it...
+PASS unwrappedKey.toString() is '[object Key]'
+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 ['encrypt', 'decrypt']
+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 Key]'
+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 ['encrypt', 'decrypt']
+Exporting it...
+PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaeshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html (0 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+description(&quot;Test wrapping and unwrapping an AES key with RSAES-PKCS1-v1_5.&quot;);
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA1_5&quot;,
+    n: Base64URL.stringify(hexStringToUint8Array(&quot;dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1&quot;)),
+    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;))
+};
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA1_5&quot;,
+    n: Base64URL.stringify(hexStringToUint8Array(&quot;dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1&quot;)),
+    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;)),
+    d: Base64URL.stringify(hexStringToUint8Array(&quot;21950851cdf25320318b305afa0f371f07ae5a44b314ebd729f5dcb15da7fa3947acdd915daed574bd16df88bf85f61060b387172fae6e01262b3864c2d3c22f94e04a8159422b4ed279c48a4c9d767d4966071a5bbf5d043e16ff46ec1ba0716f00bbc97bff5d5693e214e99c9721f12b3ec6282ae2a485721b96ddcf7403fa037d0c57ab463c448de5cc12265add886d311ea8d8a5903fa56c5f1c9cf2eb11cb657a1a7d3e41352dc3e686898c4ce4305e8b638e1b08a2a86cc9eb9866f3499ac77b6136b81cb276d614cfeb7b6ed3f3bc775e46c00066ebeee2cff7166b57520598947ff6210320b288fb4f2c3f8fe97b279414ebf7203000a19fc0424875&quot;)),
+    p: Base64URL.stringify(hexStringToUint8Array(&quot;f123bfe53de97a569d91adcf556fa625ad30f3fd3d811f9e91e6af44b6e780cb0f327829fb21190ae2806646d728cd9b6531132b1ebfef1272993060f1ce70b124393091ee8593b727367edbba009ec5be17c4acee120c841267d47631a16c36a6d1c99973c1b0b5a835bf39feafe8f6421fd9c2a90bc27976659e67bc83124d&quot;)),
+    q: Base64URL.stringify(hexStringToUint8Array(&quot;ea9839b7e37ea89bbda27e4c93471cb4fd92189a0a96bcb4d75693f18a5c2f742af9e36fde679fbd9eae345fa269527b6965021c4bdf54d685bf08960cc976f68dca21cebf44f268a59dab8d1a25e519f5147e1f45fe287d74cf725bec1326d34212c56cf4fffa202f57b68ee8cca943f3c138c4cde33bdf2c9440df65322445&quot;)),
+    dp: Base64URL.stringify(hexStringToUint8Array(&quot;ca0c9b60b8e4a6066756c65d2088419df6253b7b688a85f4f6e964d85dad52a45262867f1e9618069fccd865e9289e46e39e2022944c5c4487d345cf252d460d977d77edfefedbcbae46a23af7fa470f077da0e50942044cb1a360497cc2760ac0f2ad4a2fcd0e84d7a1d94dfdd2658fd9ce18475c1fa75ee0cebad0cf0ac04d&quot;)),
+    dq: Base64URL.stringify(hexStringToUint8Array(&quot;528171233c4e4a6c63b86764f51338846afddbcb2958344c01c4004a1dd828145a1d02a1507def4f58247a64fc10c0a288c1ae895721d78b8f044db7c00d86da55a9b654292ecd768270be69e4bd5922d4effd1f70955f9627e3e19b749e93b40ef3dd1d61d93915e2b09d930b4b1768bfacc0136f39b0cfdfb4d050011e2e65&quot;)),
+    qi: Base64URL.stringify(hexStringToUint8Array(&quot;df2eb2322cc2daabf4d1465508f41521cda7ceff23ebe61d00d441ee728dda5d16c7bf920cd95f34beb4fe32ee817ef3362e0bcd1d1245f7b07793eaa190dc5a37fdaf4c68e2ca13972d7f5148b796b6fb6d7adda07bd2cd13be98cebed1edc6ca412e395350c59a1d842bc4aa2f3c0b243fde7dfd95356f2439251a1172c45e&quot;))
+};
+var wrapAlgorithm = {name: &quot;RSAES-PKCS1-v1_5&quot;};
+var extractable = true;
+var nonExtractable = false;
+
+debug(&quot;Importing RSA keys...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    publicKey = result;
+    return crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
+}).then(function(result) {
+    privateKey = result;
+
+    debug(&quot;Importing an AES key...&quot;);
+    aesKeyData = hexStringToUint8Array(&quot;603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4&quot;);
+    return crypto.subtle.importKey(&quot;raw&quot;, aesKeyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])
+}).then(function(result) {
+    aesKey = result;
+    debug(&quot;Wrapping it...&quot;);
+
+    return crypto.subtle.wrapKey(&quot;raw&quot;, aesKey, publicKey, wrapAlgorithm);
+}).then(function(result) {
+    wrappedKey = result;
+    shouldBe(&quot;wrappedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&quot;);
+
+    debug(&quot;Unwrapping it...&quot;);
+    return crypto.subtle.unwrapKey(&quot;raw&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]);
+}).then(function(result) {
+    unwrappedKey = result;
+    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object Key]'&quot;);
+    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['encrypt', 'decrypt']&quot;);
+
+    debug(&quot;Exporting it...&quot;);
+    return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
+}).then(function(result) {
+    unwrappedKeyData = result;
+    shouldBe(&quot;bytesToHexString(unwrappedKeyData)&quot;, &quot;bytesToHexString(aesKeyData)&quot;);
+
+    debug(&quot;\nWrapping the same key as JWK...&quot;);
+    return crypto.subtle.wrapKey(&quot;jwk&quot;, aesKey, publicKey, wrapAlgorithm);
+}).then(function(result) {
+    wrappedKey = result;
+    shouldBe(&quot;wrappedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&quot;);
+
+    debug(&quot;Unwrapping it...&quot;);
+    return crypto.subtle.unwrapKey(&quot;jwk&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]);
+}).then(function(result) {
+    unwrappedKey = result;
+    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object Key]'&quot;);
+    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['encrypt', 'decrypt']&quot;);
+
+    debug(&quot;Exporting it...&quot;);
+    return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
+}).then(function(result) {
+    unwrappedKeyData = result;
+    shouldBe(&quot;bytesToHexString(unwrappedKeyData)&quot;, &quot;bytesToHexString(aesKeyData)&quot;);
+    finishJSTest();
+});
+&lt;/script&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160501 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-12 19:57:27 UTC (rev 160501)
+++ trunk/Source/WebCore/ChangeLog        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2013-12-12  Alexey Proskuryakov  &lt;ap@apple.com&gt;
+
+        Add support for RSAES-PKCS1-v1_5
+        https://bugs.webkit.org/show_bug.cgi?id=125647
+
+        Reviewed by Anders Carlsson.
+
+        Tests: crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html
+               crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
+
+        * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
+        * crypto/algorithms/CryptoAlgorithmAES_KW.h:
+        Removed meaningless parameters arguments from private functions. The base arguments
+        class is always empty.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSCryptoAlgorithmDictionary.cpp:
+        (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt):
+        (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt):
+        * bindings/js/JSCryptoKeySerializationJWK.cpp:
+        (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
+        (WebCore::JSCryptoKeySerializationJWK::keySizeIsValid):
+        (WebCore::JSCryptoKeySerializationJWK::addJWKAlgorithmToJSON):
+        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp: Added.
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::CryptoAlgorithmRSAES_PKCS1_v1_5):
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::~CryptoAlgorithmRSAES_PKCS1_v1_5):
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::create):
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::identifier):
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::keyAlgorithmMatches):
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
+        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h: Added.
+        * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp: Added.
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
+        * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
+        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
+        Added support for this algorithm.
+
</ins><span class="cx"> 2013-12-12  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] Stop not caching HTTP resources with &quot;Vary&quot; header in response.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (160501 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-12 19:57:27 UTC (rev 160501)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -5555,6 +5555,9 @@
</span><span class="cx">                 E11AF15111B9A1A300805103 /* Cursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E11AF15011B9A1A300805103 /* Cursor.cpp */; };
</span><span class="cx">                 E11C9D9B0EB3681200E409DB /* ScriptExecutionContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E11C9D9A0EB3681200E409DB /* ScriptExecutionContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E11C9DB00EB3699500E409DB /* ScriptExecutionContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E11C9DAF0EB3699500E409DB /* ScriptExecutionContext.cpp */; };
</span><ins>+                E1233F0C185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1233F0A185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp */; };
+                E1233F0D185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h in Headers */ = {isa = PBXBuildFile; fileRef = E1233F0B185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h */; };
+                E1233F10185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1233F0E185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp */; };
</ins><span class="cx">                 E124748410AA161D00B79493 /* AuthenticationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E124748310AA161D00B79493 /* AuthenticationClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E125F82B1822CFEC00D84CD9 /* CryptoAlgorithmSHA1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F8291822CFEC00D84CD9 /* CryptoAlgorithmSHA1.cpp */; };
</span><span class="cx">                 E125F82C1822CFEC00D84CD9 /* CryptoAlgorithmSHA1.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F82A1822CFEC00D84CD9 /* CryptoAlgorithmSHA1.h */; };
</span><span class="lines">@@ -12697,6 +12700,9 @@
</span><span class="cx">                 E11AF15011B9A1A300805103 /* Cursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Cursor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E11C9D9A0EB3681200E409DB /* ScriptExecutionContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptExecutionContext.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E11C9DAF0EB3699500E409DB /* ScriptExecutionContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptExecutionContext.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E1233F0A185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRSAES_PKCS1_v1_5.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E1233F0B185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRSAES_PKCS1_v1_5.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E1233F0E185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp; path = mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E124748310AA161D00B79493 /* AuthenticationClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E125F8291822CFEC00D84CD9 /* CryptoAlgorithmSHA1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmSHA1.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E125F82A1822CFEC00D84CD9 /* CryptoAlgorithmSHA1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmSHA1.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -20502,6 +20508,7 @@
</span><span class="cx">                                 E125F8371822F1EB00D84CD9 /* CryptoAlgorithmHMACMac.cpp */,
</span><span class="cx">                                 E1BB84AC1822CA7400525043 /* CryptoAlgorithmRegistryMac.cpp */,
</span><span class="cx">                                 E1C266D618317AB4003F8B33 /* CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp */,
</span><ins>+                                E1233F0E185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp */,
</ins><span class="cx">                                 E1FE136E183FECF000892F13 /* CryptoAlgorithmRSA_OAEPMac.cpp */,
</span><span class="cx">                                 E19AC3F8182566F700349426 /* CryptoKeyMac.cpp */,
</span><span class="cx">                                 E164FAA418315E1A00DB4E61 /* CryptoKeyRSAMac.cpp */,
</span><span class="lines">@@ -20521,6 +20528,8 @@
</span><span class="cx">                                 E125F8301822F11B00D84CD9 /* CryptoAlgorithmHMAC.h */,
</span><span class="cx">                                 E1FE1368183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.cpp */,
</span><span class="cx">                                 E1FE1369183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.h */,
</span><ins>+                                E1233F0A185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp */,
+                                E1233F0B185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h */,
</ins><span class="cx">                                 E1BD3317182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp */,
</span><span class="cx">                                 E1BD3318182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.h */,
</span><span class="cx">                                 E125F8291822CFEC00D84CD9 /* CryptoAlgorithmSHA1.cpp */,
</span><span class="lines">@@ -24421,6 +24430,7 @@
</span><span class="cx">                                 BC85F23D151915E000BC17BE /* RenderNamedFlowThread.h in Headers */,
</span><span class="cx">                                 BCEA4880097D93020094C9E4 /* RenderObject.h in Headers */,
</span><span class="cx">                                 BCFA930810333193007B25D1 /* RenderOverflow.h in Headers */,
</span><ins>+                                E1233F0D185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h in Headers */,
</ins><span class="cx">                                 A43BF59D1149292800C643CA /* RenderProgress.h in Headers */,
</span><span class="cx">                                 5A574F25131DB93900471B88 /* RenderQuote.h in Headers */,
</span><span class="cx">                                 D70AD65813E1342B005B50B4 /* RenderRegion.h in Headers */,
</span><span class="lines">@@ -27852,6 +27862,7 @@
</span><span class="cx">                                 B8DBDB4B130B0F8A00F5CDB1 /* SetSelectionCommand.cpp in Sources */,
</span><span class="cx">                                 14C9A5EA0B3D105F005A0232 /* Settings.cpp in Sources */,
</span><span class="cx">                                 E1C2F24A1533A2120083F974 /* SettingsMac.mm in Sources */,
</span><ins>+                                E1233F0C185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp in Sources */,
</ins><span class="cx">                                 0F3DD44F12F5EA1B000D9190 /* ShadowBlur.cpp in Sources */,
</span><span class="cx">                                 BC5EB8C30E82031B00B25965 /* ShadowData.cpp in Sources */,
</span><span class="cx">                                 A6D169621346B49B000EB770 /* ShadowRoot.cpp in Sources */,
</span><span class="lines">@@ -28207,6 +28218,7 @@
</span><span class="cx">                                 B2C3DA3D0D006C1D00EF6F26 /* TextCodecLatin1.cpp in Sources */,
</span><span class="cx">                                 B2AFFC990D00A5DF0030074D /* TextCodecMac.cpp in Sources */,
</span><span class="cx">                                 B2C3DA3F0D006C1D00EF6F26 /* TextCodecUserDefined.cpp in Sources */,
</span><ins>+                                E1233F10185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp in Sources */,
</ins><span class="cx">                                 B2C3DA410D006C1D00EF6F26 /* TextCodecUTF16.cpp in Sources */,
</span><span class="cx">                                 E1FF8F6C180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp in Sources */,
</span><span class="cx">                                 9343CB8112F25E510033C5EE /* TextCodecUTF8.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCryptoAlgorithmDictionarycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp (160501 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp        2013-12-12 19:57:27 UTC (rev 160501)
+++ trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -301,6 +301,7 @@
</span><span class="cx"> {
</span><span class="cx">     switch (algorithm) {
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
</span><ins>+        return std::make_unique&lt;CryptoAlgorithmParameters&gt;();
</ins><span class="cx">     case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSA_PSS:
</span><span class="cx">         setDOMException(exec, NOT_SUPPORTED_ERR);
</span><span class="lines">@@ -340,6 +341,7 @@
</span><span class="cx"> {
</span><span class="cx">     switch (algorithm) {
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
</span><ins>+        return std::make_unique&lt;CryptoAlgorithmParameters&gt;();
</ins><span class="cx">     case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSA_PSS:
</span><span class="cx">         setDOMException(exec, NOT_SUPPORTED_ERR);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCryptoKeySerializationJWKcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp (160501 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp        2013-12-12 19:57:27 UTC (rev 160501)
+++ trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -190,6 +190,9 @@
</span><span class="cx">     } else if (m_jwkAlgorithmName == &quot;RS512&quot;) {
</span><span class="cx">         algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5);
</span><span class="cx">         parameters = createRSAKeyParametersWithHash(CryptoAlgorithmIdentifier::SHA_512);
</span><ins>+    } else if (m_jwkAlgorithmName == &quot;RSA1_5&quot;) {
+        algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5);
+        parameters = std::make_unique&lt;CryptoAlgorithmParameters&gt;();
</ins><span class="cx">     } else if (m_jwkAlgorithmName == &quot;RSA-OAEP&quot;) {
</span><span class="cx">         algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::RSA_OAEP);
</span><span class="cx">         parameters = createRSAKeyParametersWithHash(CryptoAlgorithmIdentifier::SHA_1);
</span><span class="lines">@@ -321,6 +324,8 @@
</span><span class="cx">         return sizeInBits &gt;= 2048;
</span><span class="cx">     if (m_jwkAlgorithmName == &quot;RS512&quot;)
</span><span class="cx">         return sizeInBits &gt;= 2048;
</span><ins>+    if (m_jwkAlgorithmName == &quot;RSA1_5&quot;)
+        return sizeInBits &gt;= 2048;
</ins><span class="cx">     if (m_jwkAlgorithmName == &quot;RSA_OAEP&quot;)
</span><span class="cx">         return sizeInBits &gt;= 2048;
</span><span class="cx">     return true;
</span><span class="lines">@@ -591,6 +596,13 @@
</span><span class="cx">         }
</span><span class="cx">         break;
</span><span class="cx">     }
</span><ins>+    case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5: {
+        const CryptoKeyRSA&amp; rsaKey = toCryptoKeyRSA(key);
+        if (rsaKey.keySizeInBits() &lt; 2048)
+            break;
+        jwkAlgorithm = &quot;RSA1_5&quot;;
+        break;
+    }
</ins><span class="cx">     case CryptoAlgorithmIdentifier::RSA_OAEP: {
</span><span class="cx">         const CryptoKeyRSA&amp; rsaKey = toCryptoKeyRSA(key);
</span><span class="cx">         CryptoAlgorithmIdentifier hash;
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmAES_KWcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp (160501 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp        2013-12-12 19:57:27 UTC (rev 160501)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">     return s_identifier;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CryptoAlgorithmAES_KW::keyAlgorithmMatches(const CryptoAlgorithmParameters&amp;, const CryptoKey&amp; key) const
</del><ins>+bool CryptoAlgorithmAES_KW::keyAlgorithmMatches(const CryptoKey&amp; key) const
</ins><span class="cx"> {
</span><span class="cx">     if (key.algorithmIdentifier() != s_identifier)
</span><span class="cx">         return false;
</span><span class="lines">@@ -64,9 +64,9 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CryptoAlgorithmAES_KW::encryptForWrapKey(const CryptoAlgorithmParameters&amp; parameters, const CryptoKey&amp; key, const CryptoOperationData&amp; data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode&amp; ec)
</del><ins>+void CryptoAlgorithmAES_KW::encryptForWrapKey(const CryptoAlgorithmParameters&amp;, const CryptoKey&amp; key, const CryptoOperationData&amp; data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    if (!keyAlgorithmMatches(parameters, key)) {
</del><ins>+    if (!keyAlgorithmMatches(key)) {
</ins><span class="cx">         ec = NOT_SUPPORTED_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -74,9 +74,9 @@
</span><span class="cx">     platformEncrypt(toCryptoKeyAES(key), data, std::move(callback), std::move(failureCallback), ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CryptoAlgorithmAES_KW::decryptForUnwrapKey(const CryptoAlgorithmParameters&amp; parameters, const CryptoKey&amp; key, const CryptoOperationData&amp; data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode&amp; ec)
</del><ins>+void CryptoAlgorithmAES_KW::decryptForUnwrapKey(const CryptoAlgorithmParameters&amp;, const CryptoKey&amp; key, const CryptoOperationData&amp; data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    if (!keyAlgorithmMatches(parameters, key)) {
</del><ins>+    if (!keyAlgorithmMatches(key)) {
</ins><span class="cx">         ec = NOT_SUPPORTED_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmAES_KWh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.h (160501 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.h        2013-12-12 19:57:27 UTC (rev 160501)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.h        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">     CryptoAlgorithmAES_KW();
</span><span class="cx">     virtual ~CryptoAlgorithmAES_KW();
</span><span class="cx"> 
</span><del>-    bool keyAlgorithmMatches(const CryptoAlgorithmParameters&amp;, const CryptoKey&amp;) const;
</del><ins>+    bool keyAlgorithmMatches(const CryptoKey&amp;) const;
</ins><span class="cx">     void platformEncrypt(const CryptoKeyAES&amp;, const CryptoOperationData&amp;, VectorCallback, VoidCallback failureCallback, ExceptionCode&amp;);
</span><span class="cx">     void platformDecrypt(const CryptoKeyAES&amp;, const CryptoOperationData&amp;, VectorCallback, VoidCallback failureCallback, ExceptionCode&amp;);
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSAES_PKCS1_v1_5cpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp (0 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp                                (rev 0)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+/*
+ * Copyright (C) 2013 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 &quot;config.h&quot;
+#include &quot;CryptoAlgorithmRSAES_PKCS1_v1_5.h&quot;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+#include &quot;CryptoAlgorithmRsaKeyGenParams.h&quot;
+#include &quot;CryptoKeyDataRSAComponents.h&quot;
+#include &quot;CryptoKeyRSA.h&quot;
+#include &quot;ExceptionCode.h&quot;
+
+namespace WebCore {
+
+const char* const CryptoAlgorithmRSAES_PKCS1_v1_5::s_name = &quot;RSAES-PKCS1-v1_5&quot;;
+
+CryptoAlgorithmRSAES_PKCS1_v1_5::CryptoAlgorithmRSAES_PKCS1_v1_5()
+{
+}
+
+CryptoAlgorithmRSAES_PKCS1_v1_5::~CryptoAlgorithmRSAES_PKCS1_v1_5()
+{
+}
+
+std::unique_ptr&lt;CryptoAlgorithm&gt; CryptoAlgorithmRSAES_PKCS1_v1_5::create()
+{
+    return std::unique_ptr&lt;CryptoAlgorithm&gt;(new CryptoAlgorithmRSAES_PKCS1_v1_5);
+}
+
+CryptoAlgorithmIdentifier CryptoAlgorithmRSAES_PKCS1_v1_5::identifier() const
+{
+    return s_identifier;
+}
+
+bool CryptoAlgorithmRSAES_PKCS1_v1_5::keyAlgorithmMatches(const CryptoKey&amp; key) const
+{
+    if (key.algorithmIdentifier() != s_identifier)
+        return false;
+    ASSERT(isCryptoKeyRSA(key));
+
+    return true;
+}
+
+void CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt(const CryptoAlgorithmParameters&amp;, const CryptoKey&amp; key, const CryptoOperationData&amp; data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode&amp; ec)
+{
+    if (!keyAlgorithmMatches(key)) {
+        ec = NOT_SUPPORTED_ERR;
+        return;
+    }
+
+    platformEncrypt(toCryptoKeyRSA(key), data, std::move(callback), std::move(failureCallback), ec);
+}
+
+void CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt(const CryptoAlgorithmParameters&amp;, const CryptoKey&amp; key, const CryptoOperationData&amp; data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode&amp; ec)
+{
+    if (!keyAlgorithmMatches(key)) {
+        ec = NOT_SUPPORTED_ERR;
+        return;
+    }
+
+    platformDecrypt(toCryptoKeyRSA(key), data, std::move(callback), std::move(failureCallback), ec);
+}
+
+void CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey(const CryptoAlgorithmParameters&amp; parameters, bool extractable, CryptoKeyUsage usages, KeyOrKeyPairCallback callback, VoidCallback failureCallback, ExceptionCode&amp;)
+{
+    const CryptoAlgorithmRsaKeyGenParams&amp; rsaParameters = toCryptoAlgorithmRsaKeyGenParams(parameters);
+
+    auto keyPairCallback = [callback](CryptoKeyPair&amp; pair) {
+        callback(nullptr, &amp;pair);
+    };
+
+    CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5, rsaParameters.modulusLength, rsaParameters.publicExponent, extractable, usages, std::move(keyPairCallback), std::move(failureCallback));
+}
+
+void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(const CryptoAlgorithmParameters&amp;, const CryptoKeyData&amp; keyData, bool extractable, CryptoKeyUsage usage, KeyCallback callback, VoidCallback failureCallback, ExceptionCode&amp;)
+{
+    const CryptoKeyDataRSAComponents&amp; rsaComponents = toCryptoKeyDataRSAComponents(keyData);
+
+    RefPtr&lt;CryptoKeyRSA&gt; result = CryptoKeyRSA::create(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5, rsaComponents, extractable, usage);
+    if (!result) {
+        failureCallback();
+        return;
+    }
+
+    callback(*result);
+}
+
+}
+
+#endif // ENABLE(SUBTLE_CRYPTO)
</ins><span class="cx">Property changes on: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSAES_PKCS1_v1_5h"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h (0 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h                                (rev 0)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2013 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.
+ */
+
+#ifndef CryptoAlgorithmRSAES_PKCS1_v1_5_h
+#define CryptoAlgorithmRSAES_PKCS1_v1_5_h
+
+#include &quot;CryptoAlgorithm.h&quot;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+class CryptoAlgorithmRSAESParams;
+class CryptoKeyRSA;
+
+class CryptoAlgorithmRSAES_PKCS1_v1_5 FINAL : public CryptoAlgorithm {
+public:
+    static const char* const s_name;
+    static const CryptoAlgorithmIdentifier s_identifier = CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5;
+
+    static std::unique_ptr&lt;CryptoAlgorithm&gt; create();
+
+    virtual CryptoAlgorithmIdentifier identifier() const OVERRIDE;
+
+    virtual void encrypt(const CryptoAlgorithmParameters&amp;, const CryptoKey&amp;, const CryptoOperationData&amp;, VectorCallback, VoidCallback failureCallback, ExceptionCode&amp;) OVERRIDE;
+    virtual void decrypt(const CryptoAlgorithmParameters&amp;, const CryptoKey&amp;, const CryptoOperationData&amp;, VectorCallback, VoidCallback failureCallback, ExceptionCode&amp;) OVERRIDE;
+    virtual void generateKey(const CryptoAlgorithmParameters&amp;, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback, VoidCallback failureCallback, ExceptionCode&amp;) OVERRIDE;
+    virtual void importKey(const CryptoAlgorithmParameters&amp;, const CryptoKeyData&amp;, bool extractable, CryptoKeyUsage, KeyCallback, VoidCallback failureCallback, ExceptionCode&amp;) OVERRIDE;
+
+private:
+    CryptoAlgorithmRSAES_PKCS1_v1_5();
+    virtual ~CryptoAlgorithmRSAES_PKCS1_v1_5();
+
+    bool keyAlgorithmMatches(const CryptoKey&amp;) const;
+    void platformEncrypt(const CryptoKeyRSA&amp;, const CryptoOperationData&amp;, VectorCallback, VoidCallback failureCallback, ExceptionCode&amp;);
+    void platformDecrypt(const CryptoKeyRSA&amp;, const CryptoOperationData&amp;, VectorCallback, VoidCallback failureCallback, ExceptionCode&amp;);
+};
+
+}
+
+#endif // ENABLE(SUBTLE_CRYPTO)
+#endif // CryptoAlgorithmRSAES_PKCS1_v1_5_h
</ins><span class="cx">Property changes on: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCorecryptomacCryptoAlgorithmRSAES_PKCS1_v1_5Maccpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp (0 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp                                (rev 0)
+++ trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2013 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 &quot;config.h&quot;
+#include &quot;CryptoAlgorithmRSAES_PKCS1_v1_5.h&quot;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+#include &quot;CommonCryptoUtilities.h&quot;
+#include &quot;CryptoKeyRSA.h&quot;
+
+namespace WebCore {
+
+void CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt(const CryptoKeyRSA&amp; key, const CryptoOperationData&amp; data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode&amp;)
+{
+    Vector&lt;uint8_t&gt; cipherText(1024);
+    size_t cipherTextLength = cipherText.size();
+    CCCryptorStatus status = CCRSACryptorEncrypt(key.platformKey(), ccPKCS1Padding, data.first, data.second, cipherText.data(), &amp;cipherTextLength, 0, 0, kCCDigestNone);
+    if (status) {
+        failureCallback();
+        return;
+    }
+
+    cipherText.resize(cipherTextLength);
+    callback(cipherText);
+}
+
+void CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt(const CryptoKeyRSA&amp; key, const CryptoOperationData&amp; data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode&amp;)
+{
+    Vector&lt;uint8_t&gt; plainText(1024);
+    size_t plainTextLength = plainText.size();
+    CCCryptorStatus status = CCRSACryptorDecrypt(key.platformKey(), ccPKCS1Padding, data.first, data.second, plainText.data(), &amp;plainTextLength, 0, 0, kCCDigestNone);
+    if (status) {
+        failureCallback();
+        return;
+    }
+
+    plainText.resize(plainTextLength);
+    callback(plainText);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SUBTLE_CRYPTO)
</ins><span class="cx">Property changes on: trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCorecryptomacCryptoAlgorithmRegistryMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRegistryMac.cpp (160501 => 160502)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRegistryMac.cpp        2013-12-12 19:57:27 UTC (rev 160501)
+++ trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRegistryMac.cpp        2013-12-12 20:12:10 UTC (rev 160502)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;CryptoAlgorithmAES_CBC.h&quot;
</span><span class="cx"> #include &quot;CryptoAlgorithmAES_KW.h&quot;
</span><span class="cx"> #include &quot;CryptoAlgorithmHMAC.h&quot;
</span><ins>+#include &quot;CryptoAlgorithmRSAES_PKCS1_v1_5.h&quot;
</ins><span class="cx"> #include &quot;CryptoAlgorithmRSASSA_PKCS1_v1_5.h&quot;
</span><span class="cx"> #include &quot;CryptoAlgorithmRSA_OAEP.h&quot;
</span><span class="cx"> #include &quot;CryptoAlgorithmSHA1.h&quot;
</span><span class="lines">@@ -46,6 +47,7 @@
</span><span class="cx">     registerAlgorithm&lt;CryptoAlgorithmAES_CBC&gt;();
</span><span class="cx">     registerAlgorithm&lt;CryptoAlgorithmAES_KW&gt;();
</span><span class="cx">     registerAlgorithm&lt;CryptoAlgorithmHMAC&gt;();
</span><ins>+    registerAlgorithm&lt;CryptoAlgorithmRSAES_PKCS1_v1_5&gt;();
</ins><span class="cx">     registerAlgorithm&lt;CryptoAlgorithmRSASSA_PKCS1_v1_5&gt;();
</span><span class="cx">     registerAlgorithm&lt;CryptoAlgorithmRSA_OAEP&gt;();
</span><span class="cx">     registerAlgorithm&lt;CryptoAlgorithmSHA1&gt;();
</span></span></pre>
</div>
</div>

</body>
</html>