Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AS: tdx-quote verification unit test fails #399

Closed
mkulke opened this issue May 28, 2024 · 5 comments · Fixed by #426
Closed

AS: tdx-quote verification unit test fails #399

mkulke opened this issue May 28, 2024 · 5 comments · Fixed by #426
Assignees

Comments

@mkulke
Copy link
Contributor

mkulke commented May 28, 2024

there is a tdx quote verification unit test that fails atm. the test is disabled by default, most likely because you need a PCCS configured on the test system.

cargo t -p verifier --no-default-features --features tdx-verifier -- verify_tdx_quote::case_2
    Finished test [unoptimized + debuginfo] target(s) in 0.21s
     Running unittests src/lib.rs (target/debug/deps/verifier-62425084b3596eb5)

running 1 test
test tdx::quote::tests::test_verify_tdx_quote::case_2 ... FAILED

failures:

---- tdx::quote::tests::test_verify_tdx_quote::case_2 stdout ----
thread 'tdx::quote::tests::test_verify_tdx_quote::case_2' panicked at attestation-service/verifier/src/tdx/quote.rs:540:9:
Err(tee_verify_quote failed: 0xe066)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    tdx::quote::tests::test_verify_tdx_quote::case_2

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 76 filtered out; finished in 0.02s

error: test failed, to rerun pass `-p verifier --lib`

We should either remove that test or maybe consider rewriting the logic slightly so that we can store all external dependencies as fixtures for the unit test and cover real verification in an e2e test

@Xynnn007
Copy link
Member

I am diving into this.

@Xynnn007 Xynnn007 self-assigned this May 29, 2024
@Xynnn007
Copy link
Member

Xynnn007 commented Jun 6, 2024

Well. This quote is generated on Alibaba cloud. GHA should connect to the PCCS of aliyun https://sgx-dcap-server.cn-beijing.aliyuncs.com/sgx/certification/v4/ to get proper collaterals.

@mkulke
Copy link
Contributor Author

mkulke commented Jun 13, 2024

ok, this is what I assumed. Is there a way to store the response of PCCS as a fixture and make the unit tests use that (after refactoring the verification a bit to be able to use use output of tee_qv_get_collateral(quote) as a fixture? (e.g. change ecdsa_quote_verification(quote) signature to ecdsa_quote_verification(quote, signature))

@mythi
Copy link
Contributor

mythi commented Jun 13, 2024

I have requested a DCAP feature to be able to configure the PC(C)S settings more easily. With that, the test case can create a config file with the necessary {collateral_service=...} under, e.g., /tmp and use that so that the test passes. intel/SGXDataCenterAttestationPrimitives#409

@Xynnn007
Copy link
Member

@mkulke Yes. I thought I walked a big circle and finally got you at the beginning. Let me try to fix this in both ways -- I prefer to try changing pccs address first

Xynnn007 added a commit to Xynnn007/kbs that referenced this issue Jun 21, 2024
The example quotes need to configure a proper PCCS provided by Aliyun.

Close confidential-containers#399

Signed-off-by: Xynnn007 <[email protected]>
Xynnn007 added a commit to Xynnn007/kbs that referenced this issue Jun 21, 2024
The example quotes need to configure a proper PCCS provided by Aliyun.

Close confidential-containers#399

Signed-off-by: Xynnn007 <[email protected]>
Xynnn007 added a commit to Xynnn007/kbs that referenced this issue Jun 21, 2024
The example quotes need to configure a proper PCCS provided by Aliyun.

Close confidential-containers#399

Signed-off-by: Xynnn007 <[email protected]>
Xynnn007 added a commit to Xynnn007/kbs that referenced this issue Jun 21, 2024
The example quotes need to configure a proper PCCS provided by Aliyun.

Close confidential-containers#399

Signed-off-by: Xynnn007 <[email protected]>
Xynnn007 added a commit to Xynnn007/kbs that referenced this issue Jun 21, 2024
The example quotes need to configure a proper PCCS provided by Aliyun.

Close confidential-containers#399

Signed-off-by: Xynnn007 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants