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

Add TPM 2 application key support for Windows #274

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mjg59
Copy link
Collaborator

@mjg59 mjg59 commented Apr 28, 2022

There's currently no support for creating application keys on Windows systems. This patch transitions the Windows key type to specifically refer to attestation keys, and reuses the existing wrapped key support for application keys. This allows the creation of keys in the platform store, while still allowing said keys to be manipulated with existing TPM functionality rather than duplicating it.

@google-cla
Copy link

google-cla bot commented Apr 28, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

For more information, open the CLA check for this pull request.

@mjg59 mjg59 force-pushed the windows_application_keys branch 2 times, most recently from 08ff268 to 3e6fc9e Compare April 29, 2022 00:07
@hslatman
Copy link
Contributor

hslatman commented Nov 10, 2022

Hey @mjg59,

Is there anything I can do to help move this forward? I've been working on getting signing to work with application keys on Windows, building on top of your contributions here, combined with some changes from @brandonweeks. It would be great if my changes can be upstreamed, instead of having to maintain a separate fork.

My current progress is here: hslatman#1

@hslatman hslatman mentioned this pull request May 9, 2023
@mjg59 mjg59 force-pushed the windows_application_keys branch 4 times, most recently from 6e414e2 to beedb2d Compare May 24, 2023 20:49
@mjg59 mjg59 marked this pull request as ready for review May 24, 2023 21:23
mjg59 and others added 4 commits May 25, 2023 14:15
There's currently no support for creating application keys on Windows systems. This patch transitions the Windows key type to specifically refer to attestation keys, and reuses the existing wrapped key support for application keys. This allows the creation of keys in the platform store, while still allowing said keys to be manipulated with existing TPM functionality rather than duplicating it.
When generating a new key using a Windows TPM, a `wrappedKey20` was
returned, which couldn't be used for signing on Windows, as it's
backed by a `windowsTPM`. The `wrappedKey20` seems to be a type
specifically aimed at usage with a `wrappedTPM20`, which in turn
seems to be used on Linux and for testing, but not when instantiating
a TPM on Windows.

This commit adds the `newWindowsKey20` function, which returns
a key backed by a `windowsTPM`. The key is a `windowsAK20`,
now also conforming to the `key` interface, so that it can be used
for signing purposes.
My system is returning RCScheme if TPM_ALG_NULL is passed here. This should
be causing the key's default scheme to be used, but for some reason it
seems unhappy. Just explicitly set the scheme for now to avoid that.
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

Successfully merging this pull request may close these issues.

2 participants