Skip to content

Commit 33c26aa

Browse files
authored
Implement all commands of Ctap2 (#154)
* WIP: Add part MakeCredentials * Add test for (and do some fixes) for MakeCredential CTAP1 mapping * Adjust tests with RelyingParty and name-field * Fix serialization of MakeCredentialOptions (individually serialize members) * Temporarily parse credential_public_key just as a byte-vector, until COSE-crate is added and able to actually parse it * Add Option Unparsed to AttestationStatement, to currently skip parsing it (which would need a DER-parser) * Add commands GetAssertion and GetAssertionNext. Still missing tests. * WIP: Add clientpin command with all the crypto functionality commented out * Remove duplicate Pin-definition * MakeCredentials and GetAssertion now do not store Pin but PinAuth, which has to be calculated before hand * MakeCredentials: Remove pointless alias for HIDError * GetInfo: Fix wrong parsing of response. Forgot to strip away the status-byte * Make naming of CommandError variants consistent and remove redundant 'Parsing'-variant * Replace custom error with invalid_length (even though the usage is a bit weird) * Use From<CommandError>-trait of HIDError to avoid verbose map_err-calls, by using the shorter .into() Co-authored-by: Martin Sirringhaus <>
1 parent 3377167 commit 33c26aa

File tree

16 files changed

+3880
-20
lines changed

16 files changed

+3880
-20
lines changed

Cargo.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ maintenance = { status = "actively-developed" }
1515

1616
[features]
1717
binding-recompile = ["bindgen"]
18-
webdriver = ["base64", "bytes", "warp", "tokio", "serde_json"]
18+
webdriver = ["bytes", "warp", "tokio"]
1919

2020
[target.'cfg(target_os = "linux")'.dependencies]
2121
libudev = "^0.2"
@@ -48,14 +48,17 @@ bitflags = "1.0"
4848
tokio = { version = "0.2", optional = true, features = ["macros"] }
4949
warp = { version = "0.2.4", optional = true }
5050
serde = { version = "1.0", features = ["derive"] }
51+
serde_bytes = "0.11"
5152
serde_cbor = "0.11"
52-
serde_json = { version = "1.0", optional = true }
53+
serde_json = "1.0"
5354
bytes = { version = "0.5", optional = true, features = ["serde"] }
54-
base64 = { version = "^0.10", optional = true }
55+
base64 = "^0.10"
56+
nom = "^5.1"
57+
sha2 = "^0.8.0"
5558

5659
[dev-dependencies]
57-
sha2 = "^0.8.2"
5860
base64 = "^0.10"
5961
env_logger = "^0.6"
6062
getopts = "^0.2"
6163
assert_matches = "1.2"
64+
byteorder = "^1.3.2"

0 commit comments

Comments
 (0)