gecko-dev/dom/u2f
J.C. Jones b1cbda2eea Bug 1460767 - Return device ineligible when appropriate for U2F r=ttaubert
Summary:
FIDO U2F's specification says that when the wrong security key responds to a
signature, or when an already-registered key exists, that the UA should return
error code 4, DEVICE_INELIGIBLE. We used to do that, but adjusted some things
for WebAuthn and now we don't. This changes the soft token to return that at
the appropriate times, and updates the expectations of U2F.cpp that it should
use InvalidStateError as the signal to reutrn DEVICE_INELIGIBLE.

Also, note that WebAuthn's specification says that if any authenticator returns
"InvalidStateError" that it should be propagated, as it indicates that the
authenticator obtained user consent and failed to complete its job [1].

This change to the Soft Token affects the WebAuthn tests, but in a good way.
Reading the WebAuthn spec, we should not be returning NotAllowedError when there
is consent from the user via the token (which the softtoken always deliveres).

As such, this adjusts the affected WebAuthn tests, and adds a couple useful
checks to test_webauthn_get_assertion.html for future purposes.

[1] https://w3c.github.io/webauthn/#createCredential section 5.1.3 "Create a new
    credential", Step 20, Note 2: "If any authenticator returns an error status
    equivalent to "InvalidStateError"..."

Test Plan: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f2fc930f7fc8eea69b1ebc96748fe95e150a92a4

Reviewers: ttaubert

Bug #: 1460767

Differential Revision: https://phabricator.services.mozilla.com/D1269

--HG--
extra : transplant_source : M%5B%93%81%29%7E%B2%E8%24%05%A6%96%8BUN%C9%FB%3E%B3h
2018-05-10 16:36:18 -07:00
..
tests Bug 1454813: Part 2b - Rename SpawnTask.js to AddTask.js. r=florian 2018-04-18 11:43:45 -07:00
U2F.cpp Bug 1460767 - Return device ineligible when appropriate for U2F r=ttaubert 2018-05-10 16:36:18 -07:00
U2F.h Bug 1437616 - Fix Windows bustage on a CLOSED TREE r=me 2018-02-12 21:46:11 +01:00
U2FAuthenticator.h Bug 1412125, part 2 - Fix dom/ mode lines. r=qdot 2017-10-26 15:08:41 -07:00
U2FUtil.h Bug 1412125, part 2 - Fix dom/ mode lines. r=qdot 2017-10-26 15:08:41 -07:00
moz.build Bug 1421616 - Have one WebAuthnManager instance per CredentialsContainer r=jcj 2017-12-05 19:05:06 +01:00