Add IDK_S PTA - #1026
Add IDK_S PTA#1026Sangho Lee (sangho2) wants to merge 15 commits into
Conversation
7850306 to
6955223
Compare
6031f3c to
c172e8a
Compare
91e4c3a to
205a633
Compare
054e1c6 to
420f007
Compare
e5a3e08 to
65a67fb
Compare
65a67fb to
d531256
Compare
300e832 to
1cb91e6
Compare
d531256 to
02010a7
Compare
1cb91e6 to
c9a77f6
Compare
bdd2a3a to
03cf03e
Compare
b1df4fd to
81667ad
Compare
03cf03e to
26430d6
Compare
26430d6 to
fa0aeb2
Compare
44c7587 to
131b31e
Compare
131b31e to
4443bb6
Compare
9340001 to
019ad24
Compare
84e3837 to
a0f8f03
Compare
|
|
| // [out] params[1].memref.buffer Output buffer for signed endorsement | ||
| // [out] params[1].memref.size Buffer size |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Isn't TA_DATA part of the endorsement claim in params1 ?
There was a problem hiding this comment.
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) | ||
| } |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
- This change is based on the discussion with Dikla. My understanding is that,
TA_DATAwill 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); |
There was a problem hiding this comment.
Do we need a field for ta_ digest size ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
702a806 to
4635544
Compare
4635544 to
349d5b0
Compare
|
🤖 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. |
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, whereTA_DATA_LENis an observed length ofTA_DATA. All other values are from the LiteBox/PTA andSIGNATUREcovers all except for itself.