-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add task named 'attest' to acts as the root of trust for reporting. (#…
…1378) * Give the lpc55xpresso app-sprot image the flash required to build. * Add task named 'attest' that acts as the root of trust for reporting.
- Loading branch information
Showing
18 changed files
with
528 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Interface to 'attest' task. | ||
|
||
Interface( | ||
name: "Attest", | ||
ops: { | ||
"cert_chain_len": ( | ||
doc: "Get the number of certs in the attestation cert chain", | ||
args: {}, | ||
reply: Result( | ||
ok: "u32", | ||
err: Complex("AttestError"), | ||
), | ||
encoding: Hubpack, | ||
idempotent: true, | ||
), | ||
"cert": ( | ||
doc: "Get a cert from the RoT-R", | ||
args: { | ||
"index" : "u32", | ||
"offset" : "u32", | ||
}, | ||
leases: { | ||
"dest": (type: "[u8]", write: true), | ||
}, | ||
reply: Result( | ||
ok: "()", | ||
err: Complex("AttestError"), | ||
), | ||
encoding: Hubpack, | ||
idempotent: true, | ||
), | ||
"cert_len": ( | ||
doc: "Get length of a cert in the cert chain", | ||
args: { | ||
"index" : "u32", | ||
}, | ||
reply: Result( | ||
ok: "u32", | ||
err: Complex("AttestError"), | ||
), | ||
encoding: Hubpack, | ||
idempotent: true, | ||
) | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "attest-api" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
derive-idol-err = { path = "../../lib/derive-idol-err" } | ||
hubpack = { workspace = true } | ||
idol-runtime = { workspace = true } | ||
num-traits = { workspace = true } | ||
serde = { workspace = true } | ||
userlib = { path = "../../sys/userlib", features = ["panic-messages"] } | ||
zerocopy = { workspace = true } | ||
|
||
[build-dependencies] | ||
idol = { workspace = true } | ||
serde = { workspace = true } | ||
|
||
[lib] | ||
test = false | ||
bench = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// 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/. | ||
|
||
use idol::client; | ||
use std::error::Error; | ||
|
||
fn main() -> Result<(), Box<dyn Error + Send + Sync>> { | ||
client::build_client_stub("../../idl/attest.idol", "client_stub.rs")?; | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// 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/. | ||
|
||
//! API crate for the 'attest' task. | ||
#![no_std] | ||
|
||
use hubpack::SerializedSize; | ||
use serde::{Deserialize, Serialize}; | ||
use userlib::sys_send; | ||
|
||
#[derive( | ||
Copy, Clone, Debug, Deserialize, Eq, PartialEq, Serialize, SerializedSize, | ||
)] | ||
pub enum AttestError { | ||
CertTooBig, | ||
InvalidCertIndex, | ||
NoCerts, | ||
OutOfRange, | ||
} | ||
|
||
include!(concat!(env!("OUT_DIR"), "/client_stub.rs")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[package] | ||
name = "task-attest" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
lib-dice = { path = "../../lib/dice" } | ||
hubpack = { workspace = true } | ||
idol-runtime = { workspace = true } | ||
num-traits = { workspace = true } | ||
ringbuf = { path = "../../lib/ringbuf" } | ||
serde = { workspace = true } | ||
stage0-handoff = { path = "../../lib/stage0-handoff" } | ||
attest-api = { path = "../attest-api" } | ||
unwrap-lite = { path = "../../lib/unwrap-lite" } | ||
userlib = { path = "../../sys/userlib", features = ["panic-messages"] } | ||
zerocopy = { workspace = true } | ||
|
||
[build-dependencies] | ||
anyhow.workspace = true | ||
idol.workspace = true | ||
serde.workspace = true | ||
|
||
build-util = { path = "../../build/util" } | ||
|
||
[[bin]] | ||
name = "task-attest" | ||
test = false | ||
bench = false |
Oops, something went wrong.