blob: dd6ee399699c0b6c643ea493a892759f42215c61 [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 crypto.subtle.encrypt("aes-cfb-8", 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-cfb-8"}, 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-cfb-8", iv: asciiToUint8Array("")}, key, plainText) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS crypto.subtle.encrypt({name: "aes-cfb-8", iv: asciiToUint8Array("j")}, key, plainText) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS crypto.subtle.encrypt({name: "aes-cfb-8", iv: asciiToUint8Array("jnOw99oOZFLIEPMrd")}, key, plainText) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS successfullyParsed is true
TEST COMPLETE