blob: 1c9db0512bbeb41fdfeafac8d616a5c47606f113 [file] [log] [blame]
CONSOLE MESSAGE: AES-CBC and AES-CTR do not provide authentication by default, and implementing it manually can result in minor, but serious mistakes. We recommended using authenticated encryption like AES-GCM to protect against chosen-ciphertext attacks.
Test encrypting with malformed parameters
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS crypto.subtle.encrypt() rejected promise with TypeError: Not enough arguments.
PASS crypto.subtle.encrypt(1) rejected promise with TypeError: Not enough arguments.
PASS crypto.subtle.encrypt(1, 2) rejected promise with TypeError: Not enough arguments.
PASS crypto.subtle.encrypt(aesCbcParams, fakedKey, plainText) rejected promise with TypeError: Argument 2 ('key') to SubtleCrypto.encrypt must be an instance of CryptoKey.
PASS crypto.subtle.encrypt(aesCbcParams, wrongKey, plainText) rejected promise with InvalidAccessError: CryptoKey doesn't match AlgorithmIdentifier.
PASS crypto.subtle.encrypt(aesCbcParams, wrongKey, plainText) rejected promise with InvalidAccessError: CryptoKey doesn't support encryption.
PASS successfullyParsed is true
TEST COMPLETE