Skip to content

Commit

Permalink
Merge pull request #21 from Nitrokey/update-ctap-types
Browse files Browse the repository at this point in the history
Update ctap-types and fido-authenticator
  • Loading branch information
sosthene-nitrokey authored Aug 1, 2024
2 parents d6705ab + 21ff544 commit 5179795
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 16 deletions.
43 changes: 31 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ serde = { version = "1.0", default-features = false }
serde-indexed = "0.1.0"
serde_bytes = { version = "0.11.10", default-features = false, features=["alloc"] }
generic-array = "0.14.3"
ctap-types = "0.2"
ctap-types = "0.3"
ctaphid-dispatch = "0.1"
apdu-dispatch = "0.1"

Expand All @@ -42,7 +42,8 @@ delog = { version = "0.1.6", features = ["std-log"] }
fido-authenticator = {version = "0.1.1", features = ["dispatch", "log-all"]}
trussed-hkdf = { version = "0.2.0" }
trussed-manage = { version = "0.1.0" }
trussed-staging = { version = "0.3.0", features = ["chunked", "hkdf", "manage", "virt"] }
trussed-fs-info = { version = "0.1.0" }
trussed-staging = { version = "0.3.0", features = ["chunked", "hkdf", "manage", "virt", "fs-info"] }
trussed-usbip = { version = "0.0.1", features = ["ctaphid"], default-features = false }
admin-app = { version = "0.1", features = ["log-all"] }

Expand Down Expand Up @@ -76,6 +77,8 @@ inject-any-key = ["hmacsha256p256"]
# Support RSA
rsa = ["trussed-rsa-alloc"]

test-commands = []

log-all = []
log-none = []
log-info = []
Expand All @@ -97,7 +100,8 @@ ctaphid-dispatch = { git = "https://github.com/Nitrokey/ctaphid-dispatch", tag =

# forked
admin-app = { git = "https://github.com/Nitrokey/admin-app.git", tag = "v0.1.0-nitrokey.11" }
fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.16" }
fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.18" }
cbor-smol = { git = "https://github.com/Nitrokey/cbor-smol.git", tag = "v0.4.0-nitrokey.4"}

# unreleased upstream changes
apdu-dispatch = { git = "https://github.com/trussed-dev/apdu-dispatch.git", rev = "915fc237103fcecc29d0f0b73391f19abf6576de" }
Expand All @@ -107,12 +111,13 @@ trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "b548d379d
usbd-ctaphid = { git = "https://github.com/Nitrokey/usbd-ctaphid", tag = "v0.1.0-nitrokey.1" }

# unreleased crates
trussed-fs-info = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "fs-info-v0.1.0" }
trussed-auth = { git = "https://github.com/trussed-dev/trussed-auth", rev = "62235294bd63977bbb88eb01e7ac44b8010eb450" }
trussed-chunked = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "chunked-v0.1.0" }
trussed-hkdf = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "hkdf-v0.2.0" }
trussed-manage = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "manage-v0.1.0" }
trussed-rsa-alloc = { git = "https://github.com/trussed-dev/trussed-rsa-backend.git", tag = "v0.2.0" }
trussed-staging = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "v0.3.0" }
trussed-staging = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "v0.3.1" }
trussed-usbip = { git = "https://github.com/Nitrokey/pc-usbip-runner", tag = "v0.0.1-nitrokey.1" }

# Local development
Expand Down
18 changes: 18 additions & 0 deletions examples/usbip/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::path::{Path, PathBuf};
const LOCATION_FOR_SIMULATION: Location = Location::Internal;

mod dispatch {
use trussed_fs_info::FsInfoExtension;
use trussed_hkdf::HkdfExtension;
use trussed_manage::ManageExtension;
use trussed_staging::StagingBackend;
Expand Down Expand Up @@ -49,6 +50,7 @@ mod dispatch {
HmacShaP256,
Manage,
Hkdf,
FsInfo,
}

impl From<Extension> for u8 {
Expand All @@ -58,6 +60,7 @@ mod dispatch {
Extension::HmacShaP256 => 1,
Extension::Manage => 2,
Extension::Hkdf => 3,
Extension::FsInfo => 4,
}
}
}
Expand All @@ -71,6 +74,7 @@ mod dispatch {
1 => Ok(Extension::HmacShaP256),
2 => Ok(Extension::Manage),
3 => Ok(Extension::Hkdf),
4 => Ok(Extension::FsInfo),
_ => Err(Error::InternalError),
}
}
Expand Down Expand Up @@ -178,6 +182,15 @@ mod dispatch {
resources,
)
}
Extension::FsInfo => {
ExtensionImpl::<FsInfoExtension>::extension_request_serialized(
&mut self.staging,
&mut ctx.core,
&mut ctx.backends.staging,
request,
resources,
)
}
_ => Err(Error::RequestNotAvailable),
},
Backend::HmacShaP256 => match extension {
Expand Down Expand Up @@ -221,6 +234,11 @@ mod dispatch {

const ID: Self::Id = Self::Id::Hkdf;
}
impl ExtensionId<FsInfoExtension> for Dispatch {
type Id = Extension;

const ID: Self::Id = Self::Id::FsInfo;
}
}

#[cfg(feature = "ccid")]
Expand Down

0 comments on commit 5179795

Please sign in to comment.