-
Notifications
You must be signed in to change notification settings - Fork 96
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
WIP: Add support for enabling the SVN-limited hierarchy #470
Draft
stefanberger
wants to merge
7
commits into
master
Choose a base branch
from
stefanberger/svn-hierarchy-enablement
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stefanberger
changed the title
Add support for enabling the SVN-limited hierarchy
WIP: Add support for enabling the SVN-limited hierarchy
Oct 17, 2024
stefanberger
force-pushed
the
stefanberger/svn-hierarchy-enablement
branch
3 times, most recently
from
October 18, 2024 15:26
646931e
to
db3eccc
Compare
stefanberger
commented
Oct 22, 2024
src/tpm_tpm2_interface.c
Outdated
@@ -871,6 +871,13 @@ static TPM_BOOL TPM2_WasManufactured(void) | |||
return g_wasManufactured; | |||
} | |||
|
|||
static TPM_RESULT TPM2_RecreateSvnBaseSecret(void) | |||
{ | |||
if (_plat__SvnBaseSecretRecreate() == 0) |
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.
Should probably trigger the storing of the persistent state.
stefanberger
force-pushed
the
stefanberger/svn-hierarchy-enablement
branch
2 times, most recently
from
October 23, 2024 14:35
ddb3fa0
to
fd3b337
Compare
8 tasks
Set the currentSvn number to a number derived from the library version. Start out with currentSvn '0'. The number would then follow the following numbering scheme relative to possible future libtpms versions: v0.10 : 0x0000 v0.10.1 : 0x0001 v0.10.2 : 0x0002 v0.11 : 0x0010 v0.11.1 : 0x0011 v1.0 : 0x0020 v1.0.1 : 0x0021 Signed-off-by: Stefan Berger <[email protected]>
MAX_SVN and its related function are not currently used, so comment them out. Signed-off-by: Stefan Berger <[email protected]>
Introduce a per-TPM SVN base secret of 16 bytes that is to be used for the SVN-limited hierarchy to derive its secrets from when the 16bit SVN number is mixed in. Create it at first manufacturing time. Signed-off-by: Stefan Berger <[email protected]>
Use the TPM's unique 16 byte SVN base secret to deterministically calculate the TpmFirmwareSvnSecret from it by first hashing this 16 byte number and then adding the 16bit SVN to the hash. Signed-off-by: Stefan Berger <[email protected]>
In several locations where #if SVN_LIMITED_SUPPORT is used to deactivate SVN hierarchy related code, add a profile attribute check for whether the svn-limited-hierarchy attribute's flag is set. If it is not set, handle it in the same way is if SVN hierarchy support was disabled. Signed-off-by: Stefan Berger <[email protected]>
Implement support for a profile attribute svn-limited-hierarchy that must be set for SVN-limited hiearchy support to be enabled. Bump up the StateFormatLevel to 8 and store the SVN base secret starting with StateFormatLevel 8. Signed-off-by: Stefan Berger <[email protected]>
Implement TPMLIB_RecreateSvnBaseSecret() to allow the user to recreate the SVN base secret. Trigger the storage of the persistent state. Add a man page. Signed-off-by: Stefan Berger <[email protected]>
stefanberger
force-pushed
the
stefanberger/svn-hierarchy-enablement
branch
from
November 12, 2024 13:27
fd3b337
to
54671af
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for the SVN-limited hierarchy and allow enabling it with a profile attribute svn-limited-hierarchy.
The SVN limited hierarchy is based on a 16 bytes SVN base secret that is unique per vTPM instance and is created as a random number on first manufacturing.