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

ESYS: Support of Cp and RpHashes from Esys Layer #2932

Merged

Conversation

JuergenReppSIT
Copy link
Member

@JuergenReppSIT JuergenReppSIT commented Jan 16, 2025

  • The ESYS API is extended with the functions:
    Esys_GetCpHash, Esys_GetRpHash, and Esys_Abort.
    The cp hash can computed after the async call of a function. The rp hash
    after the finish call. If only the async call is executed to to compute the cp hash
    Esys_Abort has to be called to enable the execution of further ESYS commands.
  • The function Tss2_Sys_Abort to reset the SYS sate is added.
  • The state handling of Tss2_Sys_GetCpBuffer is changed.
  • An integration test is added.
  • A tcti module which can only used for tcti initialization is added.

Addresses: #2930.

@JuergenReppSIT JuergenReppSIT marked this pull request as draft January 16, 2025 10:22
@JuergenReppSIT JuergenReppSIT force-pushed the esys-cp-rp-hash-functions branch 6 times, most recently from cf151c6 to 9d9ffc1 Compare January 16, 2025 17:15
@JuergenReppSIT JuergenReppSIT marked this pull request as ready for review January 16, 2025 17:50
@JuergenReppSIT JuergenReppSIT marked this pull request as draft January 16, 2025 19:52
@JuergenReppSIT JuergenReppSIT force-pushed the esys-cp-rp-hash-functions branch from 1486a77 to 1bbdf2c Compare January 16, 2025 21:33
@JuergenReppSIT JuergenReppSIT marked this pull request as ready for review January 16, 2025 21:52
@JuergenReppSIT JuergenReppSIT marked this pull request as draft January 17, 2025 09:24
@JuergenReppSIT JuergenReppSIT force-pushed the esys-cp-rp-hash-functions branch 11 times, most recently from 65cfea1 to 0e3085c Compare January 17, 2025 19:29
@JuergenReppSIT JuergenReppSIT marked this pull request as ready for review January 17, 2025 19:47
@JuergenReppSIT JuergenReppSIT marked this pull request as draft January 17, 2025 19:49
@JuergenReppSIT JuergenReppSIT force-pushed the esys-cp-rp-hash-functions branch 2 times, most recently from 3647305 to 965c6dd Compare January 18, 2025 11:44
@JuergenReppSIT JuergenReppSIT force-pushed the esys-cp-rp-hash-functions branch 2 times, most recently from 9b3d480 to 8256d4d Compare January 25, 2025 15:55
@JuergenReppSIT JuergenReppSIT force-pushed the esys-cp-rp-hash-functions branch from 8256d4d to c0cb3b7 Compare February 3, 2025 20:21
@JuergenReppSIT JuergenReppSIT force-pushed the esys-cp-rp-hash-functions branch 2 times, most recently from 625602d to e61470a Compare February 7, 2025 08:57
The function is added to reset the internal state to enable a
second prepare call without finishing the complete sequence of
sys calls.

Signed-off-by: Juergen Repp <[email protected]>
The CP buffer should still be available before Tss2_ExecuteFinish is
called.

Signed-off-by: Juergen Repp <[email protected]>
The ESYS API is extended with the functions:
Esys_GetCpHash, Esys_GetRpHash, and Esys_Abort.
The cp hash can computed after the async call of a function.
The rp hash after the finish call. If only the async call is
executed to to compute the cp hash Esys_Abort has to be called
to enable the execution of further ESYS commands.
Addresses: tpm2-software#2930.

Signed-off-by: Juergen Repp <[email protected]>
@JuergenReppSIT JuergenReppSIT force-pushed the esys-cp-rp-hash-functions branch from e61470a to ef07be1 Compare February 7, 2025 09:05
@JuergenReppSIT JuergenReppSIT marked this pull request as ready for review February 7, 2025 09:33
includedir=@includedir@

Name: tss2-tcti-null
Description: TCTI library for debugging at the TCTI interface.
Copy link
Member

Choose a reason for hiding this comment

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

This description does not quite fit the purpose

r = Esys_GetSysContext(esys_ctx, &sys_ctx);
return_if_error(r, "Could not get Sys context");

return Tss2_Sys_Abort(sys_ctx);
Copy link
Member

Choose a reason for hiding this comment

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

I would first execute Tss2_Sys_Abort and only if that succeeds we set the state to ESYS_STATE_INIT.

size_t size,
const uint8_t *cmd_buf)
{
UNUSED(tcti_ctx);
Copy link
Member

Choose a reason for hiding this comment

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

I would add a LOG_WARNING to each of these null calls so that the user knows something is weird here.

Copy link
Member

@AndreasFuchsTPM AndreasFuchsTPM left a comment

Choose a reason for hiding this comment

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

Very few comments but LGTM otherwise

@JuergenReppSIT JuergenReppSIT force-pushed the esys-cp-rp-hash-functions branch from ef07be1 to 0759964 Compare February 10, 2025 20:15
A tcti module which can only used for tcti initialization is added.

Signed-off-by: Juergen Repp <[email protected]>
@JuergenReppSIT JuergenReppSIT force-pushed the esys-cp-rp-hash-functions branch from 0759964 to 1b12e09 Compare February 10, 2025 20:27
@AndreasFuchsTPM AndreasFuchsTPM merged commit fa60390 into tpm2-software:master Feb 19, 2025
25 checks passed
@AndreasFuchsTPM AndreasFuchsTPM added this to the 4.2.0 milestone Feb 19, 2025
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