Skip to content

Comments

Add TPMS_ID_OBJECT structure#311

Open
akakou wants to merge 1 commit intogoogle:tpmdirectfrom
akakou-fork:feature/id-object
Open

Add TPMS_ID_OBJECT structure#311
akakou wants to merge 1 commit intogoogle:tpmdirectfrom
akakou-fork:feature/id-object

Conversation

@akakou
Copy link
Contributor

@akakou akakou commented Sep 27, 2022

No description provided.

@akakou akakou requested review from a team, alexmwu and jkl73 as code owners September 27, 2022 07:10
IntegrityHMAC TPM2BDigest
// credential protector information returned if name matches the referenced object
// All of the encIdentity is encrypted, including the size field.
EncIdentity []byte
Copy link
Member

Choose a reason for hiding this comment

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

This is a strange structure, so it is one of the exceptional cases that can't just get reflection applied to it, I don't think :)

This "encrypted sized" structure makes this not possible to unmarshal (since we don't know the encrypted size of EncIdentity). That's why TPMS_ID_OBJECT in the spec says:

This structure is used for sizing the TPM2B_ID_OBJECT.

It also says that TPM2B_ID_OBJECT contains a buffer that happens to be limited to the size of a TPMS_ID_OBJECT:

credential[size]{:sizeof{TPMS_ID_OBJECT}}

So I would recommend making TPM2BIDObject be a boring TPM2BData, and adding a factory function that makes it easier to assemble a TPM2BIDObject.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chrisfenner

I'm sorry to reply so late; I had written my graduation thesis.

I agree with your opinion, and I will implement it.

To implement it, I have a question.
Which files should I implement it...?
Do you have an idea?

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.

2 participants