Skip to content

Commit 65ffa22

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 6330ec5 commit 65ffa22

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

dom/webauthn/WebAuthnManager.cpp

-2
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/test_webauthn_loopback.html

-8
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

+8-5
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)