-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Richard Zak <[email protected]>
- Loading branch information
Showing
5 changed files
with
75 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// SPDX-FileCopyrightText: 2022 Profian Inc. <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
#![allow(unused_variables, unused_imports)] // temporary until CRL validation enabled | ||
|
||
pub mod config; | ||
pub mod quote; | ||
|
||
|
@@ -17,6 +15,7 @@ use const_oid::ObjectIdentifier; | |
use der::{Decode, Encode}; | ||
use sgx::pck::SgxExtension; | ||
use sha2::{Digest, Sha256}; | ||
#[cfg(debug_assertions)] | ||
use tracing::debug; | ||
use x509::{ext::Extension, request::CertReqInfo, Certificate, PkiPath, TbsCertificate}; | ||
|
||
|
@@ -44,7 +43,7 @@ impl Sgx { | |
signer = signer.verify_crt(cert)?; | ||
} | ||
|
||
//PkiPath::from(chain).check_crl(crls)?; | ||
PkiPath::from(chain).check_crl(crls)?; | ||
|
||
Ok(signer) | ||
} | ||
|
@@ -96,7 +95,7 @@ impl Sgx { | |
// Parse the TCB certificate chain | ||
let tcb_chain = "e.tcb.certs; | ||
ensure!(chain[0] == tcb_chain[0], "sgx TCB root not SGX root"); | ||
let tcb_signer = self.trusted(tcb_chain, "e.crls)?; | ||
self.trusted(tcb_chain, "e.crls)?; | ||
|
||
// Validate TCB report | ||
tcb_chain[1] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
// SPDX-FileCopyrightText: 2022 Profian Inc. <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
use std::cmp::Ordering; | ||
use std::time::SystemTime; | ||
|
||
use chrono::DateTime; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// SPDX-FileCopyrightText: 2022 Profian Inc. <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
#![allow(unused_variables, unused_imports)] // temporary until CRL validation enabled | ||
|
||
pub mod config; | ||
|
||
use self::config::Config; | ||
|
@@ -254,9 +252,9 @@ impl Snp { | |
|
||
if let Some(signer) = signer { | ||
if signer == &vcek.tbs_certificate { | ||
//let mut path = path; | ||
//path.push(vcek.clone()); | ||
//path.check_crl(&certs.crl)?; | ||
let mut path = path; | ||
path.push(vcek.clone()); | ||
path.check_crl(&certs.crl)?; | ||
return Ok(&vcek.tbs_certificate); | ||
} | ||
} | ||
|