mirror of
https://github.com/servo/servo.git
synced 2025-08-21 21:35:32 +01:00
Update web-platform-tests to revision 6d85a3b422cab97d032ad3db47cb741ca364185f
This commit is contained in:
parent
cd663ea332
commit
b524b7c279
37 changed files with 1446 additions and 178 deletions
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>WebAuthn navigator.credentials.create() pubKeyCredParams Tests</title>
|
||||
<link rel="author" title="Adam Powers" href="mailto:adam@fidoalliance.org">
|
||||
<link rel="help" href="https://w3c.github.io/webauthn/#iface-credential">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src=helpers.js></script>
|
||||
<body></body>
|
||||
<script>
|
||||
standardSetup(function() {
|
||||
"use strict";
|
||||
|
||||
var badType = {
|
||||
type: "something-else",
|
||||
alg: cose_alg_ECDSA_w_SHA512
|
||||
};
|
||||
var badTypeEmptyString = cloneObject(badType);
|
||||
badTypeEmptyString.type = "";
|
||||
var badTypeNull = cloneObject(badType);
|
||||
badTypeNull.type = null;
|
||||
var badTypeEmptyObj = cloneObject(badType);
|
||||
badTypeEmptyObj.type = {};
|
||||
|
||||
var badAlg = {
|
||||
type: "public-key",
|
||||
alg: 42
|
||||
};
|
||||
var badAlgZero = cloneObject(badAlg);
|
||||
badAlgZero.alg = 0;
|
||||
|
||||
// bad pubKeyCredParams values
|
||||
new CreateCredentialsTest({path: "options.publicKey.pubKeyCredParams", value: undefined}).runTest("Bad pubKeyCredParams: pubKeyCredParams is undefined", new TypeError());
|
||||
new CreateCredentialsTest("options.publicKey.pubKeyCredParams", "hi mom").runTest("Bad pubKeyCredParams: pubKeyCredParams is string", new TypeError());
|
||||
new CreateCredentialsTest("options.publicKey.pubKeyCredParams", null).runTest("Bad pubKeyCredParams: pubKeyCredParams is null", new TypeError());
|
||||
new CreateCredentialsTest("options.publicKey.pubKeyCredParams", [badType]).runTest("Bad pubKeyCredParams: first param has bad type (\"something-else\")", new TypeError());
|
||||
new CreateCredentialsTest("options.publicKey.pubKeyCredParams", [badTypeEmptyString]).runTest("Bad pubKeyCredParams: first param has bad type (\"\")", new TypeError());
|
||||
new CreateCredentialsTest("options.publicKey.pubKeyCredParams", [badTypeNull]).runTest("Bad pubKeyCredParams: first param has bad type (null)", new TypeError());
|
||||
new CreateCredentialsTest("options.publicKey.pubKeyCredParams", [badTypeEmptyObj]).runTest("Bad pubKeyCredParams: first param has bad type (empty object)", new TypeError());
|
||||
new CreateCredentialsTest("options.publicKey.pubKeyCredParams", [badAlg]).runTest("Bad pubKeyCredParams: first param has bad alg (42)", "NotSupportedError");
|
||||
new CreateCredentialsTest("options.publicKey.pubKeyCredParams", [badAlgZero]).runTest("Bad pubKeyCredParams: first param has bad alg (0)", "NotSupportedError");
|
||||
|
||||
// TODO: come back to this when mock authenticators support multiple cryptos so that we can test the preference ranking
|
||||
// function verifyEC256(res) {
|
||||
// debug ("verifyEC256 got", res);
|
||||
// debug ("client data JSON", ab2str(res.response.clientDataJSON));
|
||||
// parseAuthenticatorData(res.response.attestationObject);
|
||||
// }
|
||||
// new CreateCredentialsTest("options.publicKey.pubKeyCredParams", [pkParamEC256, pkParamEC512])
|
||||
// .afterTest(verifyEC256)
|
||||
// .runTest("EC256, EC512 pubKeyCredParams");
|
||||
// function verifyEC512(res) {
|
||||
// debug ("verifyEC512 got", res);
|
||||
// debug ("client data JSON", ab2str(res.response.clientDataJSON));
|
||||
// // parseAuthenticatorData(res.response.attestationObject);
|
||||
// printHex ("clientDataJSON", res.response.clientDataJSON);
|
||||
// printHex ("attestationObject", res.response.attestationObject);
|
||||
// }
|
||||
// new CreateCredentialsTest("options.publicKey.pubKeyCredParams", [pkParamEC512, pkParamEC256])
|
||||
// .afterTest(verifyEC512)
|
||||
// .runTest("EC512, EC256 pubKeyCredParams");
|
||||
});
|
||||
|
||||
/* JSHINT */
|
||||
/* globals standardSetup, CreateCredentialsTest, cose_alg_ECDSA_w_SHA512, cloneObject */
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue