<!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 <ap@apple.com>
</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 <ap@apple.com>
+
</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 "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 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>+<!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>
</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 "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 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>+<!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 Key]'");
+ shouldBe("unwrappedKey.type", "'secret'");
+ shouldBe("unwrappedKey.extractable", "true");
+ shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
+ shouldBe("unwrappedKey.algorithm.length", "256");
+ shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt']");
+
+ 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 Key]'");
+ shouldBe("unwrappedKey.type", "'secret'");
+ shouldBe("unwrappedKey.extractable", "true");
+ shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
+ shouldBe("unwrappedKey.algorithm.length", "256");
+ shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt']");
+
+ 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>
</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 <ap@apple.com>
+
+ 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 <akling@apple.com>
</span><span class="cx">
</span><span class="cx"> [Mac] Stop not caching HTTP resources with "Vary" 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 = "<group>"; };
</span><span class="cx">                 E11C9D9A0EB3681200E409DB /* ScriptExecutionContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptExecutionContext.h; sourceTree = "<group>"; };
</span><span class="cx">                 E11C9DAF0EB3699500E409DB /* ScriptExecutionContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptExecutionContext.cpp; sourceTree = "<group>"; };
</span><ins>+                E1233F0A185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRSAES_PKCS1_v1_5.cpp; sourceTree = "<group>"; };
+                E1233F0B185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRSAES_PKCS1_v1_5.h; sourceTree = "<group>"; };
+                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 = "<group>"; };
</ins><span class="cx">                 E124748310AA161D00B79493 /* AuthenticationClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationClient.h; sourceTree = "<group>"; };
</span><span class="cx">                 E125F8291822CFEC00D84CD9 /* CryptoAlgorithmSHA1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmSHA1.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 E125F82A1822CFEC00D84CD9 /* CryptoAlgorithmSHA1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmSHA1.h; sourceTree = "<group>"; };
</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<CryptoAlgorithmParameters>();
</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<CryptoAlgorithmParameters>();
</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 == "RS512") {
</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 == "RSA1_5") {
+ algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5);
+ parameters = std::make_unique<CryptoAlgorithmParameters>();
</ins><span class="cx"> } else if (m_jwkAlgorithmName == "RSA-OAEP") {
</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 >= 2048;
</span><span class="cx"> if (m_jwkAlgorithmName == "RS512")
</span><span class="cx"> return sizeInBits >= 2048;
</span><ins>+ if (m_jwkAlgorithmName == "RSA1_5")
+ return sizeInBits >= 2048;
</ins><span class="cx"> if (m_jwkAlgorithmName == "RSA_OAEP")
</span><span class="cx"> return sizeInBits >= 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& rsaKey = toCryptoKeyRSA(key);
+ if (rsaKey.keySizeInBits() < 2048)
+ break;
+ jwkAlgorithm = "RSA1_5";
+ break;
+ }
</ins><span class="cx"> case CryptoAlgorithmIdentifier::RSA_OAEP: {
</span><span class="cx"> const CryptoKeyRSA& 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&, const CryptoKey& key) const
</del><ins>+bool CryptoAlgorithmAES_KW::keyAlgorithmMatches(const CryptoKey& 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& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec)
</del><ins>+void CryptoAlgorithmAES_KW::encryptForWrapKey(const CryptoAlgorithmParameters&, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& 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& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec)
</del><ins>+void CryptoAlgorithmAES_KW::decryptForUnwrapKey(const CryptoAlgorithmParameters&, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& 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&, const CryptoKey&) const;
</del><ins>+ bool keyAlgorithmMatches(const CryptoKey&) const;
</ins><span class="cx"> void platformEncrypt(const CryptoKeyAES&, const CryptoOperationData&, VectorCallback, VoidCallback failureCallback, ExceptionCode&);
</span><span class="cx"> void platformDecrypt(const CryptoKeyAES&, const CryptoOperationData&, VectorCallback, VoidCallback failureCallback, ExceptionCode&);
</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 "config.h"
+#include "CryptoAlgorithmRSAES_PKCS1_v1_5.h"
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+#include "CryptoAlgorithmRsaKeyGenParams.h"
+#include "CryptoKeyDataRSAComponents.h"
+#include "CryptoKeyRSA.h"
+#include "ExceptionCode.h"
+
+namespace WebCore {
+
+const char* const CryptoAlgorithmRSAES_PKCS1_v1_5::s_name = "RSAES-PKCS1-v1_5";
+
+CryptoAlgorithmRSAES_PKCS1_v1_5::CryptoAlgorithmRSAES_PKCS1_v1_5()
+{
+}
+
+CryptoAlgorithmRSAES_PKCS1_v1_5::~CryptoAlgorithmRSAES_PKCS1_v1_5()
+{
+}
+
+std::unique_ptr<CryptoAlgorithm> CryptoAlgorithmRSAES_PKCS1_v1_5::create()
+{
+ return std::unique_ptr<CryptoAlgorithm>(new CryptoAlgorithmRSAES_PKCS1_v1_5);
+}
+
+CryptoAlgorithmIdentifier CryptoAlgorithmRSAES_PKCS1_v1_5::identifier() const
+{
+ return s_identifier;
+}
+
+bool CryptoAlgorithmRSAES_PKCS1_v1_5::keyAlgorithmMatches(const CryptoKey& key) const
+{
+ if (key.algorithmIdentifier() != s_identifier)
+ return false;
+ ASSERT(isCryptoKeyRSA(key));
+
+ return true;
+}
+
+void CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt(const CryptoAlgorithmParameters&, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& 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&, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& 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& parameters, bool extractable, CryptoKeyUsage usages, KeyOrKeyPairCallback callback, VoidCallback failureCallback, ExceptionCode&)
+{
+ const CryptoAlgorithmRsaKeyGenParams& rsaParameters = toCryptoAlgorithmRsaKeyGenParams(parameters);
+
+ auto keyPairCallback = [callback](CryptoKeyPair& pair) {
+ callback(nullptr, &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&, const CryptoKeyData& keyData, bool extractable, CryptoKeyUsage usage, KeyCallback callback, VoidCallback failureCallback, ExceptionCode&)
+{
+ const CryptoKeyDataRSAComponents& rsaComponents = toCryptoKeyDataRSAComponents(keyData);
+
+ RefPtr<CryptoKeyRSA> 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 "CryptoAlgorithm.h"
+
+#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<CryptoAlgorithm> create();
+
+ virtual CryptoAlgorithmIdentifier identifier() const OVERRIDE;
+
+ virtual void encrypt(const CryptoAlgorithmParameters&, const CryptoKey&, const CryptoOperationData&, VectorCallback, VoidCallback failureCallback, ExceptionCode&) OVERRIDE;
+ virtual void decrypt(const CryptoAlgorithmParameters&, const CryptoKey&, const CryptoOperationData&, VectorCallback, VoidCallback failureCallback, ExceptionCode&) OVERRIDE;
+ virtual void generateKey(const CryptoAlgorithmParameters&, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback, VoidCallback failureCallback, ExceptionCode&) OVERRIDE;
+ virtual void importKey(const CryptoAlgorithmParameters&, const CryptoKeyData&, bool extractable, CryptoKeyUsage, KeyCallback, VoidCallback failureCallback, ExceptionCode&) OVERRIDE;
+
+private:
+ CryptoAlgorithmRSAES_PKCS1_v1_5();
+ virtual ~CryptoAlgorithmRSAES_PKCS1_v1_5();
+
+ bool keyAlgorithmMatches(const CryptoKey&) const;
+ void platformEncrypt(const CryptoKeyRSA&, const CryptoOperationData&, VectorCallback, VoidCallback failureCallback, ExceptionCode&);
+ void platformDecrypt(const CryptoKeyRSA&, const CryptoOperationData&, VectorCallback, VoidCallback failureCallback, ExceptionCode&);
+};
+
+}
+
+#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 "config.h"
+#include "CryptoAlgorithmRSAES_PKCS1_v1_5.h"
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+#include "CommonCryptoUtilities.h"
+#include "CryptoKeyRSA.h"
+
+namespace WebCore {
+
+void CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt(const CryptoKeyRSA& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode&)
+{
+ Vector<uint8_t> cipherText(1024);
+ size_t cipherTextLength = cipherText.size();
+ CCCryptorStatus status = CCRSACryptorEncrypt(key.platformKey(), ccPKCS1Padding, data.first, data.second, cipherText.data(), &cipherTextLength, 0, 0, kCCDigestNone);
+ if (status) {
+ failureCallback();
+ return;
+ }
+
+ cipherText.resize(cipherTextLength);
+ callback(cipherText);
+}
+
+void CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt(const CryptoKeyRSA& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode&)
+{
+ Vector<uint8_t> plainText(1024);
+ size_t plainTextLength = plainText.size();
+ CCCryptorStatus status = CCRSACryptorDecrypt(key.platformKey(), ccPKCS1Padding, data.first, data.second, plainText.data(), &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 "CryptoAlgorithmAES_CBC.h"
</span><span class="cx"> #include "CryptoAlgorithmAES_KW.h"
</span><span class="cx"> #include "CryptoAlgorithmHMAC.h"
</span><ins>+#include "CryptoAlgorithmRSAES_PKCS1_v1_5.h"
</ins><span class="cx"> #include "CryptoAlgorithmRSASSA_PKCS1_v1_5.h"
</span><span class="cx"> #include "CryptoAlgorithmRSA_OAEP.h"
</span><span class="cx"> #include "CryptoAlgorithmSHA1.h"
</span><span class="lines">@@ -46,6 +47,7 @@
</span><span class="cx"> registerAlgorithm<CryptoAlgorithmAES_CBC>();
</span><span class="cx"> registerAlgorithm<CryptoAlgorithmAES_KW>();
</span><span class="cx"> registerAlgorithm<CryptoAlgorithmHMAC>();
</span><ins>+ registerAlgorithm<CryptoAlgorithmRSAES_PKCS1_v1_5>();
</ins><span class="cx"> registerAlgorithm<CryptoAlgorithmRSASSA_PKCS1_v1_5>();
</span><span class="cx"> registerAlgorithm<CryptoAlgorithmRSA_OAEP>();
</span><span class="cx"> registerAlgorithm<CryptoAlgorithmSHA1>();
</span></span></pre>
</div>
</div>
</body>
</html>