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
9 changes: 7 additions & 2 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ der = { version = "0.7.10", default-features = false }
ecdsa = { version = "0.16", default-features = false }
ed25519-dalek = { version = "2.1", default-features = false }
env_logger = { version = "0.11.11", default-features = false }
flagset = "0.4.7"
getrandom = "0.4.3"
hex.version = "0.4"
hubpack = "0.1"
Expand All @@ -43,7 +44,8 @@ log = { version = "0.4.33", features = ["std"] }
p384 = { version = "0.13.1", default-features = false }
pem-rfc7468 = { version = "1.0.0", default-features = false }
pki-playground = { git = "https://github.com/oxidecomputer/pki-playground", rev = "98865b0f4716c52adcb6d940fdb8c3ab90ad409a" }
rats-corim.git = "https://github.com/oxidecomputer/rats-corim"
#rats-corim.git = "https://github.com/oxidecomputer/rats-corim"
rats-corim = { git = "https://github.com/flihp/rats-corim", rev = "215b184fbc8d0f09e8751346f1b16b061309ab44" }
ron = "0.8"
rpassword = "7.5.4"
rsa = "0.9.8"
Expand All @@ -53,7 +55,7 @@ serde-big-array = "0.5.1"
serde_json = { version = "1.0.150", features = ["std", "alloc"] }
serde_with = { version = "3.21.0", default-features = false }
serialport = { git = "https://github.com/jgallagher/serialport-rs", branch = "illumos-support" }
sha2 = "0.11.0"
sha2 = "0.10.9"
sha3 = { version = "0.10.8", default-features = false }
sled-agent-client = { git = "https://github.com/oxidecomputer/omicron", rev = "f8e9052b768e1fa9c3fc16ef033fcab9ede3b806" }
sled-agent-types-versions = { git = "https://github.com/oxidecomputer/omicron", rev = "f8e9052b768e1fa9c3fc16ef033fcab9ede3b806" }
Expand Down
7 changes: 6 additions & 1 deletion verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,24 @@ license = "MPL-2.0"
attest-data = { path = "../attest-data", features = ["std"] }
async-trait.workspace = true
const-oid.workspace = true
der.workspace = true
ed25519-dalek = { workspace = true, features = ["std"] }
helios-rot.path = "../helios-rot"
hex = { workspace = true }
hubpack.workspace = true
p384 = { workspace = true, default-features = true }
rats-corim.workspace = true
rsa = { workspace = true, features = ["sha2"] }
serde = { workspace = true, features = ["derive"] }
serde_with = { workspace = true, features = ["macros"] }
sha2.workspace = true
sha3.workspace = true
thiserror.workspace = true
x509-cert = { workspace = true, default-features = true }

[build-dependencies]
anyhow.workspace = true
attest-mock = { path = "../attest-mock", optional = true }
cfg-if.workspace = true
pki-playground = { workspace = true, optional = true }

Expand All @@ -30,4 +35,4 @@ attest-data = { path = "../attest-data", features = ["std", "testing"] }
dice-verifier = { path = "../verifier", features = ["unittest"] }

[features]
unittest = ["pki-playground"]
unittest = ["attest-mock", "pki-playground"]
22 changes: 21 additions & 1 deletion verifier/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,30 @@ use anyhow::Result;
cfg_if::cfg_if! {
if #[cfg(feature = "unittest")] {
use anyhow::{anyhow, Context};
use pki_playground::{config, OutputFileExistsBehavior};
use std::{env, path::PathBuf};
}
}

#[cfg(feature = "unittest")]
fn mock_data() -> Result<()> {
use attest_mock::{MockCorim, MockData};

// output directory where we put generated test inputs
let corim = MockCorim::load("test-corim.kdl")?;
let corim = corim.to_bytes()?;
let mut out =
PathBuf::from(env::var("OUT_DIR").context("Failed to get OUT_DIR")?);
out.push("test-corim.cbor");

Ok(std::fs::write(&out, &corim).with_context(|| {
format!("write mock measurement log to file: {}", out.display())
})?)
}

#[cfg(feature = "unittest")]
fn pki_setup() -> Result<()> {
use pki_playground::{config, OutputFileExistsBehavior};

// output directory where we put generated test inputs
let out =
PathBuf::from(env::var("OUT_DIR").context("Failed to get OUT_DIR")?);
Expand All @@ -36,6 +53,9 @@ fn pki_setup() -> Result<()> {
}

fn main() -> Result<()> {
#[cfg(feature = "unittest")]
mock_data()?;

#[cfg(feature = "unittest")]
pki_setup()?;

Expand Down
Loading
Loading