-
Notifications
You must be signed in to change notification settings - Fork 102
Add '/dev/tcm0' to default conf #841
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
Open
jouyouyun
wants to merge
1
commit into
tpm2-software:master
Choose a base branch
from
jouyouyun:master
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.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
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.
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.
put this logic in the tpm2-tss backend for the device tcti rather than tabrmd. This way everything using the tcti libraries gets this support. You'll have a dependency on the updated tpm2-tss library and tpm2-abrmd to support this.
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.
Thanks for your reply. TCM support has been added to tpm2-tss, see: tcti: Add '/dev/tcm0' to default conf . When the configuration of tctildr is empty, the default configuration will be automatically used to complete the initialization on the device with only tcm.
However, tpm2-abrmd specifies the configuration when initializing tctildr. If the configuration does not contain tcm, the initialization will fail on the device with only tcm, so this part of the code is added.
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.
So then why don't we just use NULL for the default and let the tcti-ldr search logic prevail.
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.
Yes, this seems feasible. I need to verify how to modify it.
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.
I apologize for the delayed response. After receiving your reply, I reviewed the code and found that in abrmd, the tcti_ctx needs to be constructed using the device path before using functions like tpm2_new/tpm2_init_tpm to complete the initialization.
It is not possible to reuse the TSS initialization function Tss2_Tcti_TctiLdr_Init for TSS2_TCTI_CONTEXT. Therefore, the functionality to parse the TCM device path still needs to be added to abrmd.
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.
Oh I think I finally understand the problem. If we pass NULL on devices that have TPM, abrmd will attempt tpmrm0 before tpm0, which is not what we want and on tcm devices it would find tcm0, is that right?
If so, make it an array of strings to try rather than parsing on a semi-colon.
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.
I also wonder if this is better off in a service file as tpm2-abrmd takes a tcti option. How do you start the service on tcm devices?
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.
TCM is compatible with the TPM 2.0 specification, the boot method is the same as TPM, only the device path is different.
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.
Yeah exactly, so what you do, you'll see these files under dist, is make tpm2-abrmd start up using the tcti option based on the presence of the TCM device