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)
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 <dave.chen@arm.com>
- Loading branch information
Showing
6 changed files
with
111 additions
and
4 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 |
---|---|---|
@@ -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,44 @@ | ||
// 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". | ||
|
||
// TODO: update the logic to detect the platform by the system path like "/sys/class/cca", "/sys/drivers/virtual/cca_attestation" | ||
// or the kernel config for the feature enablement. | ||
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. | ||
// TODO: Try crates cbor (https://crates.io/crates/cbor) to get rid of the proxy to the verasion service. | ||
#[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); | ||
log::info!("evidence: {}", evidence); | ||
serde_json::to_string(&evidence).map_err(|_| anyhow!("Serialize evidence failed")) | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn test_cca_get_evidence() { | ||
let attester = CCAAttester::default(); | ||
let evidence = attester.get_evidence("".to_string()); | ||
assert!(evidence.is_ok()); | ||
} | ||
} |
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
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