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

Add Tss2_Tcti_Null_Context struct #2950

Open
AndreasFuchsTPM opened this issue Feb 25, 2025 · 3 comments
Open

Add Tss2_Tcti_Null_Context struct #2950

AndreasFuchsTPM opened this issue Feb 25, 2025 · 3 comments

Comments

@AndreasFuchsTPM
Copy link
Member

Add

static const TSS2_TCTI_CONTEXT_COMMON_V2 Tss2_Tcti_Null_Context = {
    v1.magic = TCTI_NULL_MAGIC;
    v1.version = 2,
};

for quick access without requiring to call Tss2_Tcti_Null_Init() first...

@joholl
Copy link
Collaborator

joholl commented Feb 26, 2025

I missed this completely. What do we use the null tcti for?

@JuergenReppSIT
Copy link
Member

The idea was to enable the computation of the cp hash if no device exists. e.g.:
tpm2_getrandom -f 32 --cphash=cphash -Tnull

@joholl
Copy link
Collaborator

joholl commented Feb 27, 2025

Ah thanks, that makes sense.

What came to my mind is incorporating the null tcti symbols in SAPI as weak symbols... (and giving a clear description of went wrong if the user forgets to link a real tcti and trying to communicating with the tpm). I did not think this through, though. I know I've struggled in the past with multiple definition of tcti symbols (tctildr, and tcti-fuzz etc.) so we should not do this until we understand all implications (i.e. for static linking etc.).

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

No branches or pull requests

3 participants