Crates.io | authenticator |
lib.rs | authenticator |
version | 0.4.1 |
source | src |
created_at | 2019-05-21 17:53:09.948538 |
updated_at | 2024-09-25 22:59:07.051713 |
description | Library for interacting with CTAP1/2 security keys for Web Authentication. Used by Firefox. |
homepage | |
repository | https://github.com/mozilla/authenticator-rs/ |
max_upload_size | |
id | 135913 |
size | 1,077,694 |
This is a cross-platform library for interacting with Security Key-type devices via Rust.
ctap2
branch.This library currently focuses on USB security keys, but is expected to be extended to support additional transports.
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.
There are some tests of the cross-platform runloop logic and the protocol decoder:
cargo test
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