tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_WebCrypto_Import_Keys_Too_Long.html (1475B)


      1 <!DOCTYPE html>
      2 <html>
      3 
      4 <head>
      5 <title>WebCrypto Test Suite</title>
      6 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
      7 <link rel="stylesheet" href="./test_WebCrypto.css"/>
      8 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9 
     10 <!-- General testing framework -->
     11 <script src="./test-array.js"></script>
     12 
     13 <script>/* <![CDATA[*/
     14 "use strict";
     15 
     16 // -----------------------------------------------------------------------------
     17 TestArray.addTest(
     18  "Import a key that is too long.",
     19  function() {
     20    var k = new Uint8Array(0x20000010);
     21    window.crypto.subtle.importKey("raw", k, "AES-GCM", true, ["encrypt", "decrypt"]).then(key => {
     22      return window.crypto.subtle.encrypt(
     23        { name: "AES-GCM", iv: new ArrayBuffer(96 / 8) },
     24        key, new Uint8Array(32));
     25    }).then(error(this), complete(this))
     26  }
     27 );
     28 /* ]]>*/</script>
     29 </head>
     30 
     31 <body>
     32 
     33 <div id="content">
     34 <div id="head">
     35 	<b>Web</b>Crypto<br>
     36 </div>
     37 
     38    <div id="start" onclick="start();">RUN ALL</div>
     39 
     40    <div id="resultDiv" class="content">
     41    Summary:
     42    <span class="pass"><span id="passN">0</span> passed, </span>
     43    <span class="fail"><span id="failN">0</span> failed, </span>
     44    <span class="pending"><span id="pendingN">0</span> pending.</span>
     45    <br/>
     46    <br/>
     47 
     48    <table id="results">
     49        <tr>
     50            <th>Test</th>
     51            <th>Result</th>
     52            <th>Time</th>
     53        </tr>
     54    </table>
     55 
     56    </div>
     57 
     58    <div id="foot"></div>
     59 </div>
     60 
     61 </body>
     62 </html>