blob: 45b48dda373cf9e2475a4eae038fe4ddda9d62c0 [file] [log] [blame]
Test encrypting using AES-CBC/AES-CFB with malformed parameters
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS crypto.subtle.encrypt("aes-cbc", key, plainText) rejected promise with TypeError: Member AesCbcCfbParams.iv is required and must be an instance of (ArrayBufferView or ArrayBuffer).
PASS crypto.subtle.encrypt({name: "aes-cbc"}, key, plainText) rejected promise with TypeError: Member AesCbcCfbParams.iv is required and must be an instance of (ArrayBufferView or ArrayBuffer).
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: true}, key, plainText) rejected promise with TypeError: Type error.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: 1}, key, plainText) rejected promise with TypeError: Type error.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: null}, key, plainText) rejected promise with TypeError: Type error.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: undefined}, key, plainText) rejected promise with TypeError: Member AesCbcCfbParams.iv is required and must be an instance of (ArrayBufferView or ArrayBuffer).
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: Symbol()}, key, plainText) rejected promise with TypeError: Type error.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: { }}, key, plainText) rejected promise with TypeError: Type error.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: "foo"}, key, plainText) rejected promise with TypeError: Type error.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: asciiToUint8Array("")}, key, plainText) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: asciiToUint8Array("j")}, key, plainText) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: asciiToUint8Array("jnOw99oOZFLIEPMrd")}, key, plainText) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS successfullyParsed is true
TEST COMPLETE