Skip to content
프로젝트

소개

Rust library to interact with Security Keys, used by Firefox

보안 및 개인정보 보호

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
+1
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

A Rust library for interacting with CTAP1/CTAP2 Security Keys

Build and test Maturity Level

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

  • Supported Platforms: FreeBSD, Linux, macOS[^1], NetBSD, OpenBSD, and Windows[^2].
  • Supported Transports: USB HID.
  • Supported Protocols: FIDO CTAP1 (U2F), CTAP 2.0, CTAP 2.1-PRE, CTAP 2.1.

This library is primarily intended for use by Firefox on platforms that do not provide WebAuthn APIs (as there are on Android, iOS, macOS and Windows). It implements a subset of the CTAP protocol that is useful for a web browser.

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

[^1]: macOS has its own platform WebAuthn API (which also supports iCloud Keychain), but still allows direct, transport level communication with authenticators.

[^2]: Windows 10 v1903 and later block direct, transport level access to authenticators to applications not running as Administrator, breaking this library for most applications. Applications will need to use the platform APIs instead.

Usage

Proper usage should be to call into this library from something else - e.g., Firefox.

The ctap2 example will register and sign a non-discoverable credential with a USB CTAP1 or CTAP2 authenticator, in a similar manner to a web browser that supports the WebAuthn API:

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

There are more examples in the examples directory.

The RUST_LOG environment variable controls logging.

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

관련 프로젝트 살펴보기

불러오는 중…