From f5a5fa4f81ce0eb5b85377b048e2e69acefd32d1 Mon Sep 17 00:00:00 2001 From: Jordan Hand Date: Fri, 8 Dec 2023 16:37:56 -0800 Subject: [PATCH] Fix simulator profile selection 1. Fix Cargo.toml files to support building the simulator with different profiles 2. Update CI to test simulator with both profiles. --- ci.sh | 8 ++++---- dpe/Cargo.toml | 6 +++--- platform/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ci.sh b/ci.sh index f93eb771..694a9c24 100755 --- a/ci.sh +++ b/ci.sh @@ -10,19 +10,19 @@ function build_rust_targets() { cargo build --release --manifest-path crypto/Cargo.toml --no-default-features cargo build --release --manifest-path platform/Cargo.toml --features=$profile --no-default-features cargo build --release --manifest-path dpe/Cargo.toml --features=$profile --no-default-features - cargo build --release --manifest-path simulator/Cargo.toml #--features=$profile --no-default-features + cargo build --release --manifest-path simulator/Cargo.toml --features=$profile --no-default-features cargo build --release --manifest-path tools/Cargo.toml --features=$profile --no-default-features cargo build --manifest-path crypto/Cargo.toml --no-default-features cargo build --manifest-path platform/Cargo.toml --features=$profile --no-default-features cargo build --manifest-path dpe/Cargo.toml --features=$profile --no-default-features - cargo build --manifest-path simulator/Cargo.toml #--features=$profile + cargo build --manifest-path simulator/Cargo.toml --features=$profile --no-default-features cargo build --manifest-path tools/Cargo.toml --features=$profile --no-default-features cargo clippy --manifest-path crypto/Cargo.toml --no-default-features -- --deny=warnings cargo clippy --manifest-path platform/Cargo.toml --features=$profile --no-default-features -- --deny=warnings cargo clippy --manifest-path dpe/Cargo.toml --features=$profile --no-default-features -- --deny=warnings - cargo clippy --manifest-path simulator/Cargo.toml -- --deny=warnings #--features=$profile --no-default-features + cargo clippy --manifest-path simulator/Cargo.toml --features=$profile --no-default-features -- --deny=warnings cargo clippy --manifest-path tools/Cargo.toml --features=$profile --no-default-features -- --deny=warnings } @@ -47,7 +47,7 @@ function test_rust_targets() { cargo test --manifest-path platform/Cargo.toml --features=$profile --no-default-features cargo test --manifest-path crypto/Cargo.toml --no-default-features cargo test --manifest-path dpe/Cargo.toml --features=$profile --no-default-features - cargo test --manifest-path simulator/Cargo.toml #--features=$profile --no-default-features + cargo test --manifest-path simulator/Cargo.toml --features=$profile --no-default-features } # TODO: Support building the simulator for different profiles diff --git a/dpe/Cargo.toml b/dpe/Cargo.toml index 0bdd7e37..7be2e6ec 100644 --- a/dpe/Cargo.toml +++ b/dpe/Cargo.toml @@ -7,8 +7,8 @@ edition = "2021" [features] default = ["dpe_profile_p256_sha256"] -dpe_profile_p256_sha256 = [] -dpe_profile_p384_sha384 = [] +dpe_profile_p256_sha256 = ["platform/dpe_profile_p256_sha256"] +dpe_profile_p384_sha384 = ["platform/dpe_profile_p384_sha384"] [dependencies] bitflags = "2.4.0" @@ -24,7 +24,7 @@ asn1 = "0.13.0" openssl = "0.10.57" x509-parser = "0.15.1" crypto = {path = "../crypto", features = ["deterministic_rand", "openssl"]} -platform = {path = "../platform", features = ["openssl"]} +platform = {path = "../platform", default-features = false, features = ["openssl"]} cms = "0.2.2" der = "0.7.8" spki = "0.7.2" diff --git a/platform/Cargo.toml b/platform/Cargo.toml index 55bed3ec..ad98fd62 100644 --- a/platform/Cargo.toml +++ b/platform/Cargo.toml @@ -6,8 +6,8 @@ version = "0.1.0" edition = "2021" [features] -openssl = ["dep:openssl"] default = ["dpe_profile_p256_sha256"] +openssl = ["dep:openssl"] dpe_profile_p256_sha256 = [] dpe_profile_p384_sha384 = []