Skip to content
Closed
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
98 changes: 65 additions & 33 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"dice-mfg-msgs",
"yhsm-audit",
"verifier-cli",
"verifier-ipcc",
]
resolver = "2"

Expand Down
10 changes: 10 additions & 0 deletions attest-data/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ impl<const N: usize> MeasurementLog<N> {
false
}
}

pub fn iter(&self) -> impl Iterator<Item = &Measurement> {
self.measurements.iter().enumerate().filter_map(|(i, e)| {
if i < (self.index as usize) {
Some(e)
} else {
None
}
})
}
}

impl<const N: usize> Default for MeasurementLog<N> {
Expand Down
1 change: 0 additions & 1 deletion attest-data/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub const ATTEST_MAGIC: u32 = 0xA77E5700;
/// Right now `Attest` and `TqSign` are the only commands that take data
/// argumenets. They happen to be the same length right now but this also
/// catches anything silly

const fn const_max(a: usize, b: usize) -> usize {
[a, b][(a < b) as usize]
}
Expand Down
24 changes: 24 additions & 0 deletions verifier-ipcc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "verifier-ipcc"
version = "0.1.0"
edition = "2021"
description = "A CLI tool for working over IPCC"
license = "MPL-2.0"

[dependencies]
anyhow = { workspace = true, features = ["std"] }
attest-data = { path = "../attest-data", features = ["std"] }
clap.workspace = true
const-oid = { workspace = true, features = ["db"] }
ed25519-dalek = { workspace = true, features = ["std"] }
env_logger.workspace = true
hubpack.workspace = true
libipcc = { git = "https://github.com/oxidecomputer/ipcc-rs", rev = "524eb8f125003dff50b9703900c6b323f00f9e1b" }
log.workspace = true
p384 = { workspace = true, default-features = true }
pem-rfc7468 = { workspace = true, features = ["alloc", "std"] }
sha3.workspace = true
tempfile.workspace = true
dice-verifier.path = "../verifier"
x509-cert = { workspace = true, default-features = true }
serde_json.workspace = true
3 changes: 3 additions & 0 deletions verifier-ipcc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Tools for working with measurements over IPCC on actual hardware

Runs only on illumos
17 changes: 17 additions & 0 deletions verifier-ipcc/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

/// This path is where Oxide specific libraries live on helios systems.
/// This is needed for linking with libipcc
#[cfg(target_os = "illumos")]
static OXIDE_PLATFORM: &str = "/usr/platform/oxide/lib/amd64/";

fn main() {
println!("cargo:rerun-if-changed=build.rs");
#[cfg(target_os = "illumos")]
{
println!("cargo:rustc-link-arg=-Wl,-R{}", OXIDE_PLATFORM);
println!("cargo:rustc-link-search={}", OXIDE_PLATFORM);
}
}
Loading