tpm2-software / tpm2-tools

The source repository for the Trusted Platform Module (TPM2.0) tools
https://tpm2-software.github.io
708 stars 377 forks source link

Implement duplicate #833

Closed williamcroberts closed 5 years ago

williamcroberts commented 6 years ago

Implement a tool to use the duplicate command.

anhk commented 5 years ago

any progress?

I need to duplicate an object to another TPM2

williamcroberts commented 5 years ago

-----Original Message----- From: Terry AN (安宏奎) [mailto:notifications@github.com] Sent: Monday, October 22, 2018 1:31 AM To: tpm2-software/tpm2-tools tpm2-tools@noreply.github.com Cc: Roberts, William C william.c.roberts@intel.com; Author author@noreply.github.com Subject: Re: [tpm2-software/tpm2-tools] Implement duplicate (#833)

any progress?

I need to duplicate an object to another TPM2

Nothing yet

GlovePuppet commented 5 years ago

Turns out I need this one too.

tpm2_duplicate is going to be a wrapper around Esys_Duplicate(). I have some questions about the implementation and how to name cmd line parameters.

I may have questions about tpm2_import too

GlovePuppet commented 5 years ago

I made some progress with this one but I have some more questions:

1) encryptionKeyIn/encryptionKeyOut are just the keys, raw binary data (TPM2B_DATA). The temptation is to use files_save_tpm_context_to_path() and files_load_bytes_from_path() but that comes with a lot of error checking. Is there a preferred method of loading/saving TPM2B_DATA?

2) How to get from to a TPMI_ALG_PUBLIC (key_type from command line params) to a TPMT_SYM_DEF_OBJECT? Do I have to fill in the structure 'by hand' or is there an existing library function? (I didn't find one)

I have similar questions about the seed & duplicate data but getting some insight on 1 & 2 first would be helpful

williamcroberts commented 5 years ago

merged: https://github.com/tpm2-software/tpm2-tools/commit/c2d24df0ce3b44259fc9e36013684ca4269b3f8c