blob: 4affbddb899ee8969d901b326d539d02b1a8f088 [file] [log] [blame]
Test PBKDF2 deriveBits operation with malformed parameters
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS crypto.subtle.deriveBits("PBKDF2", baseKey, null) rejected promise with TypeError: Member Pbkdf2Params.hash is required and must be an instance of (object or DOMString).
PASS crypto.subtle.deriveBits({name: "PBKDF2"}, baseKey, null) rejected promise with TypeError: Member Pbkdf2Params.hash is required and must be an instance of (object or DOMString).
PASS crypto.subtle.deriveBits({name: "PBKDF2", salt: true, iterations: 100000, hash: "sha-1"}, baseKey, 128) rejected promise with TypeError: Type error.
PASS crypto.subtle.deriveBits({name: "PBKDF2", salt: null, iterations: 100000, hash: "sha-1"}, baseKey, 128) rejected promise with TypeError: Type error.
PASS crypto.subtle.deriveBits({name: "PBKDF2", salt: undefined, iterations: 100000, hash: "sha-1"}, baseKey, 128) rejected promise with TypeError: Member Pbkdf2Params.salt is required and must be an instance of (ArrayBufferView or ArrayBuffer).
PASS crypto.subtle.deriveBits({name: "PBKDF2", salt: Symbol(), iterations: 100000, hash: "sha-1"}, baseKey, 128) rejected promise with TypeError: Type error.
PASS crypto.subtle.deriveBits({name: "PBKDF2", salt: { }, iterations: 100000, hash: "sha-1"}, baseKey, 128) rejected promise with TypeError: Type error.
PASS crypto.subtle.deriveBits({name: "PBKDF2", salt: 1, iterations: 100000, hash: "sha-1"}, baseKey, 128) rejected promise with TypeError: Type error.
PASS crypto.subtle.deriveBits({name: "PBKDF2", salt: salt, iterations: undefined, hash: "sha-1"}, baseKey, 128) rejected promise with TypeError: Member Pbkdf2Params.iterations is required and must be an instance of unsigned long.
PASS crypto.subtle.deriveBits({name: "PBKDF2", salt: salt, iterations: Symbol(), hash: "sha-1"}, baseKey, 128) rejected promise with TypeError: Cannot convert a symbol to a number.
PASS crypto.subtle.deriveBits({name: "PBKDF2", salt: salt, iterations: 100000, hash: "sha-1"}, baseKey, null) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS crypto.subtle.deriveBits({name: "PBKDF2", salt: salt, iterations: 100000, hash: "sha-1"}, baseKey, 0) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS crypto.subtle.deriveBits({name: "PBKDF2", salt: salt, iterations: 100000, hash: "sha-1"}, baseKey, 5) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS crypto.subtle.deriveBits({name: "PBKDF2", salt: salt, iterations: 0, hash: "sha-1"}, baseKey, 128) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS successfullyParsed is true
TEST COMPLETE