Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

WIP - New tee type: CCA (Confidential Compute Architecture) #184

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chendave
Copy link
Member

@chendave chendave commented Apr 18, 2023

support ARM CCA (Confidential Compute Architecture), the evidence is loaded from the disk atm, this should be improved when there is a proper way to fetch the evidence instead.

@chendave
Copy link
Member Author

/hold

@chendave chendave changed the title New tee type: CCA (Confidential Compute Architecture) WIP - New tee type: CCA (Confidential Compute Architecture) Apr 18, 2023
Copy link
Member

@fitzthum fitzthum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this is WIP and it looks like it's just using some dummy evidence, but I got so excited to see CCA support that I had to give a few suggestions.

Also note that #182 will require a rather large rebase one merged.

Cargo.toml Outdated
@@ -39,7 +39,7 @@ rstest = "0.16.0"
tonic-build = { version = "0.8.0", optional = true }

[features]
default = ["sample_kbc", "rust-crypto"]
default = ["sample_kbc", "rust-crypto", "cc_kbc"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just for testing?

Note how other platforms have an additional feature to build their attester. You may want to add something similar.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this will be reverted I think.

// If the environment variable "CCA_ATTESTER" is set,
// the TEE platform is considered as "CCA".
pub fn detect_platform() -> bool {
env::var("CCA_ATTESTER").is_ok()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who sets this? Is there a way to query the platform more directly like via cpuid?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking this might be an env, just like AA_SAMPLE_ATTESTER_TEST, query from platform is a great idea. Let's see if we can move toward that.

#[allow(unused_variables)]
impl Attester for CCAAttester {
fn get_evidence(&self, data: String) -> Result<String> {
let s = std::include_str!("cca-claims-without-realm-challenge.json").as_bytes();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is some kind of placeholder?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, I don't have a elegant way to get back the evidence, so just load it in this way instead, this will be updated if we there is any progress for us to get back the real evidence.

#[derive(Debug, EnumString, Display)]
#[strum(ascii_case_insensitive, serialize_all = "lowercase")]
pub enum Tee {
Tdx,
Sgx,
Sevsnp,
Sample,
CCA,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CCA -> Cca

@chendave
Copy link
Member Author

I see this is WIP and it looks like it's just using some dummy evidence, but I got so excited to see CCA support that I had to give a few suggestions.

@fitzthum thanks a lot for your review, any comments is highly appreciated!

@chendave chendave force-pushed the demo1.0 branch 4 times, most recently from f9a3445 to 1393c4e Compare May 17, 2023 07:47
The evidence is currently loaded from disk, it's actually a placeholder and
should be updated if there is way available to get back the real evidence.

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

Successfully merging this pull request may close these issues.

2 participants