blob: acfaaabb9b2c18edfa876e825287a3d998a08bb4 [file] [log] [blame]
Test importing an HMAC key with malformed parameters
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS crypto.subtle.importKey("raw", asciiToUint8Array(""), {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("raw", rawKey, {name: "hmac", hash: "sha-1", length: 257}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("raw", rawKey, {name: "hmac", hash: "sha-1", length: 248}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA"}, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct"}, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: "HS224"}, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: "HS256"}, {name: "hmac", hash: "sha-224"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: "HS384"}, {name: "hmac", hash: "sha-256"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: "HS512"}, {name: "hmac", hash: "sha-384"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: "HS1"}, {name: "hmac", hash: "sha-512"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: ""}, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: ""}, {name: "hmac", hash: "sha-224"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: ""}, {name: "hmac", hash: "sha-256"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: ""}, {name: "hmac", hash: "sha-384"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: ""}, {name: "hmac", hash: "sha-512"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: "!!!", alg: "foo"}, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: "", alg: "foo"}, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: "HS1", use: "enc"}, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: "HS1", use: ""}, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: "HS1", key_ops: ["sign"]}, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: "HS1", key_ops: [ ]}, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", k: k, alg: "HS1", ext: false}, {name: "hmac", hash: "sha-1"}, extractable, ["sign", "verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS successfullyParsed is true
TEST COMPLETE