Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Specification question] Wrong type in TPMS_CONTEXT? #2710

Open
Superhepper opened this issue Nov 19, 2023 · 2 comments
Open

[Specification question] Wrong type in TPMS_CONTEXT? #2710

Superhepper opened this issue Nov 19, 2023 · 2 comments
Labels
enhancement starter Good for getting familiar with the code abse

Comments

@Superhepper
Copy link
Contributor

I am having difficulties understanding what type that should actually be used in the TPMS_CONTEXT structure.

The Errata:
TPM 2.0 Library Specification 1.38 Errata 1.13, Section 2.19

.
To fix this, the handle type for savedHandle in the TPMS_CONTEXT structure should be changed from
TPMI_DH_CONTEXT to TPMI_DH_SAVE.
.
.
The commands affected by this change are TPM2_ContextLoad(), and TPM2_ContextSave()

The structures specification:
TCG TPM2 r1p59 Part2 Structures, Section 14.5
The type is now specified with the field 'savedHandle' having the type
TPMI_DH_SAVED.

The commands specification:
TCG TPM2 r1p59 Part 3 Commands, Section 28.2.2, Table 194 — TPM2_ContextSave Command
The 'saveHandle' field is specified as TPMI_DH_CONTEXT.

TCG TPM2 r1p59 Part 3 Commands, Section 28.3.2, Table 197 — TPM2_ContextLoad Response
The 'loadedHandle' in the response is specified as a TPMI_DH_CONTEXT.

The code:

TPMS_CONTEXT:

TPMI_DH_CONTEXT savedHandle; /* a handle indicating if the context is a session object or sequence objectSee Context Handle Values */

ContextSave:

TPMI_DH_CONTEXT saveHandle);

ContextLoad:

TPMI_DH_CONTEXT *loadedHandle);

The code seem to still specify all the fields as TPMI_DH_CONTEXT is there a reason for this?

And it seems to me as if the TPMI_DH_CONTEXT is no longer needed should it not be removed from the specification?

@AndreasFuchsTPM
Copy link
Member

Sounds good; even though it's a minor thing.
PRs welcome.

@AndreasFuchsTPM AndreasFuchsTPM added enhancement starter Good for getting familiar with the code abse labels May 8, 2024
@Superhepper
Copy link
Contributor Author

The code is simple enough to change. It might be harder to update the specification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement starter Good for getting familiar with the code abse
Projects
None yet
Development

No branches or pull requests

2 participants