forked from confidential-containers/guest-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attester: add evidence_getter binary
This tool would help to get evidence in a tee environment, which would help to do tests. Signed-off-by: Xynnn007 <[email protected]>
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
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,24 @@ | ||
// Copyright (c) 2023 Alibaba Cloud | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
use attester::*; | ||
use codicon::Read; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
// report_data on all platforms is 64 bytes length. | ||
let mut report_data = vec![0; 64]; | ||
std::io::stdin() | ||
.read(&mut report_data) | ||
.expect("read input failed"); | ||
|
||
let tee = detect_tee_type().expect("unknown tee type"); | ||
let attester: BoxedAttester = tee.try_into().expect("create attester failed"); | ||
let evidence = attester | ||
.get_evidence(report_data) | ||
.await | ||
.expect("get evidence failed"); | ||
println!("{evidence}"); | ||
} |