OLD | NEW |
---|---|
(Empty) | |
1 <html> | |
2 | |
3 <head> | |
4 <title>Test page for key generation</title> | |
5 | |
6 <script> | |
7 var keygen = false; | |
8 | |
9 function runKeygen() { | |
10 if (window.location.search.indexOf('?') == -1) { | |
11 document.getElementById('test_form').submit(); | |
12 } else { | |
13 // Verify that the form submission includes a generated key. | |
14 // We check for base64 'MIIC' to match the first 3 bytes: 0x30 0x82 0x02 | |
Finnur
2015/12/11 21:06:12
nit: Generally, comments should end with some punc
| |
15 keygen = (window.location.search.indexOf('?key=MIIC') == 0) | |
16 } | |
17 } | |
18 | |
19 function didKeygen() { | |
20 return keygen; | |
21 } | |
22 </script> | |
23 </head> | |
24 | |
25 <body onload="runKeygen()"> | |
26 This page tries to use a keygen element when it is loaded. | |
27 <form id='test_form'> | |
28 <keygen name='key'> | |
29 </form> | |
30 </body> | |
31 | |
32 </html> | |
OLD | NEW |