Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
437ff5f
Correct build errors
szszszsz Dec 15, 2021
c9c70c3
Make the Credential ID shorter to work with some services
szszszsz Jan 8, 2022
5862c89
Merge branch 'sz-smaller-keyhandle-length'
szszszsz Jan 15, 2022
3a33294
Skip user presence check directly after boot
robin-nitrokey Jul 5, 2022
184e667
Return error if credential ID is too long
robin-nitrokey Aug 1, 2022
fc6d866
Merge branch 'solokeys/main'
robin-nitrokey Aug 3, 2022
b0408cb
Merge pull request #3 from Nitrokey/skip-up-timeout
robin-nitrokey Aug 3, 2022
4022d6c
Merge pull request #4 from robin-nitrokey/overlong-credential-id
robin-nitrokey Aug 3, 2022
a040871
Run cargo fmt
sosthene-nitrokey Mar 16, 2023
f0fd645
Fix clippy warnings
sosthene-nitrokey Mar 16, 2023
61763a9
Remove associated data in wrapping of keys
sosthene-nitrokey Mar 16, 2023
7da201a
Merge pull request #10 from Nitrokey/nitrokey-ad
sosthene-nitrokey Apr 17, 2023
5669a09
Merge remote-tracking branch 'solokeys/main'
robin-nitrokey Apr 17, 2023
1d0b4b5
Bump trussed
robin-nitrokey Feb 8, 2023
d47a7c1
Merge pull request #13 from Nitrokey/update-trussed
robin-nitrokey Apr 24, 2023
9282539
Make maximum resident credential count configurable
robin-nitrokey Mar 29, 2023
7f6a093
Merge pull request #12 from Nitrokey/max-credential-count
robin-nitrokey Apr 25, 2023
db14bcf
Allow empty RP dirs in get_creds_metadata
robin-nitrokey Apr 28, 2023
708d5f7
Clean up empty RP dirs if key store is full
robin-nitrokey Apr 28, 2023
857899b
Merge pull request #14 from Nitrokey/overwrite-resident
robin-nitrokey May 2, 2023
76d3d88
Adapt to interrupt mechanism
sosthene-nitrokey May 23, 2023
0d2ddcf
Use published ref-swap
sosthene-nitrokey May 31, 2023
887c751
Bump deps
sosthene-nitrokey Jun 6, 2023
26c34a8
Use merged PRs
sosthene-nitrokey Jun 20, 2023
c471c81
Merge pull request #15 from Nitrokey/interrupt
sosthene-nitrokey Jun 20, 2023
8e93bc9
Set makeCredUvNotRqd in CTAP options
robin-nitrokey Jun 28, 2023
50589f4
Merge pull request #16 from robin-nitrokey/make-cred-uv-not-rqd-nk
robin-nitrokey Jun 28, 2023
695bf3e
Reject RK option in get_assertion
robin-nitrokey Jul 6, 2023
08c21a2
Allow three instead of two PIN retries per boot
robin-nitrokey Jun 29, 2023
2ef8446
Ignore key parameters with unsupported type
robin-nitrokey Jul 5, 2023
e4962d5
Ignore user data with empty ID in get_assertion
robin-nitrokey Jul 6, 2023
21f24de
Update ctap-types
robin-nitrokey Jul 7, 2023
7cb4edc
Update changelog and fix formatting
robin-nitrokey Jul 10, 2023
ca50a48
Add log messages for requests, responses and errors
robin-nitrokey Jul 26, 2023
5099f80
Revert "Set makeCredUvNotRqd in CTAP options"
robin-nitrokey Jul 26, 2023
0e3e565
Update ctap types
sosthene-nitrokey Aug 2, 2023
82a85dc
Use updated CTAP types with zero-copy deserialization using much less…
sosthene-nitrokey Aug 2, 2023
2326098
Merge pull request #36 from Nitrokey/fix-many-credentials-parameters
sosthene-nitrokey Sep 5, 2023
0a32941
Merge pull request #37 from Nitrokey/use-refs
sosthene-nitrokey Oct 2, 2023
d318c11
Reduce ID length for new credentials
robin-nitrokey Jul 10, 2023
2f49017
Update ctap-types
robin-nitrokey Oct 27, 2023
288fc03
Update apdu-dispatch
sosthene-nitrokey Nov 8, 2023
bb6c07c
Update changelog
sosthene-nitrokey Nov 8, 2023
f4cf88a
Merge pull request #40 from Nitrokey/apdu-dispatch-020
sosthene-nitrokey Nov 8, 2023
6800f49
Update ctap-types
robin-nitrokey Nov 20, 2023
71d14ff
Add largeBlobKey support to get_info
robin-nitrokey Nov 20, 2023
c43da04
Add largeBlobKey support to make_credential
robin-nitrokey Nov 20, 2023
48d66c0
Add largeBlobKey support to get_assertion
robin-nitrokey Nov 20, 2023
f3128f8
Implement largeBlobs command
robin-nitrokey Nov 20, 2023
aa9bb35
Add largeBlobKey to credential management
robin-nitrokey Nov 20, 2023
019a5d1
Add largeBlobKey to stripped credential
robin-nitrokey Nov 21, 2023
a4fff2f
Merge pull request #41 from Nitrokey/large-blobs
robin-nitrokey Nov 28, 2023
c3ef712
Use streaming API for large blobs
robin-nitrokey Nov 22, 2023
162ac6a
Merge pull request #42 from Nitrokey/large-blobs-chunked
robin-nitrokey Nov 29, 2023
c758c95
Fix field order in CredentialData
robin-nitrokey Dec 5, 2023
8c26ab3
Merge pull request #43 from Nitrokey/debug
robin-nitrokey Dec 6, 2023
b212b20
Update ctap-types
robin-nitrokey Dec 6, 2023
0a76fd4
Remove unused interchange dependency
sosthene-nitrokey Dec 7, 2023
9213a57
Merge pull request #46 from Nitrokey/udeps
sosthene-nitrokey Dec 8, 2023
b0c72d3
Add usbip example
sosthene-nitrokey Jan 26, 2024
a41f2e7
Merge pull request #47 from Nitrokey/virt
sosthene-nitrokey Feb 9, 2024
c9b8314
Fix clippy warnings
sosthene-nitrokey Feb 12, 2024
fb023c0
Merge pull request #56 from Nitrokey/clippy
sosthene-nitrokey Feb 13, 2024
6e9fa17
Fix error type for third invalid PIN entry
robin-nitrokey Feb 19, 2024
6d51ab7
Fix error type for cancelled user presence
robin-nitrokey Feb 19, 2024
47f6dc3
Extract PIN protocol implementation
robin-nitrokey Feb 27, 2024
2bbe43e
ctap2: Explicitly specify PIN protocol version
robin-nitrokey Feb 28, 2024
bf61fcd
ctap2: Implement PIN protocol version 2
robin-nitrokey Feb 28, 2024
87e3aef
ctap2: Implement permissions
robin-nitrokey Feb 29, 2024
079edd8
credential_management: Implement UpdateUserInformation
robin-nitrokey Feb 27, 2024
4e30470
Support CTAP 2.1
robin-nitrokey Mar 1, 2024
cdd67ae
Fix compilation with chunked feature
sosthene-nitrokey Mar 4, 2024
abad0f1
Merge pull request #68 from Nitrokey/chunked-fix
sosthene-nitrokey Mar 5, 2024
a11a874
Fix compilation of usbip example
sosthene-nitrokey Mar 5, 2024
78a2993
Merge pull request #69 from Nitrokey/usbip-compile
sosthene-nitrokey Mar 5, 2024
3db1f6f
Optimize key and PIN token generation
robin-nitrokey Mar 5, 2024
d55050a
Use trussed-chunked instead of trussed-staging
robin-nitrokey Mar 13, 2024
e1009f7
Improve option handling
robin-nitrokey Mar 20, 2024
32792e5
Add CI workflow
robin-nitrokey Mar 20, 2024
b55d7f6
Fix clippy lints
robin-nitrokey Mar 20, 2024
b8e9a12
Fix links in doc comment
robin-nitrokey Mar 20, 2024
7db98dd
Setup basic integration tests
robin-nitrokey Mar 8, 2024
db4a63d
Update trussed-hkdf to v0.2.0
robin-nitrokey Mar 25, 2024
f9f554c
Remove unused serde-cbor dependency
sosthene-nitrokey Mar 28, 2024
0085530
Fix clippy lints
sosthene-nitrokey Mar 28, 2024
acc8f8a
Merge pull request #77 from Nitrokey/remove-serde-cbor
sosthene-nitrokey Apr 12, 2024
8135721
tests: Use separate Channel instance for each test
robin-nitrokey May 21, 2024
aad05b9
tests: Handle CTAP2 errors
robin-nitrokey May 22, 2024
efed189
tests: Add Request trait and reply types
robin-nitrokey May 22, 2024
487b469
tests: Add basic logging
robin-nitrokey May 22, 2024
a2b0280
tests: Add basic tests for credential management
robin-nitrokey May 17, 2024
07ff03b
Accept scoped PIN tokens for EnumerateCredentialsBegin
robin-nitrokey May 23, 2024
79b05b5
Update ctap-types to 0.2.0
robin-nitrokey Jun 7, 2024
ca49325
tests: Setup attestation certificate and key
robin-nitrokey Jun 24, 2024
867db75
tests: Add ctap1 test cases
robin-nitrokey Jun 24, 2024
9ece796
tests: Add ctap1 upgrade test
robin-nitrokey Jun 24, 2024
4f52ab1
tests: Add get_assertion test
robin-nitrokey Jun 27, 2024
26890d8
Update ctap-types
robin-nitrokey Jun 27, 2024
df9f2de
Add ctap fuzz target
robin-nitrokey Jun 26, 2024
30e2b90
Implement third-party payment extension
robin-nitrokey Jun 21, 2024
f10cb70
Support attestation format preference in make_credential
robin-nitrokey Jun 21, 2024
3edba7b
Support attestation in get_assertion
robin-nitrokey Jun 22, 2024
8025fd9
Add attestation formats in get_info
robin-nitrokey Jun 22, 2024
09271b6
Add tests for attestation formats preference
robin-nitrokey Jun 26, 2024
e0654c1
pin_info_hash: use serde-byte-array
sosthene-nitrokey Jan 31, 2024
b18cae9
Update changelog
sosthene-nitrokey Feb 19, 2024
1bd6155
Apply suggestions
sosthene-nitrokey Jul 26, 2024
15b1c11
Fix fuzzing
sosthene-nitrokey Jul 26, 2024
fd143b1
Merge pull request #52 from Nitrokey/pin-hash-space-opt
sosthene-nitrokey Jul 26, 2024
1dc85d2
Serialize credential with fields names using only 1 bytes
sosthene-nitrokey Feb 12, 2024
44f0299
Update changelog
sosthene-nitrokey Feb 19, 2024
2d7855a
Add dynamic estimation of remaining credential space
sosthene-nitrokey Jul 25, 2024
b43596f
Fix credential count and add back hard limit
sosthene-nitrokey Jul 26, 2024
4f8e8a4
Remove unnecessary conversions
sosthene-nitrokey Jul 26, 2024
4f95f96
Fix compilation
sosthene-nitrokey Jul 31, 2024
741348f
Don't use estimate if block size is not available
sosthene-nitrokey Aug 1, 2024
e763a71
Apply suggestion
sosthene-nitrokey Aug 1, 2024
0f51cb7
Fix CI
sosthene-nitrokey Aug 1, 2024
2113600
Merge pull request #92 from Nitrokey/dynamic-limit
sosthene-nitrokey Aug 1, 2024
5ee16d1
Fix delog and use ctap-types 0.3.0
sosthene-nitrokey Aug 1, 2024
58a8ca1
Merge pull request #95 from Nitrokey/fix-delog
sosthene-nitrokey Aug 1, 2024
0fdecc9
Merge pull request #59 from Nitrokey/serde-name-one-char
sosthene-nitrokey Aug 1, 2024
125d38e
Fix clippy lints
robin-nitrokey Oct 2, 2024
25f99be
Update cbor-smol to 0.4.1
robin-nitrokey Oct 8, 2024
b34fa47
get_assertion: Skip attStmt unless requested
robin-nitrokey Oct 2, 2024
629a75f
Use apdu-app instead of apdu-dispatch
robin-nitrokey Oct 17, 2024
e9dfefd
tests: Add credential management tests
robin-nitrokey Oct 8, 2024
94cb2fb
Check credential limit in get_creds_metadata
robin-nitrokey Oct 24, 2024
28e0b05
Relax cbor-smol dependency
robin-nitrokey Oct 21, 2024
5b6ae97
Update littlefs2 to v0.5.0
robin-nitrokey Oct 14, 2024
c145a45
Remove cbor_serialize_message helper
robin-nitrokey Oct 24, 2024
86403fa
Add test case for credential ID stability
robin-nitrokey Dec 2, 2024
5c3aa0b
Keep old credential ID for existing credentials
robin-nitrokey Dec 2, 2024
63a1479
Remove LocalPublicKeyCredential*Entity structs
robin-nitrokey Dec 2, 2024
3095b8c
Replace EncryptedSerializedCredential with EncryptedData
robin-nitrokey Dec 12, 2024
0ac88d4
Fix clippy lints
robin-nitrokey Dec 17, 2024
d61a9ac
Update dependencies for trussed-core and ctaphid-app
robin-nitrokey Dec 19, 2024
c9512c7
Use released dependencies
robin-nitrokey Jan 8, 2025
d0885e1
Extend credential management tests
robin-nitrokey Nov 1, 2024
bb80cba
Fix compiler warnings
robin-nitrokey Jan 26, 2025
8347781
tests: Add helper trait and use exhaustive
robin-nitrokey Feb 18, 2025
10b0334
tests: Extend makeCredential tests
robin-nitrokey Feb 18, 2025
9e4cd65
tests: Extend getAssertion tests
robin-nitrokey Feb 18, 2025
add1ceb
tests: Extend getPinToken tests
robin-nitrokey Feb 18, 2025
726ce46
tests: Add getPinRetries tests
robin-nitrokey Feb 18, 2025
fd6fc9b
tests: Extend setPin tests
robin-nitrokey Feb 18, 2025
f3679b8
tests: Add changePin tests
robin-nitrokey Feb 18, 2025
dfcaf94
tests: Add getNextAssertion tests
robin-nitrokey Feb 18, 2025
2c8efe1
tests: Inspect filesystem after test runs
robin-nitrokey Feb 18, 2025
fed17e9
tests: Remove exhaustive dependency
robin-nitrokey Feb 19, 2025
6f260ea
tests: Set opt-level to 2
robin-nitrokey Feb 19, 2025
443eca1
Make credential: change the path of rks to `rp_id_hash.credential_id_…
sosthene-nitrokey Feb 2, 2024
e21d868
Remove references to totp signing algorithm
robin-nitrokey Apr 24, 2024
8b8a773
Reduce duplicated key generation and signing logic
robin-nitrokey Apr 24, 2024
ba17bc5
Replace core::iter::repeat(_).take(_) with core::iter::repeat_n(_, _)
robin-nitrokey May 6, 2025
91a5775
tests: Use hmac-secret extension in TestGetAssertion
robin-nitrokey May 7, 2025
7ff0518
hmac-secret: Forbid up=false
robin-nitrokey May 7, 2025
223bc11
Always reject uv = true in make_credential and get_assertion
robin-nitrokey May 7, 2025
4554cb8
make_credential: Support non-discoverable credentials without PIN
robin-nitrokey May 7, 2025
5ebb4a4
clientPin: Support getRetries without PIN protocol
robin-nitrokey May 12, 2025
cb30a2c
Remove usbip example
robin-nitrokey May 15, 2025
01a2653
Update trussed to use new virtual store
robin-nitrokey May 15, 2025
4b45601
Merge remote-tracking branch 'nitrokey/main'
robin-nitrokey Aug 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .cargo/config

This file was deleted.

79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
check-fuzz:
name: Check fuzz targets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Check fuzz targets
run: |
cargo check --manifest-path fuzz/Cargo.toml

build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- thumbv7em-none-eabi

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Rust toolchain
run: |
rustup show
rustup target add ${{ matrix.target }}

- name: Install build dependencies
run: >
sudo apt-get update -y -qq &&
sudo apt-get install -y -qq llvm libc6-dev-i386 libclang-dev

- uses: fiam/arm-none-eabi-gcc@v1
with:
release: "9-2020-q2"

- name: Build
run: cargo build --verbose --target ${{ matrix.target }}

- name: Check all targets without default features
run: cargo check --all-targets --no-default-features
if: matrix.target == 'x86_64-unknown-linux-gnu'

- name: Check all targets with default features
run: cargo check --all-targets
if: matrix.target == 'x86_64-unknown-linux-gnu'

- name: Check all features and targets
run: cargo check --all-features --all-targets
if: matrix.target == 'x86_64-unknown-linux-gnu'

- name: Run tests
run: cargo test --verbose --features dispatch
if: matrix.target == 'x86_64-unknown-linux-gnu'

- name: Check formatting
run: cargo fmt -- --check
if: matrix.target == 'x86_64-unknown-linux-gnu'

- name: Check clippy lints
run: cargo clippy --all-features --all-targets -- --deny warnings
if: matrix.target == 'x86_64-unknown-linux-gnu'

- name: Check documentation
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps
if: matrix.target == 'x86_64-unknown-linux-gnu'
32 changes: 30 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,53 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
- Set the `makeCredUvNotRqd` CTAP option to `true` to indicate that we support
makeCredential operations without user verification ([#26][])
- Ignore public key credential parameters with an unknown type, as required by
- Ignore public key credential paramters with an unknown type, as required by
the Webauthn spec ([#28][])
- Reject `rk` option in getAssertion ([#31][])
- Ignore user data with empty ID in getAssertion ([#32][])
- Allow three instead of two PIN retries per boot ([#35][])
- Add log messages for requests, responses and errors
- Add config option for setting a maximum number of resident credentials.
- Reduce ID length for new credentials ([#37][])
- Update apdu-dispatch and reject calls to `select` ([#40][])
- Implement the `largeBlobKey` extension and the `largeBlobs` command ([#38][])
- Fix error type for third invalid PIN entry ([#60][])
- Fix error type for cancelled user presence ([#61][])
- PIN protocol changes:
- Extract PIN protocol implementation into separate module ([#62][])
- Implement PIN protocol 2 ([#63][])
- Implement PIN token permissions ([#63][])
- Implement UpdateUserInformation subcommand for CredentialManagement
- Support CTAP 2.1
- Serialize PIN hash with `serde-bytes` ([#52][])
- Reduce the space taken by credential serialization ([#59][])
- Update dependencies:
- Replace `trussed` dependency with `trussed-core`
- Replace `ctaphid-dispatch` dependeny with `ctaphid-app`
- Remove the per-relying party directory to save space ([#55][])

[#26]: https://github.com/solokeys/fido-authenticator/issues/26
[#28]: https://github.com/solokeys/fido-authenticator/issues/28
[#31]: https://github.com/solokeys/fido-authenticator/issues/31
[#32]: https://github.com/solokeys/fido-authenticator/issues/32
[#35]: https://github.com/solokeys/fido-authenticator/issues/35
[#37]: https://github.com/solokeys/fido-authenticator/issues/37
[#40]: https://github.com/nitrokey/fido-authenticator/pull/40
[#38]: https://github.com/Nitrokey/fido-authenticator/issues/38
[#60]: https://github.com/Nitrokey/fido-authenticator/pull/60
[#61]: https://github.com/Nitrokey/fido-authenticator/pull/61
[#62]: https://github.com/Nitrokey/fido-authenticator/pull/62
[#63]: https://github.com/Nitrokey/fido-authenticator/pull/63
[#52]: https://github.com/Nitrokey/fido-authenticator/issues/52
[#59]: https://github.com/Nitrokey/fido-authenticator/issues/59
[#55]: https://github.com/Nitrokey/fido-authenticator/issues/55

## [0.1.1] - 2022-08-22
- Fix bug that treated U2F payloads as APDU over APDU in NFC transport @conorpp
- Add config option to skip UP when device was just booted,
as insertion is a kind of UP check @robin-nitrokey

## [Unreleased]
## [0.1.0] - 2022-03-17

- use 2021 edition
- use @szszszsz's credential ID shortening
Expand Down
67 changes: 54 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,80 @@ repository = "https://github.com/solokeys/fido-authenticator"
documentation = "https://docs.rs/fido-authenticator"
description = "FIDO authenticator Trussed app"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ctap-types = "0.1.0"
cbor-smol = { version = "0.5" }
ctap-types = { version = "0.4", features = ["get-info-full", "large-blobs", "third-party-payment"] }
cosey = "0.3"
delog = "0.1.0"
heapless = "0.7"
interchange = "0.2.0"
littlefs2 = "0.3.1"
heapless-bytes = "0.3"
littlefs2-core = "0.1"
serde = { version = "1.0", default-features = false }
serde_cbor = { version = "0.11.0", default-features = false }
serde_bytes = { version = "0.11.14", default-features = false }
serde-indexed = "0.1.0"
trussed = "0.1"
sha2 = { version = "0.10", default-features = false }
trussed-core = { version = "0.1.0", features = ["aes256-cbc", "certificate-client", "chacha8-poly1305", "crypto-client", "ed255", "filesystem-client", "hmac-sha256", "management-client", "p256", "sha256", "ui-client"] }
trussed-fs-info = "0.2.0"
trussed-hkdf = { version = "0.3.0" }
trussed-chunked = { version = "0.2.0", optional = true }

apdu-dispatch = { version = "0.1", optional = true }
ctaphid-dispatch = { version = "0.1", optional = true }
iso7816 = { version = "0.1", optional = true }
apdu-app = { version = "0.1", optional = true }
ctaphid-app = { version = "0.1.0-rc.1", optional = true }
iso7816 = { version = "0.1.2", optional = true }

[features]
default = []
dispatch = ["apdu-dispatch", "ctaphid-dispatch", "iso7816"]
apdu-dispatch = ["dep:apdu-app"]
ctaphid-dispatch = ["dep:ctaphid-app"]
disable-reset-time-window = []
enable-fido-pre = []

# enables support for a large-blob array longer than 1024 bytes
chunked = ["trussed-chunked"]

log-all = []
log-none = []
log-trace = []
log-info = []
log-debug = []
log-warn = []
log-error = []

[dev-dependencies]
# quickcheck = "1"
admin-app = { version = "0.1.0", features = ["migration-tests"] }
aes = "0.8.4"
cbc = { version = "0.1.2", features = ["alloc"] }
ciborium = { version = "0.2.2" }
ciborium-io = "0.2.2"
cipher = "0.4.4"
ctaphid = { version = "0.3.1", default-features = false }
ctaphid-dispatch = "0.3"
delog = { version = "0.1.6", features = ["std-log"] }
env_logger = "0.11.0"
hex-literal = "0.4.1"
hmac = "0.12.1"
interchange = "0.3.0"
itertools = "0.14.0"
littlefs2 = "0.6.0"
log = "0.4.21"
p256 = { version = "0.13.2", features = ["ecdh"] }
rand = "0.8.4"
rand_chacha = "0.3"
sha2 = "0.10"
serde_test = "1.0.176"
trussed = { version = "0.1", features = ["virt"] }
trussed-staging = { version = "0.3.0", features = ["chunked", "hkdf", "virt", "fs-info"] }
trussed-usbip = { version = "0.0.1", default-features = false, features = ["ctaphid"] }
usbd-ctaphid = "0.3.0"
x509-parser = "0.16.0"

[package.metadata.docs.rs]
features = ["dispatch"]

[patch.crates-io]
admin-app = { git = "https://github.com/Nitrokey/admin-app.git", tag = "v0.1.0-nitrokey.20" }
trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "024e0eca5fb7dbd2457831f7c7bffe4341e08775" }
trussed-staging = { git = "https://github.com/trussed-dev/trussed-staging.git", rev = "7922d67e9637a87e5625aaff9e5111f0d4ec0346" }
trussed-usbip = { git = "https://github.com/trussed-dev/pc-usbip-runner.git", rev = "504674453c9573a30aa2f155101df49eb2af1ba7" }

[profile.test]
opt-level = 2
4 changes: 4 additions & 0 deletions fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target
corpus
artifacts
coverage
28 changes: 28 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "fido-authenticator-fuzz"
version = "0.0.0"
publish = false
edition = "2021"

[package.metadata]
cargo-fuzz = true

[dependencies]
ctap-types = { version = "0.4", features = ["arbitrary"] }
libfuzzer-sys = "0.4"
trussed = { version = "0.1", features = ["clients-1", "certificate-client", "crypto-client", "filesystem-client", "management-client", "aes256-cbc", "ed255", "p256", "sha256"] }
trussed-staging = { version = "0.3.0", features = ["chunked", "hkdf", "virt", "fs-info"] }

[dependencies.fido-authenticator]
path = ".."

[[bin]]
name = "ctap"
path = "fuzz_targets/ctap.rs"
test = false
doc = false
bench = false

[patch.crates-io]
trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "6bba8fde36d05c0227769eb63345744e87d84b2b" }
trussed-staging = { git = "https://github.com/trussed-dev/trussed-staging.git", rev = "1e1ca03a3a62ea9b802f4070ea4bce002eeb4bec" }
34 changes: 34 additions & 0 deletions fuzz/fuzz_targets/ctap.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#![no_main]

use ctap_types::{authenticator::Request, ctap1::Authenticator as _, ctap2::Authenticator as _};
use fido_authenticator::{Authenticator, Config, Conforming};
use trussed_staging::virt;

use libfuzzer_sys::fuzz_target;

fuzz_target!(|requests: Vec<Request<'_>>| {
virt::with_ram_client("fido", |client| {
let mut authenticator = Authenticator::new(
client,
Conforming {},
Config {
max_msg_size: 0,
skip_up_timeout: None,
max_resident_credential_count: None,
large_blobs: None,
nfc_transport: false,
},
);

for request in requests {
match request {
Request::Ctap1(request) => {
authenticator.call_ctap1(&request).ok();
}
Request::Ctap2(request) => {
authenticator.call_ctap2(&request).ok();
}
}
}
});
});
4 changes: 3 additions & 1 deletion src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
//! Constants.

use trussed::types::{CertId, KeyId};
use trussed_core::types::{CertId, KeyId};

pub const FIDO2_UP_TIMEOUT: u32 = 30_000;
pub const U2F_UP_TIMEOUT: u32 = 250;

pub const ATTESTATION_CERT_ID: CertId = CertId::from_special(0);
pub const ATTESTATION_KEY_ID: KeyId = KeyId::from_special(0);

pub const MAX_RESIDENT_CREDENTIALS_GUESSTIMATE: u32 = 100;
Loading
Loading