This repository has been archived by the owner on Jul 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New tee type: CCA (Confidential Compute Architecture)
Signed-off-by: Dave Chen <[email protected]>
- Loading branch information
Showing
4 changed files
with
89 additions
and
2 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
50 changes: 50 additions & 0 deletions
50
src/kbc_modules/cc_kbc/attester/cca/cca-claims-without-realm-challenge.json
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"cca-platform-token": { | ||
"cca-platform-profile": "http://arm.com/CCA-SSD/1.0.0", | ||
"cca-platform-implementation-id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", | ||
"cca-platform-instance-id": "AQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC", | ||
"cca-platform-config": "AQID", | ||
"cca-platform-lifecycle": 12288, | ||
"cca-platform-sw-components": [ | ||
{ | ||
"measurement-type": "BL", | ||
"measurement-value": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=", | ||
"signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=", | ||
"version": "3.4.2" | ||
}, | ||
{ | ||
"measurement-type": "M1", | ||
"measurement-value": "CwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=", | ||
"signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=", | ||
"version": "1.2.0" | ||
}, | ||
{ | ||
"measurement-type": "M2", | ||
"measurement-value": "DwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=", | ||
"signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=", | ||
"version": "1.2.3" | ||
}, | ||
{ | ||
"measurement-type": "M3", | ||
"measurement-value": "EwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=", | ||
"signer-id": "BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=", | ||
"version": "1.0.0" | ||
} | ||
], | ||
"cca-platform-service-indicator": "https://veraison.example/v1/challenge-response", | ||
"cca-platform-hash-algo-id": "sha-256" | ||
}, | ||
"cca-realm-delegated-token": { | ||
"cca-realm-personalization-value": "QURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBREFEQURBRA==", | ||
"cca-realm-initial-measurement": "Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==", | ||
"cca-realm-extensible-measurements": [ | ||
"Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==", | ||
"Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==", | ||
"Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==", | ||
"Q0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQw==" | ||
], | ||
"cca-realm-hash-algo-id": "sha-256", | ||
"cca-realm-public-key": "BIL70TKptcOWh5+7FTQNkFCXjlXHnVJ5oroOlYVPN+IM0vZPO3K1cLvXc+7iznaEJe31Re2+if+v4OlrvUbicPIHlsRIuY2vRqdk0nRC5ubthPjOyBfm7ManHTo959Z+zQ==", | ||
"cca-realm-public-key-hash-algo-id": "sha-512" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2023 Arm Ltd. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
use super::Attester; | ||
use anyhow::*; | ||
use std::env; | ||
|
||
|
||
// 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() | ||
} | ||
|
||
|
||
#[derive(Debug, Default)] | ||
pub struct CCAAttester {} | ||
|
||
// NOTE: If we sign the evidence here rather by a veraison proxy (proxy to veraison verifier), we need to rustify the cbor lib to support the logic around signature. | ||
#[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(); | ||
let evidence = String::from_utf8_lossy(s); | ||
println!("evidence: {}", evidence); | ||
serde_json::to_string(&evidence).map_err(|_| anyhow!("Serialize evidence failed")) | ||
} | ||
} |
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