-
Notifications
You must be signed in to change notification settings - Fork 74
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 ECC AIK template and cache; Work around for CertifyCreation #72
Conversation
276b1d0
to
a3b82f6
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.
For the most part this looks good, just some comment nits.
AIK-RSA AIK-ECC EK-ECC SRK-ECC will all be cached
a3b82f6
to
d3ec7f3
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.
Looks good, just fix the formatting/structure comments, and then submit.
d3ec7f3
to
f6fe21f
Compare
Certain TPM (the one on my Lenovo X1 Carbon) cannot handle CertifyCreation with a null signing key correctly (will throw TPM_RC_INSUFFICENT error). This work around will try CertifyCreation again with a non-null (AIK-ECC) signing handle if that happens.
f6fe21f
to
d86d009
Compare
@jkl73 I understand that this is PR is from 2020, but I catch this issue even with your patch on Lenovo X1 Yoga 3rd Gen (Windows 10). Still getting I am not a TPM expert, but I observe that I cannot get ECC SRK without administrative rights, probably because after reboot Windows initializes only RSA one by default. Maybe it's connected, because this patch tries to use ECC cached key. |
I'm not familiar with how admin rights affecting TPM on windows, does it work with admin rights?
Also maybe your TPM doesn't support the default AIKTemplateECC parameter (CurveNISTP256)? Or maybe you can try to use the RSA SRK to do the workaround. |
Basically Windows doesn't allow you to get ECC SRK without admin rights for some reason. But after getting it for the first time (for example by spawning one-shot Windows service which just calling I didn't try with admin rights with production-ready piece of software because it does not meant to run under admin.
Probably, but it successfully passing those lines:
Otherwise it would return error here, isn't it?
We are already using RSA SRK and for the majority of users it works flawlessly, sealing, unsealing, etc. But during testing getting error at unsealing stage with this Lenovo Yoga. Does it worth a try to change this line from: |
Yes, I think it's worth to try, at least it should reveal if the problem is related to the ecc algo or not. |
Certain TPM (the one on my Lenovo X1 carbon) cannot handle CeritfyCreation with a null signing handle correctly. It will throw a TPM_RC_INSUFFICIENT error when we trying to do that.
One work around is that we pass in a non-null signing handle into CertifyCreation.
This PR implement this work around as well as add a ECC AIK template.
AIK ECC key will be cached for performance concerns.
I picked the handle 0x81008FFF (I picked randomly from "Storage -> Available" from Table 11 from https://trustedcomputinggroup.org/wp-content/uploads/RegistryOfReservedTPM2HandlesAndLocalities_v1p1_pub.pdf