| <script src="../../resources/js-test-pre.js"></script> |
| <script src="../resources/common.js"></script> |
| description("Test decrypting with malformed parameters"); |
| var cipherText = hexStringToUint8Array("2ffa4618784dfd414b22c40c6330d022"); |
| iv: asciiToUint8Array("jnOw99oOZFLIEPMr"), |
| var rawKey = asciiToUint8Array("jnOw99oOZFLIEPMr"); |
| shouldReject('crypto.subtle.decrypt()'); |
| shouldReject('crypto.subtle.decrypt(1)'); |
| shouldReject('crypto.subtle.decrypt(1, 2)'); |
| crypto.subtle.importKey("raw", rawKey, "aes-kw", extractable, ["wrapKey", "unwrapKey"]).then(function(result) { |
| // Wrong algorithm identifier. |
| shouldReject('crypto.subtle.decrypt(aesCbcParams, wrongKey, cipherText)'); |
| return crypto.subtle.importKey("raw", rawKey, "aes-cbc", extractable, ["wrapKey", "unwrapKey"]); |
| }).then(function(result) { |
| return shouldReject('crypto.subtle.decrypt(aesCbcParams, wrongKey, cipherText)'); |
| <script src="../../resources/js-test-post.js"></script> |