Open Firstyear opened 6 months ago
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.
The commands or APIs are usually structured after in what section they appear in the TPM specification (if I am not mistaken).
That seems correct. There is even a comment at the bottom of that file indicating that that API has not been implemented yet.
Luckily this seems to not involve any new structures that need native implementations, which is usually 80% of the work for new commands..
Thanks, I've started to work on this now :)
CreateLoaded is required for key derivation. We should add it to this library to allow KDF usage for applications.