Skip to content

Commit

Permalink
Updating dependencies and fixing fetch CA bug for turin
Browse files Browse the repository at this point in the history
Bumping to latest stable sev library 5.0.0

There was also a recent update to the SEV library libc dependency. So the dependency in the tool has to be updated too.

Turin certificates are a different size from previous generation certificates, with the new stack from pem functionality from the library, we can get around this bug.

Signed-off-by: DGonzalezVillal <[email protected]>
  • Loading branch information
DGonzalezVillal authored and tylerfanelli committed Dec 12, 2024
1 parent 90c44ce commit e5a321c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
12 changes: 6 additions & 6 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ is-it-maintained-open-issues = { repository = "virtee/snphost" }

[dependencies]
anyhow = "1.0.83"
sev = { version = "4.0.0", features = ['openssl']}
sev = { version = "5.0.0" , features = ['openssl']}
env_logger = "0.10.1"
clap = { version = "4.5", features = [ "derive" ] }
colorful = "0.2.2"
libc = "0.2.154"
libc = "0.2.161"
curl = "0.4"
msru = "0.2.0"
7 changes: 2 additions & 5 deletions src/cert/fetch/ca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use super::*;
use anyhow::{Context, Result};
use curl::easy::Easy;
use sev::certs::snp::{ca::Chain, Certificate};
use sev::certs::snp::ca::Chain;
use std::{
fs::{create_dir_all, OpenOptions},
io::Write,
Expand Down Expand Up @@ -76,10 +76,7 @@ pub fn fetch(url: &str) -> Result<Chain> {
transfer.perform()?;
drop(transfer);

Ok(Chain {
ask: Certificate::from_pem(&buf[..2325])?,
ark: Certificate::from_pem(&buf[2325..])?,
})
Ok(Chain::from_pem_bytes(&buf)?)
}

fn ca_chain_url() -> Result<String> {
Expand Down
2 changes: 1 addition & 1 deletion src/ok.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ pub fn cmd(quiet: bool) -> Result<()> {
Ok(())
} else {
Err(anyhow::anyhow!(
"One or more tests in sevctl-ok reported a failure"
"One or more tests in snphost ok reported a failure"
))
}
}
Expand Down

0 comments on commit e5a321c

Please sign in to comment.