Skip to content

Commit

Permalink
fix(tee-key-preexec): don't hash public key
Browse files Browse the repository at this point in the history
No need to hash the public key for the attestation report data.

Signed-off-by: Harald Hoyer <[email protected]>
  • Loading branch information
haraldh committed Feb 15, 2024
1 parent 761d546 commit f5b6c4e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion bin/tee-key-preexec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ anyhow.workspace = true
hex.workspace = true
k256.workspace = true
rand.workspace = true
sha2.workspace = true
teepot.workspace = true
tracing-log.workspace = true
tracing-subscriber.workspace = true
Expand Down
5 changes: 1 addition & 4 deletions bin/tee-key-preexec/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
use anyhow::{Context, Result};
use hex::ToHex;
use k256::ecdsa::SigningKey;
use sha2::Digest;
use sha2::Sha256;
use std::env;
use std::os::unix::process::CommandExt;
use std::process::Command;
Expand Down Expand Up @@ -41,9 +39,8 @@ fn main_with_error() -> Result<()> {
let mut rng = rand::thread_rng();
let signing_key = SigningKey::random(&mut rng);
let verifying_key_bytes = signing_key.verifying_key().to_sec1_bytes();
let hash_verifying_key = Sha256::digest(verifying_key_bytes);
let signing_key_string = signing_key.to_bytes().encode_hex::<String>();
let tee_type = match get_quote(&hash_verifying_key) {
let tee_type = match get_quote(verifying_key_bytes.as_ref()) {
Ok(quote) => {
// save quote to file
std::fs::write(TEE_QUOTE_FILE, quote)?;
Expand Down

0 comments on commit f5b6c4e

Please sign in to comment.