Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: LayoutTests/crypto/aes-cbc-decrypt-failure.html

Issue 258203003: [webcrypto] Define the DOMException OperationError. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase, just in case... Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/crypto/aes-cbc-decrypt-failure-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../resources/js-test.js"></script> 4 <script src="../resources/js-test.js"></script>
5 <script src="resources/common.js"></script> 5 <script src="resources/common.js"></script>
6 <script src="resources/keys.js"></script> 6 <script src="resources/keys.js"></script>
7 </head> 7 </head>
8 <body> 8 <body>
9 <p id="description"></p> 9 <p id="description"></p>
10 <div id="console"></div> 10 <div id="console"></div>
(...skipping 15 matching lines...) Expand all
26 var algorithm = {name: 'aes-cbc', iv: iv}; 26 var algorithm = {name: 'aes-cbc', iv: iv};
27 27
28 function verifyDecryptionFails(newCipherTextLength) 28 function verifyDecryptionFails(newCipherTextLength)
29 { 29 {
30 var newCipherText = cipherText.subarray(0, newCipherTextLength); 30 var newCipherText = cipherText.subarray(0, newCipherTextLength);
31 31
32 var description = "ciphertext length: " + newCipherText.byteLength; 32 var description = "ciphertext length: " + newCipherText.byteLength;
33 return crypto.subtle.decrypt(algorithm, key, newCipherText).then(function(re sult) { 33 return crypto.subtle.decrypt(algorithm, key, newCipherText).then(function(re sult) {
34 debug("FAIL: decrypting succeeded. " + description); 34 debug("FAIL: decrypting succeeded. " + description);
35 }, function(result) { 35 }, function(result) {
36 logError(result);
36 debug("PASS: decrypting failed. " + description); 37 debug("PASS: decrypting failed. " + description);
37 }); 38 });
38 } 39 }
39 40
40 crypto.subtle.importKey('raw', keyData, algorithm, extractable, usages).then(fun ction(result) { 41 crypto.subtle.importKey('raw', keyData, algorithm, extractable, usages).then(fun ction(result) {
41 key = result; 42 key = result;
42 43
43 // Verify that decryption works with the original ciphertext. 44 // Verify that decryption works with the original ciphertext.
44 return crypto.subtle.decrypt(algorithm, key, cipherText); 45 return crypto.subtle.decrypt(algorithm, key, cipherText);
45 }).then(function(result) { 46 }).then(function(result) {
(...skipping 17 matching lines...) Expand all
63 badLengths.forEach(function(badLength) { 64 badLengths.forEach(function(badLength) {
64 lastPromise = lastPromise.then(verifyDecryptionFails.bind(null, badLengt h)); 65 lastPromise = lastPromise.then(verifyDecryptionFails.bind(null, badLengt h));
65 }); 66 });
66 return lastPromise; 67 return lastPromise;
67 }).then(finishJSTest, failAndFinishJSTest); 68 }).then(finishJSTest, failAndFinishJSTest);
68 69
69 </script> 70 </script>
70 71
71 </body> 72 </body>
72 </html> 73 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/crypto/aes-cbc-decrypt-failure-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698