Commit Graph

152 Commits

Author SHA1 Message Date
Tim Taubert
dd4d724d5b Bug 1444547 - Propagate proper error codes from u2f-hid-rs to WebAuthn r=jcj
Reviewers: jcj

Reviewed By: jcj

Bug #: 1444547

Differential Revision: https://phabricator.services.mozilla.com/D717
2018-03-14 14:09:02 +01:00
Tim Taubert
141cb3849c Bug 1444756 - Rewrite browser_webauthn_telemetry.js r=jcj
Reviewers: jcj

Reviewed By: jcj

Bug #: 1444756

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

--HG--
extra : amend_source : 991801bfb48a6e3262c1d2a77c8734defae2406d
2018-03-13 08:16:52 +01:00
Tim Taubert
2bd0ff9c93 Bug 1430150 - Disable browser_webauthn_telemetry.js on TV runs for now r=bustage 2018-03-11 20:23:07 +01:00
Tim Taubert
6ded2cf370 Bug 1430150 - Implement WebAuthentication permission prompts r=jcj,johannh
Reviewers: jcj, johannh

Reviewed By: jcj, johannh

Bug #: 1430150

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

--HG--
rename : dom/webauthn/tests/cbor/cbor.js => dom/webauthn/tests/cbor.js
extra : amend_source : f137c2aebea5797cd07d4500cb71c2b9be4e4844
2018-03-11 18:47:14 +01:00
Tim Taubert
afe259f21f Bug 1409202 - Web Authentication - Restrict to selected tabs in the active window r=jcj
Summary:
This patch restricts any calls to navigator.credentials.* methods to selected
tabs. Any active WebAuthn request will be aborted when the parent chrome
window loses focus, or the <browser> is backgrounded.

Reviewers: jcj

Reviewed By: jcj

Bug #: 1409202

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

--HG--
extra : amend_source : 112378a1ab2e883d7603e8a28ff3f8e944d57b5f
2018-03-10 06:43:20 +01:00
Matt Brubeck
1fbdfd78ef Bug 1444097 - Clean up env_logger dependencies. r=ted
For the "js" crate, disable the "regex" feature to reduce binary size.

For the "u2fhid" crate, it's used only in examples. Make it a dev-dependency
so it won't be part of the Firefox build.

MozReview-Commit-ID: DY9indMqrRw

--HG--
extra : rebase_source : aa66fe1effaeca0ae35ec5dd20b33724eb3fac48
2018-03-08 07:35:11 -08:00
Matt Brubeck
54c488c132 Bug 1443248 - Update u2fhid to core-foundation-sys 0.5. r=ttaubert
MozReview-Commit-ID: 4xTSQpvHHAV

--HG--
extra : rebase_source : 9f6234a05ab1b8a0bc47482a2a745edfa0bd2f68
2018-03-05 11:13:13 -08:00
Tim Taubert
789cd3bd6f Bug 1442557 - [u2f-hid-rs] Keep polling excluded devices when creating credentials r=jcj
Reviewers: jcj

Reviewed By: jcj

Bug #: 1442557

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

--HG--
extra : amend_source : 95eb9f67cd6308cb9be6be2b6f520a7d20fb2516
2018-03-02 16:03:33 +01:00
Tim Taubert
3879951466 Bug 1442562 - Sync u2f-hid-rs rustfmt changes r=jcj
Reviewers: jcj

Reviewed By: jcj

Bug #: 1442562

Differential Revision: https://phabricator.services.mozilla.com/D669
2018-03-02 16:00:58 +01:00
Tim Taubert
612a195ccf Bug 1439856 - U2FTokenTransport interface should use WebAuthn*Info types defined in the .pidl r=jcj
Reviewers: jcj

Reviewed By: jcj

Bug #: 1439856

Differential Revision: https://phabricator.services.mozilla.com/D625
2018-02-22 22:09:00 +01:00
Tim Taubert
0af61da4ec Bug 1406471 - Web Authentication - Implement FIDO AppID Extension r=jcj,smaug
Reviewers: jcj, smaug

Reviewed By: jcj

Bug #: 1406471

Differential Revision: https://phabricator.services.mozilla.com/D595
2018-02-22 10:53:49 +01:00
Tim Taubert
3e79498113 Bug 1439326 - Add U2FTokenTransport::Drop() to better handle U2FHIDTokenManager destruction r=jcj 2018-02-19 12:45:43 +01:00
Tim Taubert
8e5d9a4b24 Bug 1437616 - Fix more Windows bustage on a CLOSED TREE r=me 2018-02-12 22:09:38 +01:00
Tim Taubert
bc18da5fe7 Bug 1437616 - Use proper WebAuthn result types defined in the .pidl r=jcj
Reviewers: jcj

Reviewed By: jcj

Bug #: 1437616

Differential Revision: https://phabricator.services.mozilla.com/D582
2018-02-12 21:08:54 +01:00
Tim Taubert
7cd0f0b36c Bug 1437487 - [u2f-hid-rs] Allow passing an empty key handles list r=jcj
Reviewers: jcj

Reviewed By: jcj

Bug #: 1437487

Differential Revision: https://phabricator.services.mozilla.com/D580
2018-02-12 16:02:43 +01:00
Tim Taubert
4c6fab9bac Bug 1416056 - Web Authentication - Default to "None Attestation" r=jcj
Summary:
Always replace attestation statements with a "none" attestation.

Bug 1430150 will introduce a prompt that asks the user for permission whenever
the RP requests "direct" attestation. Only if the user opts in we will forward
the attestation statement with the token's certificate and signature.

Reviewers: jcj

Reviewed By: jcj

Bug #: 1416056

Differential Revision: https://phabricator.services.mozilla.com/D567
2018-02-09 16:34:39 +01:00
Tim Taubert
9170ed9f23 Bug 1436707 - Ensure the U2FSoftTokenManager is initialized in when creating an assertion r=jcj
Reviewers: jcj

Reviewed By: jcj

Bug #: 1436707

Differential Revision: https://phabricator.services.mozilla.com/D563
2018-02-08 16:50:26 +01:00
Tim Taubert
08931dd068 Bug 1435527 - Run to timeout from navigator.credentials.get() when PublicKeyCredentialRequestOptions.allowCredentials is empty r=jcj
Reviewers: jcj

Reviewed By: jcj

Bug #: 1435527

Differential Revision: https://phabricator.services.mozilla.com/D559
2018-02-08 12:45:21 +01:00
J.C. Jones
8ecfc436b4 Bug 1436473 - Rename WebAuthn dict to PublicKeyCredentialCreationOptions r=baku
Late-breaking rename pre-CR in Web Authentication [1] renamed a dictionary. It's
not an interop issue, really, which must be why it was let through. This is a
WebIDL and Web Platform Tests-only issue. (The WPT updates are happening at
Github [2])

[1] https://github.com/w3c/webauthn/pull/779/files
[2] https://github.com/w3c/web-platform-tests/pull/9237

MozReview-Commit-ID: KEIlqIYbzKp

--HG--
extra : rebase_source : 4204ea62a41f374a6731a9367552af122d354145
2018-02-07 12:01:51 -07:00
David Keeler
087f092867 bug 1421084 - part 4/4 - remove nsNSSShutDown.h and (hopefully) all references to it r=mt,ttaubert
MozReview-Commit-ID: 2mhvHsC5Nil

--HG--
extra : rebase_source : 651c2bcf8655f75756ea2bac788eb8c0781dc90a
2018-01-24 14:44:01 -08:00
David Keeler
ad5cec4768 bug 1421084 - part 3/4 - remove nsNSSShutDownObject::shutdown and virtualDestroyNSSReference r=mt,ttaubert
MozReview-Commit-ID: ErL7ZjAGVVC

--HG--
extra : rebase_source : 2869aafaef729f0ad190f957919e8b9c40700477
2018-01-24 14:29:08 -08:00
David Keeler
a0e34baf27 bug 1421084 - part 2/4 - remove nsNSSShutDownObject::isAlreadyShutDown() r=mt,ttaubert
MozReview-Commit-ID: DlS16pHE0Ik

--HG--
extra : rebase_source : d7596a3571478adefae4ffa5d446ff5234ba9ed7
2018-01-23 12:22:56 -08:00
David Keeler
e8cc0ba1ce bug 1421084 - part 1/4 - remove now-unnecessary nsNSSShutDownPreventionLock r=mt,ttaubert
As of bug 1417680, the NSS shutdown tracking infrastructure is unnecessary (and
does nothing anyway). This series of changesets removes the remaining pieces in
a way that is hopefully easy to confirm is correct.

MozReview-Commit-ID: 8Y5wpsyNlGc

--HG--
extra : rebase_source : ef6b481510d949e404a4ef5615097d66e566c947
2018-01-23 10:37:47 -08:00
J.C. Jones
c2ff67b667 Bug 1433525 - Web Authentication Client Data needs the "type" field r=keeler,smaug
The Web Authentication CollectedClientData is missing the type field, which
is just a simple string. (The editor's draft also removes hashAlgorithm, but
let's not get ahead of ourselves...)

Add in that simple string. This was found at interop testing.

MozReview-Commit-ID: DlawLyHTYhB

--HG--
extra : rebase_source : 6cdd8e14161dc4aea5bfd1baf60c7384219ba951
2018-01-26 10:41:37 -08:00
J.C. Jones
5685e93ac7 Bug 1428916 - WebAuthn: Draft Attestation Preference r=smaug,ttaubert
The WebAuthn spec lets RPs ask to specifically get direct attestation certificates
during credential creation using the "Attestation Conveyance Preference" [1].

This change adds that field into the WebIDL and ignores it for now. This is
pre-work to Bug #1430150 which will make this useful (which in turn requires
Bug #1416056's support for anonymizing those attestation certificates).

[1] https://www.w3.org/TR/webauthn/#attestation-convey

MozReview-Commit-ID: 763vaAMv48z

--HG--
extra : rebase_source : 7fb7c64a0ee3167032485378af6074a7366295a4
2018-01-23 12:21:15 -07:00
Chris Peterson
37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Tim Taubert
c3180f09e1 Bug 1406467 - Web Authentication - WD-07 Updates to Make Assertion r=jcj,smaug
Summary:
Add support for PublicKeyCredentialRequestOptions.userVerification. For now
this basically means that we'll abort the operation with NotAllowed, as we
don't support user verification yet.

Pass PublicKeyCredentialDescriptor.transports through to the token manager
implementations. The softoken will ignore those and pretend to support all
transports defined by the spec. The USB HID token will check for the "usb"
transport and either ignore credentials accordingly, or abort the operation.

Note: The `UserVerificationRequirement` in WebIDL is defined at https://w3c.github.io/webauthn/#assertion-options

Reviewers: jcj, smaug

Reviewed By: jcj, smaug

Bug #: 1406467

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

--HG--
extra : amend_source : 314cadb3bc40bbbee2a414bc5f13caed55f9d720
2018-01-09 07:27:35 +01:00
Adam Langley
c644b5ee10 Bug 1420763 - encode webauthn keys as a COSE key; r=keeler
webauthn says[1] that public keys are encoded as COSE keys.  I find the COSE
RFC quite circuitous in many respects and so any reviews should check whether
they agree with my understanding of what should be in a COSE key.

The webauthn spec says that the key:

    “MUST contain the "alg" parameter and MUST NOT contain
     any other optional parameters.”

I don't believe that any of the parameters included are optional but, again, I
don't think the RFC is completely clear.

[1] https://www.w3.org/TR/webauthn/#sec-attested-credential-data

MozReview-Commit-ID: 2023mW3yVWU

--HG--
extra : rebase_source : 21d84d67f19d1885b73473a4d77d15f6c4cd80c2
2018-01-04 14:05:14 -07:00
Coroiu Cristina
4eaabc3225 Backed out 1 changesets (bug 1420763) for failing dom/webauthn/tests/test_webauthn_loopback.html r=backout on a CLOSED TREE
Backed out changeset cd99a1f959ad (bug 1420763)
2018-01-05 22:11:26 +02:00
Adam Langley
de184adf52 Bug 1420763 - encode webauthn keys as a COSE key; r=keeler
webauthn says[1] that public keys are encoded as COSE keys.  I find the COSE
RFC quite circuitous in many respects and so any reviews should check whether
they agree with my understanding of what should be in a COSE key.

The webauthn spec says that the key:

    “MUST contain the "alg" parameter and MUST NOT contain
     any other optional parameters.”

I don't believe that any of the parameters included are optional but, again, I
don't think the RFC is completely clear.

[1] https://www.w3.org/TR/webauthn/#sec-attested-credential-data

MozReview-Commit-ID: 2023mW3yVWU

--HG--
extra : rebase_source : 2cc9df48ed1ba9f940f57a3148ec881c1b0630df
2018-01-04 14:05:14 -07:00
Adam Langley
e21203ee93 Bug 1420760 - Order webauthn CBOR map keys. r=jcj
MozReview-Commit-ID: 6BsiL45dxa3
2017-12-31 15:37:27 -08:00
Tim Taubert
43288c7d24 Bug 1407093 - Web Authentication - WD-07 updates for user handles r=jcj,smaug
Reviewers: jcj, smaug

Reviewed By: jcj, smaug

Bug #: 1407093

Differential Revision: https://phabricator.services.mozilla.com/D328
2017-12-13 11:15:16 +01:00
Tim Taubert
b5c19b9f90 Bug 1396907 - Abstract a BaseAuthManager for dom/u2f and dom/webauthn r=jcj
Summary: We can probably abstract more stuff in the future, but this seems like a good start.

Reviewers: jcj

Reviewed By: jcj

Bug #: 1396907

Differential Revision: https://phabricator.services.mozilla.com/D323
2017-12-06 18:41:58 +01:00
Tim Taubert
a3256fcae8 Bug 1421616 - Have one WebAuthnManager instance per CredentialsContainer r=jcj
Summary:
We currently have a single WebAuthnManager instance per process that's shared
between all CredentialContainers. That way the nsPIDOMWindowInner parent has
to be tracked by the transaction, as multiple containers could kick off
requests simultaneously.

This patch lets us we have one WebAuthnManager instance per each
CredentialsContainer and thus each nsPIDOMWindowInner. This matches the current
U2F implementation where there is one instance per parent window too.

This somewhat simplifies the communication diagram (at least in my head), as
each U2F/WebAuthnManager instance also has their own TransactionChild/Parent
pair for IPC protocol communication. The manager and child/parent pair are
destroyed when the window is.

Reviewers: jcj

Reviewed By: jcj

Bug #: 1421616

Differential Revision: https://phabricator.services.mozilla.com/D305
2017-12-05 19:05:06 +01:00
Tim Taubert
587ed9ddc7 Backed out changeset bb739695f566 (bug 1421616) 2017-12-05 19:24:22 +01:00
Tim Taubert
a0935f0ff1 Bug 1421616 - Have one WebAuthnManager instance per CredentialsContainer r=jcj
Summary:
We currently have a single WebAuthnManager instance per process that's shared
between all CredentialContainers. That way the nsPIDOMWindowInner parent has
to be tracked by the transaction, as multiple containers could kick off
requests simultaneously.

This patch lets us we have one WebAuthnManager instance per each
CredentialsContainer and thus each nsPIDOMWindowInner. This matches the current
U2F implementation where there is one instance per parent window too.

This somewhat simplifies the communication diagram (at least in my head), as
each U2F/WebAuthnManager instance also has their own TransactionChild/Parent
pair for IPC protocol communication. The manager and child/parent pair are
destroyed when the window is.

Reviewers: jcj

Reviewed By: jcj

Bug #: 1421616

Differential Revision: https://phabricator.services.mozilla.com/D305
2017-12-05 19:05:06 +01:00
Tim Taubert
c5eda6e272 Bug 1406462 - Web Authentication - Add support for authenticator selection criteria and attachment types r=jcj,smaug
Reviewers: jcj, smaug

Reviewed By: jcj, smaug

Bug #: 1406462

Differential Revision: https://phabricator.services.mozilla.com/D278
2017-11-29 13:58:33 +01:00
Tim Taubert
ed40d66fa6 Bug 1419907 - [u2f-hid-rs] Combine platform managers in a single state machine r=jcj
Now that all the platform managers basically have the same state machine code,
we should combine those, and not repeat ourselves.

Review: https://github.com/jcjones/u2f-hid-rs/pull/59

ed0728d259
2017-11-22 22:12:06 +01:00
Tim Taubert
1a3663cd99 Bug 1419685 - [u2f-hid-rs] Implement per-device threads on Windows, remove KeyHandleMatcher r=jcj
This patch rewrites the Windows backend to have one thread per device.
As a bonus we get to remove the KeyHandleMatcher.

Review: https://github.com/jcjones/u2f-hid-rs/pull/57

296f6707b3
2017-11-22 10:13:49 +01:00
Tim Taubert
2f4733f069 Bug 1419070 - [u2f-hid-rs] Implement per-device threads on Linux, don't use KeyHandleMatcher r=jcj
This patch rewrites the Linux backend to have a structure similar to the macOS
one [1]. We'll have one thread per device, which means that a device that is
stuck or unresponsive won't break other devices.

[1] https://github.com/jcjones/u2f-hid-rs/pull/52

Review: https://github.com/jcjones/u2f-hid-rs/pull/56

7d9f31a8a2
2017-11-20 18:25:54 +01:00
Tim Taubert
e3b5379696 Bug 1418242 - [u2f-hid-rs] Let stubs fail, instead of running until cancellation r=jcj
1b1d79e653
2017-11-16 21:22:04 +01:00
Tim Taubert
b7e7434f37 Bug 1418018 - [u2f-hid-rs] Use CFRetain() to ensure the CFRunLoop! is kept alive as long as we need it r=jcj
c02ac553ca
ceede2fd8e
2017-11-16 21:26:18 +01:00
Tim Taubert
12a6719462 Bug 1418234 - [u2f-hid-rs] Small cleanup in macos::Transaction::new() r=me
ef4332519a
2017-11-15 04:55:41 +01:00
Tim Taubert
73cfd2472a Bug 1415675 - Web Authentication - Support AbortSignal types r=jcj,smaug
Summary:
This patch adds support for aborting WebAuthn requests via AbortSignals.

https://w3c.github.io/webauthn/#abortoperation
https://w3c.github.io/webauthn/#sample-aborting
https://dom.spec.whatwg.org/#abortcontroller-api-integration

It also adds a variety of request abortion/cancellation tests.

To test request cancellation we can use USB tokens as those requests will
never complete without a token and/or user interaction. A bonus here is that
we'll have a little coverage for u2f-hid-rs.

Reviewers: jcj, smaug

Reviewed By: jcj, smaug

Bug #: 1415675

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

--HG--
extra : amend_source : bd779d5c4c6a11dd8ce34c0cc86675825b799031
2017-11-17 09:44:50 +01:00
Tim Taubert
fdbcf7df8e Bug 1417433 - Remove unused U2FSoftTokenManager::IsCompatibleVersion() r=jcj
Summary:
This check was replaced a while ago, by [1]

[1] https://searchfox.org/mozilla-central/search?q=kRequiredU2FVersion

Reviewers: jcj

Reviewed By: jcj

Bug #: 1417433

Differential Revision: https://phabricator.services.mozilla.com/D246
2017-11-16 10:45:22 +01:00
Tim Taubert
b350f42d65 Bug 1398268 - [u2f-hid-rs] Rewrite macOS IOHIDManager communication and state machine r=jcj
Review: https://github.com/jcjones/u2f-hid-rs/pull/52
2017-11-14 11:39:29 +01:00
Tim Taubert
ec80cf873c Bug 1406468 - Web Authentication - Implement isUserVerifyingPlatformAuthenticatorAvailable() method r=jcj,smaug
Summary:
We currently implement no platform authenticators, so this would always
resolve to false. For those cases, the spec recommends a resolve timeout
on the order of 10 minutes to avoid fingerprinting.

A simple solution is thus to never resolve the promise, otherwise we'd
have to track every single call to this method along with a promise
and timer to resolve it after exactly X minutes.

A Relying Party has to deal with a non-response in a timely fashion, so
we can keep this as-is (and not resolve) even when we support platform
authenticators but they're not available, or a user rejects a website's
request to use them.

Reviewers: jcj, smaug

Reviewed By: jcj, smaug

Bug #: 1406468

Differential Revision: https://phabricator.services.mozilla.com/D217
2017-11-14 11:44:46 +01:00
Tim Taubert
1d2e8ed150 Bug 1412408 - Fix content process leak of U2FTransactionChild instances r=jcj
Summary:
This patch fixes the reported leak of U2FTransactionChild instances in the
content process by introducing a WebAuthnTransactionChildBase class that both
WebAuthnTransactionChild and U2FTransactionChild inherit from.

This base class is responsible for proper refcounting. In
BackgroundChildImpl::DeallocPWebAuthnTransactionChild() we currently always
cast to WebAuthnTransactionChild, that will work only for the WebAuthn API. We
can now cast to WebAuthnTransactionChildBase to make this work for U2F as well.

Reviewers: jcj

Reviewed By: jcj

Bug #: 1412408

Differential Revision: https://phabricator.services.mozilla.com/D179
2017-11-02 12:18:19 +01:00
Tim Taubert
319a39de9f Bug 1413598 - Pull in latest changes from u2f-hid-rs git repository r=jcj
Reviewers: jcj

Reviewed By: jcj

Bug #: 1413598

Differential Revision: https://phabricator.services.mozilla.com/D181
2017-11-02 12:18:07 +01:00
Andrew McCreight
298aa82710 Bug 1412125, part 2 - Fix dom/ mode lines. r=qdot
This was automatically generated by the script modeline.py.

MozReview-Commit-ID: BgulzkGteAL

--HG--
extra : rebase_source : a4b9d16a4c06c4e85d7d85f485221b1e4ebdfede
2017-10-26 15:08:41 -07:00