Skip to content

Commit

Permalink
kbs: ita: Set hash algorithm based on TEE type
Browse files Browse the repository at this point in the history
If the TEE specifies the hash algorithms it can use [1], add the appropriate
hash algorithm to the returned `Challenge` [2].

For backwards compatibility, do not return the selected hash algorithm
if the TEE does not provide the list of hash algorithms it can use.

Partially-fixes: #242.

[1] - In the optional `extra-params.supported-hash-algorithms` list.
[2] - In `extra-params.selected-hash-algorithm`.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel authored and fidencio committed Sep 11, 2024
1 parent ccb15d7 commit 5d0f0bc
Show file tree
Hide file tree
Showing 4 changed files with 341 additions and 25 deletions.
28 changes: 14 additions & 14 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions attestation-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ use serde_json::{json, Value};
use serde_variant::to_variant_name;
use sha2::{Digest, Sha256, Sha384, Sha512};
use std::{collections::HashMap, str::FromStr};
use strum::{AsRefStr, EnumString};
use strum::{AsRefStr, Display, EnumString};
use thiserror::Error;
use tokio::fs;
use verifier::{InitDataHash, ReportData};

use crate::utils::flatten_claims;

/// Hash algorithms used to calculate runtime/init data binding
#[derive(EnumString, AsRefStr)]
#[derive(Display, EnumString, AsRefStr)]
pub enum HashAlgorithm {
#[strum(ascii_case_insensitive)]
Sha256,
Expand Down
Loading

0 comments on commit 5d0f0bc

Please sign in to comment.