Skip to content

Add IDK_S PTA - #1026

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

Sangho Lee (sangho2) wants to merge 16 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 commands to endorse TA-provided data with a flat structure signed by an IDK_S key. A wire format depends on whether the data is normal or pre-framed: 1) normal: REPORT || TA_DATA || SIGNATURE_PARAMS || SIGNATURE; 2) pre-framed: TA_DATA || REPORT || SIGNATURE_PARAMS || SIGNATURE. All bytes except for TA_DATA 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) 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 thread litebox_shim_optee/src/idk.rs
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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey.. yes. From yesterday's discussion, they don't care. But I think another TA could. And if we change it then the remote verifier will also have to be changed. I think we should make it parsable

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.

I decided to provide two commands which simply have difference placements of TA_DATA. In terms of parseability, I think the verifier can still parse the claim anyway because it knows golden UUID, SVN, TA_DIGEST, ... which will work as anchors.

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.

Question is more about whether we want to implement table-based one (as EnS expects) or use the current flat layout.

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

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.

Added fields for digest algorithm and lengths.

const LDELF_BINARY: &[u8] = &[0u8; 0];
const TA_BINARY: &[u8] = &[0u8; 0];
const TA_BINARIES: &[&[u8]] = &[TA_BINARY];
const TA_SIGNING_CERT_DER: &[u8] = &[0u8; 0];

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 think Angelina has a different way of sending the cert. But let us check in your PR and then Angelina can fix it up with her signing PR

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.

Yes. This is a placeholder for now.

@sangho2
Sangho Lee (sangho2) force-pushed the sanghle/optee/idks_pta branch 2 times, most recently from e6c4a27 to 6549039 Compare September 24, 2026 22:32
@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