Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
129 changes: 111 additions & 18 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ memory-regions = { path = "components/memory-regions" }
# unreleased libraries
p256-cortex-m4 = { git = "https://github.com/ycrypto/p256-cortex-m4.git", rev = "cdb31e12594b4dc1f045b860a885fdc94d96aee2" }

# These carry the unreleased `usb-device-0-3` feature.
lpc55-hal = { git = "https://github.com/lpc55/lpc55-hal", rev = "ad0b163bba8b884409e7da012fade5edde0d0375" }
usbd-ccid = { git = "https://github.com/trussed-dev/usbd-ccid", rev = "9912b35c5d7ad0253a60219c1555084eab3844d7" }
usbd-ctaphid = { git = "https://github.com/trussed-dev/usbd-ctaphid", rev = "91ecf98c88b1a61276ebf3e77e65009bba3c4e17" }
trussed-usbip = { git = "https://github.com/trussed-dev/pc-usbip-runner", rev = "ecadf7fff837c148fbd30b9dafa8e3f512b0393d" }

# applications
admin-app = { git = "https://github.com/Nitrokey/admin-app.git", tag = "v0.1.0-nitrokey.22" }
opcard = { git = "https://github.com/Nitrokey/opcard-rs", tag = "v1.7.0" }
Expand Down
5 changes: 4 additions & 1 deletion components/apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ se05x = { version = "0.4", optional = true}
serde = { version = "1.0.180", default-features = false }
trussed = { workspace = true, features = ["crypto-client", "filesystem-client", "management-client", "serde-extensions", "ui-client"] }
trussed-core.workspace = true
trussed-usbip = { version = "=0.1.0-rc.1", default-features = false, features = ["ctaphid"], optional = true }
trussed-usbip = { version = "=0.1.0-rc.1", default-features = false, features = ["ctaphid", "usb-device-0-2"], optional = true }
usbd-ctaphid = { version = "0.4", optional = true }
utils = { path = "../utils" }
if_chain = "1.0.2"
Expand Down Expand Up @@ -68,6 +68,9 @@ opcard = ["dep:opcard", "backend-rsa", "backend-auth", "trussed/aes256-cbc", "tr
piv-authenticator = ["dep:piv-authenticator", "backend-rsa", "backend-auth", "trussed/aes256-cbc", "trussed/chacha8-poly1305", "trussed/ed255", "trussed/p256", "trussed/shared-secret", "trussed/tdes", "trussed/x255"]
se050 = ["dep:se05x", "trussed-se050-backend", "trussed-se050-manage", "admin-app/se050"]

# Build the USB classes against usb-device 0.3 instead of the default 0.2.
"usb-device-0-3" = ["usbd-ctaphid?/usb-device-0-3", "trussed-usbip?/usb-device-0-3"]

# backends
backend-auth = ["trussed-auth", "trussed-auth-backend"]
backend-rsa = ["trussed-rsa-alloc"]
Expand Down
26 changes: 23 additions & 3 deletions components/boards/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ ref-swap = "0.1.0"
spi-memory = "0.2.0"
trussed.workspace = true
trussed-core.workspace = true
usb-device = "0.2"
usbd-ccid = "0.4"
usbd-ctaphid = "0.4"
# Selects the usb-device version; see the `usb_device` alias in src/lib.rs.
usb-device-0-2 = { package = "usb-device", version = "0.2", optional = true }
usb-device-0-3 = { package = "usb-device", version = "0.3.2", optional = true }
usbd-ccid = { version = "0.4", default-features = false }
usbd-ctaphid = { version = "0.4", default-features = false }
utils = { path = "../utils" }

# soc-lpc55
Expand All @@ -38,6 +40,8 @@ systick-monotonic = { version = "1.0.0", optional = true }

# soc-nrf52
embedded-storage = { version = "0.3", optional = true }
# nrf52840-hal 0.15 re-exports nrf-usbd 0.1 (usb-device 0.2 only).
nrf-usbd = { version = "0.3", optional = true }
nrf52840-hal = { version = "0.15.1", optional = true }
nrf52840-pac = { version = "0.11", optional = true }

Expand All @@ -60,6 +64,22 @@ trussed-manage = "0.3.0"
littlefs2-core = { version = "0.1", features = ["debug-error"] }

[features]
# The bus and both class drivers must resolve to the same usb-device version.
default = ["usb-device-0-2"]
"usb-device-0-2" = [
"dep:usb-device-0-2",
"usbd-ccid/usb-device-0-2",
"usbd-ctaphid/usb-device-0-2",
"lpc55-hal?/usb-device-0-2",
]
"usb-device-0-3" = [
"dep:usb-device-0-3",
"usbd-ccid/usb-device-0-3",
"usbd-ctaphid/usb-device-0-3",
"lpc55-hal?/usb-device-0-3",
"dep:nrf-usbd",
]

board-nk3am = ["soc-nrf52", "lfs-backup", "se05x/embedded-hal-v0.2.7"]
board-nk3xn = ["soc-lpc55", "fm11nc08", "utils/storage", "se05x/embedded-hal-v0.2.7"]
board-nkpk = ["board-nk3am", "utils/storage"]
Expand Down
Loading