Skip to content

Commit

Permalink
show: Remove SEV-SNP specific info
Browse files Browse the repository at this point in the history
snphost is the SEV-SNP equivalent of sevctl. Any SEV-SNP specific bits
should be allocated to snphost.

Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
  • Loading branch information
tylerfanelli committed Jul 27, 2023
1 parent ad8e228 commit b582e46
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use codicon::*;

use ::sev::certs::*;
use ::sev::firmware::host::{
types::{PlatformStatusFlags, SnpStatus, Status},
types::{PlatformStatusFlags, Status},
Firmware,
};
use ::sev::Generation;
Expand Down Expand Up @@ -201,13 +201,6 @@ fn platform_status() -> Result<Status> {
.context("unable to fetch platform status")
}

fn snp_platform_status() -> Result<SnpStatus> {
firmware()?
.snp_platform_status()
.map_err(|e| anyhow::anyhow!(format!("{:?}", e)))
.context("unable to fetch snp platform status")
}

fn chain() -> Result<sev::Chain> {
const CEK_SVC: &str = "https://kdsintf.amd.com/cek/id";

Expand Down Expand Up @@ -296,12 +289,6 @@ mod show {
#[structopt(about = "Show the platform identifier")]
Identifier,

#[structopt(about = "Show the SNP platform status")]
SnpStatus,

#[structopt(about = "Show the VCEK DER download URL")]
VcekUrl,

#[structopt(about = "Show the platform's firmware version")]
Version,
}
Expand All @@ -319,19 +306,6 @@ mod show {
.context("error fetching identifier")?;
println!("{}", id);
}
Show::SnpStatus => {
let snp_status = snp_platform_status()?;
println!("{:#?}", snp_status);
}
Show::VcekUrl => {
let id = firmware()?
.get_identifier()
.map_err(|e| anyhow::anyhow!(format!("{:?}", e)))
.context("error fetching identifier")?;
let snp_status = snp_platform_status()?;
println!("https://kdsintf.amd.com/vcek/v1/Milan/{}?blSPL={:02}&teeSPL={:02}&snpSPL={:02}&ucodeSPL={:02}",
id, snp_status.tcb.platform_version.bootloader, snp_status.tcb.platform_version.tee, snp_status.tcb.platform_version.snp, snp_status.tcb.platform_version.microcode);
}
Show::Flags => {
for f in [
PlatformStatusFlags::OWNED,
Expand Down

0 comments on commit b582e46

Please sign in to comment.