Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Turin support and updating ASK CN #78

Merged
merged 1 commit into from
Nov 7, 2024
Merged
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
2 changes: 1 addition & 1 deletion Cargo.lock

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

14 changes: 12 additions & 2 deletions src/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ pub enum ProcType {

/// 4th Gen AMD EPYC Processor (Edge)
Siena,

/// 5th Gen AMD EPYC Processor (Standard)
Turin,
}

impl ProcType {
Expand All @@ -84,6 +87,7 @@ impl FromStr for ProcType {
"genoa" => Ok(ProcType::Genoa),
"bergamo" => Ok(ProcType::Bergamo),
"siena" => Ok(ProcType::Siena),
"turin" => Ok(ProcType::Turin),
_ => Err(anyhow::anyhow!("Processor type not found!")),
}
}
Expand All @@ -96,6 +100,7 @@ impl fmt::Display for ProcType {
ProcType::Genoa => write!(f, "Genoa"),
ProcType::Bergamo => write!(f, "Bergamo"),
ProcType::Siena => write!(f, "Siena"),
ProcType::Turin => write!(f, "Turin"),
}
}
}
Expand Down Expand Up @@ -236,8 +241,13 @@ mod vcek {
report::read_report(att_report_path).context("Could not open attestation report")?
};

// Use attestation report to get data for URL
let hw_id: String = hex::encode(att_report.chip_id);
let hw_id: String = match processor_model {
ProcType::Turin => {
let shorter_bytes: &[u8] = &att_report.chip_id[0..8];
hex::encode(shorter_bytes)
}
_ => hex::encode(att_report.chip_id),
};

let vcek_url: String = format!(
"{KDS_CERT_SITE}{KDS_VCEK}/{}/\
Expand Down
2 changes: 1 addition & 1 deletion src/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ mod attestation {
{
match val.to_lowercase() {
x if x.contains("ark") => Ok(CertType::ARK),
x if x.contains("ask") => Ok(CertType::ASK),
x if x.contains("ask") | x.contains("sev") => Ok(CertType::ASK),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tylerfanelli This was an addition due to a change introduced to the KDS. Formerly the Common name of the ASK contained "ASK", now it contains "SEV-", so we adjusted it to be backward-compatible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood, thanks for clearing that up.

x if x.contains("vcek") => Ok(CertType::VCEK),
x if x.contains("vlek") => Ok(CertType::VLEK),
x if x.contains("crl") => Ok(CertType::CRL),
Expand Down
Loading