Skip to content

Commit 4c7ece1

Browse files
author
Cristian Tuns
committed
Backed out changeset e2908f3e5373 (bug 1718228) for causing mochitest failure in test_webauthn_loopback.html CLOSED TREE
1 parent 217dd34 commit 4c7ece1

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

dom/webauthn/WebAuthnManager.cpp

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

8082
nsAutoString temp;
8183
if (NS_WARN_IF(!clientDataObject.ToJSON(temp))) {

dom/webauthn/tests/test_webauthn_loopback.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ <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)
5354
*/
5455

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

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+
7076
return webAuthnDecodeCBORAttestation(aCredInfo.response.attestationObject)
7177
.then(function(aAttestationObj) {
7278
// Make sure the RP ID hash matches what we calculate.
@@ -112,6 +118,7 @@ <h1>Full-run test for MakeCredential/GetAssertion for W3C Web Authentication</h1
112118
ok(aAssertion.response.signature === aAssertion.response.signature, "AuthenticatorAssertionResponse.Signature is SameObject");
113119
ok(aAssertion.response.signature instanceof ArrayBuffer, "AuthenticatorAssertionResponse.Signature is an ArrayBuffer");
114120
ok(aAssertion.response.userHandle === null, "AuthenticatorAssertionResponse.UserHandle is null for u2f authenticators");
121+
isDeeply(aAssertion.getClientExtensionResults(), {}, "No extensions should be reported");
115122

116123
ok(aAssertion.response.authenticatorData.byteLength > 0, "Authenticator data exists");
117124
let clientData = JSON.parse(buffer2string(aAssertion.response.clientDataJSON));

dom/webidl/WebAuthentication.webidl

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

151-
enum TokenBindingStatus { "present", "supported" };
152-
153150
enum PublicKeyCredentialType {
154151
"public-key"
155152
};

0 commit comments

Comments
 (0)