gecko-dev/third_party/rust/authenticator
Chun-Min Chang 2e5d3014c7 Bug 1681811 - Update mp4parse-rust to 3d9efdc r=jbauman
Import the improvements made in mp4parse-rust repo. The changes would
save some redundant copy when calling avif related APIs and provide the
ability to get the alpha data of the parsed avif image.

Differential Revision: https://phabricator.services.mozilla.com/D98950
2020-12-14 22:31:07 +00:00
..
examples Bug 1666701 - Upgrade Authenticator-rs to v0.3.1 r=kjacobs,keeler 2020-10-07 19:14:34 +00:00
src Bug 1666701 - Upgrade Authenticator-rs to v0.3.1 r=kjacobs,keeler 2020-10-07 19:14:34 +00:00
testing Bug 1681811 - Update mp4parse-rust to 3d9efdc r=jbauman 2020-12-14 22:31:07 +00:00
webdriver-tools Bug 1666701 - Upgrade Authenticator-rs to v0.3.1 r=kjacobs,keeler 2020-10-07 19:14:34 +00:00
.cargo-checksum.json Bug 1666701 - Upgrade Authenticator-rs to v0.3.1 r=kjacobs,keeler 2020-10-07 19:14:34 +00:00
Cargo.lock Bug 1666701 - Upgrade Authenticator-rs to v0.3.1 r=kjacobs,keeler 2020-10-07 19:14:34 +00:00
Cargo.toml Bug 1666701 - Upgrade Authenticator-rs to v0.3.1 r=kjacobs,keeler 2020-10-07 19:14:34 +00:00
Cross.toml Bug 1664298 - Upgrade authenticator-rs to v0.3.0 r=kjacobs 2020-09-10 23:49:02 +00:00
LICENSE
README.md Bug 1664298 - Upgrade authenticator-rs to v0.3.0 r=kjacobs 2020-09-10 23:49:02 +00:00
build.rs
rustfmt.toml Bug 1666701 - Upgrade Authenticator-rs to v0.3.1 r=kjacobs,keeler 2020-10-07 19:14:34 +00:00

README.md

A Rust library for interacting with CTAP1/CTAP2 Security Keys

Build Status Maturity Level

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

  • Supported Platforms: Windows, Linux, FreeBSD, NetBSD, OpenBSD, and macOS.
  • Supported Transports: USB HID.
  • Supported Protocols: FIDO U2F over USB. CTAP2 support is forthcoming, with work being done in the unstable ctap2 branch.

This library currently focuses on USB security keys, but is expected to be extended to support additional 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 cargo-fuzz

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