Skip to content

Commit

Permalink
Make sure file w/ intermediate cert exists, send it before issuing cert.
Browse files Browse the repository at this point in the history
  • Loading branch information
flihp committed Mar 11, 2024
1 parent cf830fc commit 29c6e55
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dice-mfg/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@ fn main() -> Result<()> {

let intermediate_cert = intermediate_cert
.unwrap_or_else(|| ca_root.join("ca.cert.pem"));

if intermediate_cert.is_file() {
driver.set_intermediate_cert(&intermediate_cert)?;
} else {
bail!("path provided for intermediate cert is not a file");
}

let cert_signer = CertSignerBuilder::new(ca_root)
.set_auth_id(auth_id)
.set_ca_section(ca_section)
Expand All @@ -324,7 +331,6 @@ fn main() -> Result<()> {
.build();
cert_signer.sign(&csr, &cert)?;
driver.set_platform_id_cert(&cert)?;
driver.set_intermediate_cert(&intermediate_cert)?;
driver.send_break()
}
Command::Ping => driver.unwrap().ping(),
Expand Down

0 comments on commit 29c6e55

Please sign in to comment.