Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usbip runner build #583

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ build-usbip:
image: registry.git.nitrokey.com/nitrokey/nitrokey-3-firmware/nitrokey3:latest
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
- if: '$CI_PIPELINE_SOURCE == "push"'
tags:
- docker
stage: build
script:
- git describe --exact-match
- export VERSION=`git describe --exact-match`
- export VERSION=`git describe`
- if echo $VERSION | grep test ; then export FEATURES=test ; fi
- mkdir -p artifacts
- cargo build --release --manifest-path runners/usbip/Cargo.toml --features $FEATURES,
Expand Down
23 changes: 23 additions & 0 deletions components/apps/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,29 @@ const fn validate_mechanisms() {
if contains(trussed_se050_backend::MECHANISMS, mechanism) {
continue;
}
// The usbip runner does not have the mechanisms normally provided by the se050 backend.
// Until there is a backend implementing them in software, we ignore them and return an
// error at runtime.
#[cfg(feature = "trussed-usbip")]
if contains(
&[
Mechanism::BrainpoolP256R1,
Mechanism::BrainpoolP256R1Prehashed,
Mechanism::BrainpoolP384R1,
Mechanism::BrainpoolP384R1Prehashed,
Mechanism::BrainpoolP512R1,
Mechanism::BrainpoolP512R1Prehashed,
Mechanism::P384,
Mechanism::P384Prehashed,
Mechanism::P521,
Mechanism::P521Prehashed,
Mechanism::Secp256k1,
Mechanism::Secp256k1Prehashed,
],
mechanism,
) {
continue;
}

// This mechanism is not implemented by Trussed or any of the backends.
mechanism.panic();
Expand Down
2 changes: 1 addition & 1 deletion runners/usbip/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ log = { version = "0.4.14", default-features = false }
pretty_env_logger = "0.5.0"
rand_core = { version = "0.6.4", features = ["getrandom"] }
signal-hook = { version = "0.3.17", default-features = false }
trussed = { version = "0.1", features = ["clients-3"] }
trussed = { version = "0.1", default-features = false, features = ["clients-3"] }
trussed-usbip = { version = "0.0.1", default-features = false, features = ["ctaphid"] }
utils = { path = "../../components/utils", features = ["log-all"] }

Expand Down