gecko-dev/dom/webauthn/u2f-hid-rs
Akshay Kumar aff7fc2c26 Bug 1508115 - Web Authentication - Support Windows Hello r=keeler,jcj,baku
This change adopts Windows Win32 WebAuthN APIs from https://github.com/Microsoft/webauthn

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

--HG--
extra : moz-landing-system : lando
2019-01-21 01:10:44 +00:00
..
examples Bug 1514247 - Upgrade u2f-hid-rs to 0.2.3 r=emilio,keeler 2018-12-14 19:40:03 +00:00
fuzz Bug 1400513 - u2f-hid-rs: fuzzers should use a deterministic cmd byte r=jcj 2017-09-17 20:07:32 +02:00
src Bug 1508115 - Web Authentication - Support Windows Hello r=keeler,jcj,baku 2019-01-21 01:10:44 +00:00
.clippy.toml Bug 1514247 - Upgrade u2f-hid-rs to 0.2.3 r=emilio,keeler 2018-12-14 19:40:03 +00:00
.gitignore Bug 1514247 - Upgrade u2f-hid-rs to 0.2.3 r=emilio,keeler 2018-12-14 19:40:03 +00:00
.travis.yml Bug 1514247 - Upgrade u2f-hid-rs to 0.2.3 r=emilio,keeler 2018-12-14 19:40:03 +00:00
Cargo.toml Bug 1514247 - Upgrade u2f-hid-rs to 0.2.3 r=emilio,keeler 2018-12-14 19:40:03 +00:00
LICENSE Bug 1404556 - Support libc::ioctl() call on musl libc 2017-10-04 16:53:17 +02:00
README.md Bug 1468349 - Web Authentication - Add FreeBSD Support r=jcj 2018-06-12 09:55:30 -07:00
rustfmt.toml

README.md

A Rust HID library for interacting with U2F Security Keys

Build Status Maturity Level

This is a cross-platform library for interacting with U2F Security Key-type devices via Rust.

  • Supported Platforms: Windows, Linux, FreeBSD, and macOS.
  • Supported HID Transports: USB.
  • Supported Protocols: FIDO U2F over USB.

This library currently focuses on U2F security keys, but is expected to be extended to support additional protocols and transports.

Usage

There's only a simple example function that tries to register and sign right now. It uses env_logger for logging, which you configure with the RUST_LOG environment variable:

cargo build --example main
RUST_LOG=debug cargo run --example main

Proper usage should be to call into this library from something else - e.g., Firefox. There are some C headers exposed for the purpose.

Tests

There are some tests of the cross-platform runloop logic and the protocol decoder:

cargo test

Fuzzing

There are fuzzers for the USB protocol reader, basically fuzzing inputs from the HID layer. There are not (yet) fuzzers for the C API used by callers (such as Gecko).

To fuzz, you will need cargo-fuzz (the latest version from GitHub) as well as Rust Nightly.

rustup install nightly
cargo install --git https://github.com/rust-fuzz/cargo-fuzz/

cargo +nightly fuzz run u2f_read -- -max_len=512
cargo +nightly fuzz run u2f_read_write -- -max_len=512