Skip to content

Add IDK_S PTA - #1026

Open
Sangho Lee (sangho2) wants to merge 15 commits into
mainfrom
sanghle/optee/idks_pta
Open

Sangho Lee (sangho2) wants to merge 15 commits into
mainfrom
sanghle/optee/idks_pta

Conversation

@sangho2

@sangho2 Sangho Lee (sangho2) commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This PR introduces the IDK_S PTA. It provides a method which endorses TA-provided data with a flat structure signed by an IDK_S key. A wire format is TA_DATA || REPORT (MAGIC, VERSION, TA_DATA_LEN, TA_UUID, ..., TA_SIGNING_CERT_DER) || SIGNATURE_PARAMS || SIGNATURE, where TA_DATA_LEN is an observed length of TA_DATA. All other values are from the LiteBox/PTA and SIGNATURE covers all except for itself.

@sangho2 Sangho Lee (sangho2) added the discussion Open questions label Jul 13, 2026
@sangho2
Sangho Lee (sangho2) force-pushed the sanghle/optee/idks_pta branch 2 times, most recently from 91e4c3a to 205a633 Compare July 14, 2026 00:14
@sangho2 Sangho Lee (sangho2) changed the title [DRAFT] IDK_S PTA [DRAFT] Add IDK_S PTA Jul 14, 2026
@sangho2
Sangho Lee (sangho2) force-pushed the sanghle/optee/idks_pta branch 4 times, most recently from e5a3e08 to 65a67fb Compare July 14, 2026 20:01
@sangho2 Sangho Lee (sangho2) changed the title [DRAFT] Add IDK_S PTA [DRAFT] IDK_S PTA Jul 14, 2026
@sangho2
Sangho Lee (sangho2) force-pushed the sanghle/lvbs/idk branch 3 times, most recently from 300e832 to 1cb91e6 Compare July 22, 2026 16:11
Comment thread litebox_shim_optee/src/idk.rs
@sangho2 Sangho Lee (sangho2) added the must-not-merge:prototype An experimental/proof-of-concept PR that must not be merged. label Jul 22, 2026
@sangho2
Sangho Lee (sangho2) force-pushed the sanghle/optee/idks_pta branch 2 times, most recently from bdd2a3a to 03cf03e Compare July 23, 2026 15:25
@sangho2
Sangho Lee (sangho2) force-pushed the sanghle/lvbs/idk branch 2 times, most recently from b1df4fd to 81667ad Compare July 24, 2026 16:52
Base automatically changed from sanghle/lvbs/idk to main July 24, 2026 17:13
@sangho2 Sangho Lee (sangho2) changed the title [DRAFT] IDK_S PTA Add IDK_S PTA Aug 3, 2026
@sangho2
Sangho Lee (sangho2) marked this pull request as ready for review August 3, 2026 17:26
@sangho2 Sangho Lee (sangho2) added the must-not-merge:blocked-on-other-changes Other changes/PRs to be handled first. Label not needed for non-main changes. label Aug 31, 2026
@sangho2 Sangho Lee (sangho2) removed the must-not-merge:blocked-on-other-changes Other changes/PRs to be handled first. Label not needed for non-main changes. label Sep 14, 2026
@sangho2
Sangho Lee (sangho2) marked this pull request as draft September 14, 2026 17:01
@sangho2 Sangho Lee (sangho2) removed the discussion Open questions label Sep 14, 2026
@sangho2
Sangho Lee (sangho2) marked this pull request as ready for review September 14, 2026 19:53
@sangho2

Copy link
Copy Markdown
Contributor Author

TA_SIGNING_CERT_LEN and TA_SIGNING_CERT_DER are technically redundant if a TA is embedded because it isn't signed. However, for now, we do not make them optional.

Comment on lines +94 to +95
// [out] params[1].memref.buffer Output buffer for signed endorsement
// [out] params[1].memref.size Buffer size

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since a signed endorsement is just an appendix now, we don't have to copy the received TA data back to the output buffer if the TA concatenates these two by itself (performance optimization).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Isn't TA_DATA part of the endorsement claim in params1 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If we don't have MAGIC and VERSION prefix, this claim is technically fully decoupled from TA_DATA itself. TA can concatenate them. Anyhow, this is just perf optimization.

endorsement.extend_from_slice(&cert_len.to_le_bytes());
endorsement.extend_from_slice(ta_signing_cert);
Some(endorsement)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So.. I don't think we can have ta_data as the first element. It will be impossible to parse the claims structure. I propose MAGIC || VERSION || TA_DATA_LEN || TA_UUID || TA_SVN || TA_DIGEST ||
/// TA_DYNAMIC || DEBUG || ISOLATION_SOLUTION || TA_SIGNING_CERT_LEN ||
/// TA_SIGNING_CERT_DER || TA_DATA || SIGNATURE

Now I re-read the Attestation doc from EnS multiple times ! I think they are also looking for some kind of info on the signing cert (IDK_S) itself. Like the type of algorithm/ hash algorithm etc which makes sense so that we can switch to PQC later. The doc talks about following structure for this

""""
typedef struct _KEYISO_ATTESTATION_SIGNATURE_PARAMS
{
ULONG Magic; // KEYISO_ATTESTATION_SIGNATURE_PARAMS_MAGIC
ULONG Version; // KEYISO_ATTESTATION_SIGNATURE_PARAMS_CURRENT_VERSION
ULONG cbAlgID; // Length of algorithm identifier string
ULONG cbAlgPramas; // Length of algorithm parameters structure
ULONG cbHashAlg; // Length of hash algorithm name string
// UCHAR AlgID[cbAlgID] -- Algorithm name (e.g., "ECDSA_P384")
// UCHAR AlgParams[cbAlgPramas] -- Algorithm params (e.g., KEYISO_ATTESTATION_ECC_SIGNATURE_PARAMS)
// UCHAR HashAlg[cbHashAlg] -- Hash algorithm name (e.g., "SHA384") } KEYISO_ATTESTATION_SIGNATURE_PARAMS, * PKEYISO_ATTESTATION_SIGNATURE_PARAMS;

For LVBS, the IDKS key is an ECDSA P-384, so:
• AlgID: "ECDSA_P384"
• AlgParams: The ECC signature params structure KEYISO_ATTESTATION_ECC_SIGNATURE_PARAMS, contains only the Magic and Version - no additional parameters beyond the curve identified in AlgID.
• HashAlg: "SHA384"
"""""

But I am not sure if we want to follow a structure like this. Just defining the relevant fields might also suffice. Like char idk_alg_name[] and char idk_hash_name[] ? I don't know if these should be fixed length strings or we need to add fields to specify the size

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • This change is based on the discussion with Dikla. My understanding is that, TA_DATA will internally has a length field to recognize its end.
  • That's what our old commit implemented :) If we want to have them, it might be better to just use EnS's KeyIso structure, instead of inventing our own thing.

endorsement.extend_from_slice(&ta_data_len.to_le_bytes());
endorsement.extend_from_slice(&ta_uuid.to_le_bytes());
endorsement.extend_from_slice(&ta_svn.to_le_bytes());
endorsement.extend_from_slice(ta_digest);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we need a field for ta_ digest size ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For now, we only use SHA-256, whose length is fixed. it depends on whether we want to support other hash algorithms like SHA-384 and SHA-512.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think we should add this . It is very possible that we want to support SHA-384 or SHA-512 later. The attestation verifier will have to change then

@github-actions

Copy link
Copy Markdown

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

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 this pull request may close these issues.

3 participants