-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add create primary key example #215
Conversation
…te with create and create primary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments. Looks great though!!
2cfeb99
to
f0c2f02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!!! Will merge momentarily.
#ifndef WOLFTPM_WINAPI | ||
/* Move storage key into persistent NV */ | ||
printf("Storing Primary key to handle 0x%08x\n", persistHandle); | ||
rc = wolfTPM2_NVStoreKey(&dev, hierarchy, &primary, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the primary key be stored as persistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the primary key be stored as persistent?
Hi @JasonMac219 , on TPM's where the internal NV is available it is possible. On platforms like Windows TBS there is no way to store the primary key. You would need to recreate it using the same template and unique at startup which will create the same primary key, since it uses the same seed. Once it is created a temporary (memory based) handle is returned, which you can use until next reboot.
Confirmed the "unique" string is used for the primary key derivation from seed.
The primary key must be recreated on Windows TBS as it cannot be persisted to NV. The public template (including unique value) is used for the KDF based on hierarchy seed.