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 · 3 comments
Open

Support Created Loaded #506

Firstyear opened this issue Mar 5, 2024 · 3 comments

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.

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

2 participants