| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>WebCrypto On An Insecure Origin</title> | |
| 5 <script src="/resources/testharness.js"></script> | |
| 6 <script src="/resources/testharnessreport.js"></script> | |
| 7 <script src="/resources/get-host-info.js"></script> | |
| 8 </head> | |
| 9 <body></body> | |
| 10 <script> | |
| 11 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) { | |
| 12 window.location = get_host_info().UNAUTHENTICATED_ORIGIN + | |
| 13 window.location.pathname; | |
| 14 } else { | |
| 15 if (window.testRunner) | |
| 16 testRunner.overridePreference( | |
| 17 "WebKitStrictPowerfulFeatureRestrictions", true); | |
| 18 | |
| 19 async_test(function () { | |
| 20 var jwkKey = { | |
| 21 kty: "oct", | |
| 22 k: "jnOw99oOZFLIEPMrgJB55WL46tJSLGt7jnOw99oOZFI" | |
| 23 }; | |
| 24 Promise.resolve(null).then(this.step_func(function (result) { | |
| 25 return crypto.subtle.importKey("jwk", jwkKey, | |
| 26 {name: "AES-CBC"}, | |
| 27 true, | |
| 28 ['encrypt', 'decrypt', | |
| 29 'wrapKey', 'unwrapKey']); | |
| 30 })).then(this.step_func(function (result) { | |
| 31 assert_unreached('crypto.subtle should fial, but succeeded.'); | |
| 32 this.done(); | |
| 33 }), this.step_func(function (result) { | |
| 34 assert_equals(result.message, 'Only secure origins are allowed
(see: https://goo.gl/Y0ZkNV).'); | |
| 35 this.done(); | |
| 36 })); | |
| 37 }, "WebCrypto not allowed on insecure origin"); | |
| 38 } | |
| 39 </script> | |
| 40 </html> | |
| OLD | NEW |