Skip to content

Commit

Permalink
AS/verifier: fix tdx quote verification unit test
Browse files Browse the repository at this point in the history
The example quotes need to configure a proper PCCS provided by Aliyun.

Close confidential-containers#399

Signed-off-by: Xynnn007 <[email protected]>
  • Loading branch information
Xynnn007 committed Jun 21, 2024
1 parent 8d26472 commit 1dc6d1e
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions attestation-service/verifier/src/tdx/quote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,11 +528,32 @@ mod tests {
let _ = fs::write(format!("{quote_path}.txt"), parsed_quote);
}

/// Test to verify the TDX quote, both in v4 and v5 format.
///
/// This unit test requires two packages, s.t. `libsgx-dcap-quote-verify-dev` and `libsgx-dcap-default-qpl`
/// On ubuntu 22.04, you need to run the following scripts to install.
/// ```shell
/// curl -L https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | tee intel-sgx-deb.key | apt-key add - && \
/// echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main' | tee /etc/apt/sources.list.d/intel-sgx.list && \
/// apt-get update && \
/// apt-get install -y libsgx-dcap-default-qpl libsgx-dcap-quote-verify
/// ```
///
/// Also, you need to configure DCAP to work with alibaba cloud's PCCS.
/// edit `/etc/sgx_default_qcnl.conf` and replace the whole content with
/// ```json
/// {"pccs_url" :"https://sgx-dcap-server.cn-beijing.aliyuncs.com/sgx/certification/v4/"}
/// ```
///
/// The manual modification upon `sgx_default_qcnl.conf` could be promoted after
/// https://github.com/intel/SGXDataCenterAttestationPrimitives/issues/409 is resolved.
///
/// Finally, DCAP only provides packages on x86-64 platform, thus we only test this on x86-64
/// platforms.
#[cfg(target_arch = "x86_64")]
#[rstest]
#[ignore]
#[tokio::test]
#[case("./test_data/tdx_quote_4.dat")]
#[ignore]
#[tokio::test]
#[case("./test_data/tdx_quote_5.dat")]
async fn test_verify_tdx_quote(#[case] quote: &str) {
Expand Down

0 comments on commit 1dc6d1e

Please sign in to comment.