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 - help needed with key duplication for another example #450

Open
Firstyear opened this issue Oct 6, 2023 · 0 comments
Open

Support - help needed with key duplication for another example #450

Firstyear opened this issue Oct 6, 2023 · 0 comments

Comments

@Firstyear
Copy link
Contributor

Hi there,

I was working again on another example of TPM usage, this time for key duplication. However, I am once again stuck. :(

The following is the code that I have been testing - it will be polished before I submit it as an example to this repo.

https://gist.github.com/Firstyear/d743900a24aacc1a4b7cbe4a9ec0e06c

This is failing on line 355, with a policy error:

2023-10-06T01:51:44.338409Z DEBUG basic_openssl_tpm_test::tests: ctx duplicate
WARNING:esys:src/tss2-esys/api/Esys_Duplicate.c:354:Esys_Duplicate_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_Duplicate.c:116:Esys_Duplicate() Esys Finish ErrorCode (0x0000099d)
2023-10-06T01:51:44.361317Z ERROR tss_esapi::context::tpm_commands::duplication_commands: Error when performing duplication: a policy check failed (associated with session number 1)

I have been modeling the code "as close as possible" to tss-esapi/tests/integration_tests/context_tests/tpm_commands/duplication_commands_tests.rs as that's the only reference I could find for this.

Could someone please help review this so that I can get this to work?

As a second follow up, I can't seem to work out policy sessions with passwords or authValues. I can see there is https://docs.rs/tss-esapi/latest/tss_esapi/struct.Context.html#method.policy_auth_value to gate on these during the session, but setting a value in https://docs.rs/tss-esapi/latest/tss_esapi/struct.Context.html#method.create doesn't seem to work, and it's not clear how to provide the auth_value during a key load or duplicate. What am I missing here so that I can make a second example that uses authValues/passwords for the key duplication process?

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

1 participant