-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FreeBSD Support #62
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to me, but I would like @ttaubert to look closer at the dependency change to the sha2 crate, and the hidproto.rs refactor.
|
Thanks Greg!
We forgot to uplift a change from Firefox to the repository here. This should be fixed now.
Those are good changes. I pulled them out so we can fix our Travis CI bustage and concentrate on the FreeBSD support code here. https://phabricator.services.mozilla.com/D1115
AFAICT, this doesn't seem to a problem with udev. It definitely wouldn't hurt to sleep for a few hundred ms and try again though.
That seems worrisome. Did you try to find out where exactly the statemachine is hanging? It would be good to have solid support on FreeBSD, if we claim to :) |
Looks like in the I think Firefox is more reliable than the example because Firefox doesn't do operations one after another without delay. But it's weird that a delay would be required. A similar patch for Chromium does not do any additional delays and it works fine... |
|
Since we pulled parts of this in already, this patch now needs conflicts resolved. I'm downloading a FreeBSD image currently, but I don't know when I'll get around to testing it. I'll try to do so soon. |
Make the protocol parts independent of Linux code, in preparation for adding FreeBSD support.
Tested with a YubiKey 4.
|
Rebased. (Kinda weird that you're pulling them through mozilla first and not the other way around, and git author info is lost...) So, if you want to test (without running as root):
|
|
I am sorry about that, @myfreeweb. Tim and I decided during development to make mozilla-central the authoritative repository until we fix the vendoring issues and can import this as a crate [Bug 1395293]. I should have some breathing room finally to try again at doing that. And to move this repo to |
| } | ||
| } | ||
|
|
||
| #[derive(Debug)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note for myself in the future: We pulled a lot of #[derive(Debug)]s out to shrink the compiled library, but I think that was unneeded since we moved to more recent versions of rust.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Thank you, @myfreeweb and @jbeich so much! Landing this in Firefox... |
Upstream PR: mozilla/authenticator-rs#62 * Extract hidproto module from linux::hidraw Make the protocol parts independent of Linux code, in preparation for adding FreeBSD support. * Add FreeBSD (uhid + devd) support Tested with a YubiKey 4. Differential Revision: https://phabricator.services.mozilla.com/D1636
Summary: Upstream PR: mozilla/authenticator-rs#62 * Extract hidproto module from linux::hidraw Make the protocol parts independent of Linux code, in preparation for adding FreeBSD support. * Add FreeBSD (uhid + devd) support Tested with a YubiKey 4. Tags: #secure-revision Bug #: 1468349 Differential Revision: https://phabricator.services.mozilla.com/D1636 MozReview-Commit-ID: 8NNWRgTEMn2 --HG-- extra : rebase_source : edf774f0a993a18b59b5f8aa10e0977d94ea1de8
Upstream PR: mozilla/authenticator-rs#62 * Extract hidproto module from linux::hidraw Make the protocol parts independent of Linux code, in preparation for adding FreeBSD support. * Add FreeBSD (uhid + devd) support Tested with a YubiKey 4. Differential Revision: https://phabricator.services.mozilla.com/D1636 UltraBlame original commit: 80190d88549cf49b79fea1d350e65d8828f33810
Summary: Upstream PR: mozilla/authenticator-rs#62 * Extract hidproto module from linux::hidraw Make the protocol parts independent of Linux code, in preparation for adding FreeBSD support. * Add FreeBSD (uhid + devd) support Tested with a YubiKey 4. Tags: #secure-revision Bug #: 1468349 Differential Revision: https://phabricator.services.mozilla.com/D1636 MozReview-Commit-ID: 8NNWRgTEMn2 UltraBlame original commit: 8ebf45b0854ace6848090c02d6c4935bc515fe0a
Upstream PR: mozilla/authenticator-rs#62 * Extract hidproto module from linux::hidraw Make the protocol parts independent of Linux code, in preparation for adding FreeBSD support. * Add FreeBSD (uhid + devd) support Tested with a YubiKey 4. Differential Revision: https://phabricator.services.mozilla.com/D1636 UltraBlame original commit: 80190d88549cf49b79fea1d350e65d8828f33810
Summary: Upstream PR: mozilla/authenticator-rs#62 * Extract hidproto module from linux::hidraw Make the protocol parts independent of Linux code, in preparation for adding FreeBSD support. * Add FreeBSD (uhid + devd) support Tested with a YubiKey 4. Tags: #secure-revision Bug #: 1468349 Differential Revision: https://phabricator.services.mozilla.com/D1636 MozReview-Commit-ID: 8NNWRgTEMn2 UltraBlame original commit: 8ebf45b0854ace6848090c02d6c4935bc515fe0a
Upstream PR: mozilla/authenticator-rs#62 * Extract hidproto module from linux::hidraw Make the protocol parts independent of Linux code, in preparation for adding FreeBSD support. * Add FreeBSD (uhid + devd) support Tested with a YubiKey 4. Differential Revision: https://phabricator.services.mozilla.com/D1636 UltraBlame original commit: 80190d88549cf49b79fea1d350e65d8828f33810
Summary: Upstream PR: mozilla/authenticator-rs#62 * Extract hidproto module from linux::hidraw Make the protocol parts independent of Linux code, in preparation for adding FreeBSD support. * Add FreeBSD (uhid + devd) support Tested with a YubiKey 4. Tags: #secure-revision Bug #: 1468349 Differential Revision: https://phabricator.services.mozilla.com/D1636 MozReview-Commit-ID: 8NNWRgTEMn2 UltraBlame original commit: 8ebf45b0854ace6848090c02d6c4935bc515fe0a
This PR adds support for FreeBSD (and makes it easier to add support for other BSDs in the future, especially DragonFly since it also uses
devd).uhidis pretty similar to Linuxhidraw, except for skipping the report id inwrite(and ioctls are different, of course). So the non-Linux-specific parts have been extracted intosrc/hidproto.rs.rust-cryptotosha2: I think rust-crypto failed the build for me. The monolithicrust-cryptocrate is deprecated anyway.env_loggerupdate: prompted bymach vendor rustin Firefox.The test example binary is not fully reliable for me (sometimes it hangs), but Firefox Nightly with this library seems more reliable: I've been able to complete WebAuthn and Yubico tests and authenticate on gitlab.com multiple times in the same session without any issues.
BTW, it would be nice to retry
Device::newmultiple times, because the notification might appear beforedevdrules give the user permission to access the token. (Doesudevon Linux not have that problem?)cc @jbeich