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