Skip to content

Commit f107dd1

Browse files
authored
chore(tee): align reportData and node-key docs with the code (#4265)
1 parent a93394c commit f107dd1

4 files changed

Lines changed: 10 additions & 14 deletions

File tree

crates/attestation/src/attestation.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,15 @@ impl DstackAttestation {
270270
Ok(report.advisory_ids.clone())
271271
}
272272

273-
/// Verifies report data matches expected values.
273+
/// Verifies the quote's report data matches `expected`.
274+
///
275+
/// Matching the full blob proves the caller's expected report data was bound into the quote
276+
/// by an app running inside a TDX enclave. Its layout is the caller's concern.
274277
fn verify_report_data(
275278
&self,
276279
expected: &ReportData,
277280
actual: &TDReport10,
278281
) -> Result<(), VerificationError> {
279-
// Check if sha384(tls_public_key) matches the hash in report_data. This check effectively
280-
// proves that tls_public_key was included in the quote's report_data by an app running
281-
// inside a TDX enclave.
282282
compare_hashes("report_data", &actual.report_data, &expected.to_bytes())
283283
}
284284

crates/mpc-attestation/src/report_data.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl core::borrow::Borrow<[u8]> for Ed25519PublicKey {
6262
}
6363

6464
/// report_data_v1: [u8; 64] =
65-
/// [version(2 bytes big endian) || sha384(TLS pub key || account_pubkey) || zero padding]
65+
/// [version(2 bytes big endian) || sha3-384(TLS pub key || account_pubkey) || zero padding]
6666
impl ReportDataV1 {
6767
/// V1-specific format constants
6868
const PUBLIC_KEYS_OFFSET: usize = BINARY_VERSION_OFFSET + BINARY_VERSION_SIZE;
@@ -86,9 +86,7 @@ impl ReportDataV1 {
8686
);
8787
};
8888

89-
/// Computes a SHA3-384 hash over two public keys.
90-
///
91-
/// Returns and arraySha384 (tls_public_key || account_public_key)
89+
/// Returns SHA3-384(tls_public_key || account_public_key).
9290
fn compute_public_keys_hash(
9391
tls_public_key: impl AsRef<[u8]>,
9492
account_public_key: impl AsRef<[u8]>,

docs/migration-service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ Additionally, the backup service will need to provide a TEE attestation similar
382382
The backup service attestation registreation and verification would follow the same process as MPC node attestations:
383383
1. Backup service generates TLS keypair inside TEE
384384
2. Backup service generates account keypair inside TEE for signing contract transactions (required to submit the attestation to the contract)
385-
3. Creates `ReportData` V1: `[version(2 bytes big endian) || sha384(TLS pub key || account_pubkey) || zero padding]`
385+
3. Creates `ReportData` V1: `[version(2 bytes big endian) || sha3-384(TLS pub key || account_pubkey) || zero padding]`
386386
4. Obtains TEE quote embedding the `ReportData`
387387
5. Submits attestation via `register_backup_service(tls_public_key, account_public_key, attestation)`
388388
6. Contract verifies (using existing `TeeState` verification logic):

docs/securing-mpc-with-tee-design-doc.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ We grant access to all contract methods rather than an explicit allow-list becau
424424

425425
In addition - The node will generate multiple responder account keys as well. These are used to increase throughout when posting generated MPC signatures to the chain.
426426

427-
_Note - We plan (in future release) to add a restriction that some of contract API can only be invoked with the node key and not the operators key, those enhancing the security and separation of duty._
427+
Node-only contract APIs (`respond`, `respond_ckd`, `respond_verify_foreign_tx`, the key-event calls, `register_foreign_chains_config`) reject the operator key: the contract requires the signer key to be the attested node account key.
428428

429429
## Remote Attestation
430430

@@ -440,9 +440,7 @@ The node will use the Dstack APIs in order to generate the remote attestation in
440440

441441
- A TDX quote (including RTMRs and reportData)
442442

443-
- reportData == Version || SHA384(node's TLS P2P public key)
444-
445-
_Note_ - In a future release, we plan to add the hash of node's public account key as well - in order to be able to add restriction on the operator calling some of the contract APIs
443+
- reportData == Version (2 bytes, big endian) || SHA3-384(node's TLS P2P public key || node's account public key), zero-padded to 64 bytes
446444

447445
- Collateral (TCB Info, QE Identity, PCK CRL) — fetched from a configurable PCCS endpoint chain. See [PCCS Collateral Handling](#pccs-collateral-handling) below for endpoint configuration, freshness, and TLS trust.
448446

@@ -473,7 +471,7 @@ Review Dstack [RMTR calculation and attestation](https://github.com/Dstack-TEE/d
473471
Those are the high level steps the contract does in order to verify the attestation quote generated by the MPC node.
474472

475473
1. Verify TDX quote (according to intel spec, mainly validating signatures and chain of trust).
476-
2. Verify Reportdata  == Version || SHA384(node's public signing key)
474+
2. Verify Reportdata  == Version || SHA3-384(node's TLS P2P public key || node's account public key)
477475

478476
byte Version=2 bytes, big endian.
479477

0 commit comments

Comments
 (0)