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

Support Created Loaded #506

Open
Firstyear opened this issue Mar 5, 2024 · 5 comments · May be fixed by #529
Open

Support Created Loaded #506

Firstyear opened this issue Mar 5, 2024 · 5 comments · May be fixed by #529

Comments

@Firstyear
Copy link
Contributor

CreateLoaded is required for key derivation. We should add it to this library to allow KDF usage for applications.

@Firstyear
Copy link
Contributor Author

So let's say I wanted to implement this. Looking at other parts of the code I'm thinking that it's going to be a call to:

extern "C" {
    pub fn Esys_CreateLoaded(
        esysContext: *mut ESYS_CONTEXT,
        parentHandle: ESYS_TR,
        shandle1: ESYS_TR,
        shandle2: ESYS_TR,
        shandle3: ESYS_TR,
        inSensitive: *const TPM2B_SENSITIVE_CREATE,
        inPublic: *const TPM2B_TEMPLATE,
        objectHandle: *mut ESYS_TR,
        outPrivate: *mut *mut TPM2B_PRIVATE,
        outPublic: *mut *mut TPM2B_PUBLIC,
    ) -> TSS2_RC;
}

This would go in tss-esapi/src/context/tpm_commands/object_commands.rs along with fn create / fn load since we are deriving a new object. Does this seem like that right start?

I'll need to figure out what to do with tests too.

@Superhepper
Copy link
Collaborator

Superhepper commented May 25, 2024

The commands or APIs are usually structured after in what section they appear in the TPM specification (if I am not mistaken).

@Superhepper
Copy link
Collaborator

That seems correct. There is even a comment at the bottom of that file indicating that that API has not been implemented yet.

@ionut-arm
Copy link
Member

Luckily this seems to not involve any new structures that need native implementations, which is usually 80% of the work for new commands..

@Firstyear
Copy link
Contributor Author

Thanks, I've started to work on this now :)

@Firstyear Firstyear linked a pull request Jun 5, 2024 that will close this issue
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 a pull request may close this issue.

3 participants