Skip to content

Commit b688465

Browse files
author
R. Martinho Fernandes
committed
Bug 1718228 - Make CollectedClientData follow the spec r=dveditz,baku
Differential Revision: https://phabricator.services.mozilla.com/D136881
1 parent 7ad40f6 commit b688465

File tree

4 files changed

+8
-26
lines changed

4 files changed

+8
-26
lines changed

dom/webauthn/WebAuthnManager.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ static nsresult AssembleClientData(
7575
clientDataObject.mType.Assign(aType);
7676
clientDataObject.mChallenge.Assign(challengeBase64);
7777
clientDataObject.mOrigin.Assign(aOrigin);
78-
clientDataObject.mHashAlgorithm.AssignLiteral(u"SHA-256");
79-
clientDataObject.mClientExtensions = aExtensions;
8078

8179
nsAutoString temp;
8280
if (NS_WARN_IF(!clientDataObject.ToJSON(temp))) {

dom/webauthn/tests/browser/browser_fido_appid_extension.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ add_task(async function test_appid() {
9696
// Check that the correct rpIdHash is returned.
9797
let rpIdHashSign = authenticatorData.slice(0, 32);
9898
ok(memcmp(rpIdHash, rpIdHashSign), "rpIdHash is correct");
99-
100-
let clientData = JSON.parse(buffer2string(clientDataJSON));
101-
is(clientData.clientExtensions.appid, appid, "appid extension sent");
10299
}
103100
);
104101

@@ -127,14 +124,6 @@ add_task(async function test_appid_unused() {
127124
extensions,
128125
} = await promiseWebAuthnGetAssertion(tab, rawId, { appid });
129126

130-
// Check the we can parse clientDataJSON.
131-
let clientData = JSON.parse(buffer2string(clientDataJSON));
132-
ok(
133-
"appid" in clientData.clientExtensions,
134-
`since it was passed, appid field should appear in the client data, but ` +
135-
`saw: ${JSON.stringify(clientData.clientExtensions)}`
136-
);
137-
138127
ok(
139128
"appid" in extensions,
140129
`appid should be populated in the extensions data, but saw: ` +

dom/webauthn/tests/test_webauthn_loopback.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ <h1>Full-run test for MakeCredential/GetAssertion for W3C Web Authentication</h1
5050
- response : AuthenticatorAttestationResponse : AuthenticatorResponse
5151
- attestationObject: CBOR object
5252
- clientDataJSON: serialized JSON
53-
- clientExtensionResults: (not yet supported)
5453
*/
5554

5655
is(aCredInfo.type, "public-key", "Credential type must be public-key")
@@ -66,13 +65,8 @@ <h1>Full-run test for MakeCredential/GetAssertion for W3C Web Authentication</h1
6665
let clientData = JSON.parse(buffer2string(aCredInfo.response.clientDataJSON));
6766
is(clientData.challenge, bytesToBase64UrlSafe(gCredentialChallenge), "Challenge is correct");
6867
is(clientData.origin, window.location.origin, "Origin is correct");
69-
is(clientData.hashAlgorithm, "SHA-256", "Hash algorithm is correct");
7068
is(clientData.type, "webauthn.create", "Type is correct");
7169

72-
let extensions = aCredInfo.getClientExtensionResults();
73-
is(extensions.appid, undefined, "appid extension wasn't used");
74-
is(clientData.clientExtensions.appid, undefined, "appid extension wasn't sent");
75-
7670
return webAuthnDecodeCBORAttestation(aCredInfo.response.attestationObject)
7771
.then(function(aAttestationObj) {
7872
// Make sure the RP ID hash matches what we calculate.
@@ -118,13 +112,11 @@ <h1>Full-run test for MakeCredential/GetAssertion for W3C Web Authentication</h1
118112
ok(aAssertion.response.signature === aAssertion.response.signature, "AuthenticatorAssertionResponse.Signature is SameObject");
119113
ok(aAssertion.response.signature instanceof ArrayBuffer, "AuthenticatorAssertionResponse.Signature is an ArrayBuffer");
120114
ok(aAssertion.response.userHandle === null, "AuthenticatorAssertionResponse.UserHandle is null for u2f authenticators");
121-
isDeeply(aAssertion.getClientExtensionResults(), {}, "No extensions should be reported");
122115

123116
ok(aAssertion.response.authenticatorData.byteLength > 0, "Authenticator data exists");
124117
let clientData = JSON.parse(buffer2string(aAssertion.response.clientDataJSON));
125118
is(clientData.challenge, bytesToBase64UrlSafe(gAssertionChallenge), "Challenge is correct");
126119
is(clientData.origin, window.location.origin, "Origin is correct");
127-
is(clientData.hashAlgorithm, "SHA-256", "Hash algorithm is correct");
128120
is(clientData.type, "webauthn.get", "Type is correct");
129121

130122
return webAuthnDecodeAuthDataArray(aAssertion.response.authenticatorData)

dom/webidl/WebAuthentication.webidl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,16 @@ dictionary CollectedClientData {
140140
required DOMString type;
141141
required DOMString challenge;
142142
required DOMString origin;
143-
required DOMString hashAlgorithm;
144-
DOMString tokenBindingId;
145-
// FIXME: bug 1493860: should this "= {}" be here?
146-
AuthenticationExtensionsClientInputs clientExtensions = {};
147-
AuthenticationExtensionsAuthenticatorInputs authenticatorExtensions;
143+
TokenBinding tokenBinding;
144+
};
145+
146+
dictionary TokenBinding {
147+
required DOMString status;
148+
DOMString id;
148149
};
149150

151+
enum TokenBindingStatus { "present", "supported" };
152+
150153
enum PublicKeyCredentialType {
151154
"public-key"
152155
};

0 commit comments

Comments
 (0)