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
Minor commits for tpm2 #29426
Minor commits for tpm2 #29426
Conversation
Allow providing no bind key, and use ESYS_TR_NONE instead.
The test expects TPM2_CC_FIRST - 1 and TPM2_CC_LAST + 1 to be unsupported, but those are not necessarily invalid commands. Instead test known-invalid commands. Also add some more valid commands.
…ap max value Simplify the function with GREEDY_REALLOC_APPEND(). Also limit the size_t-sized max value to UINT32_MAX since that's the maximum of the range this searches, and the max parameter for tpm2_get_capability() is uint32_t.
…ring This matches the change to tpm2_seal(), which now accepts a Tpm2Context instead of a device string. This also allows using the same TPM context for sealing and unsealing, which will be required by (future) test code when sealing/unsealing using a transient key.
This brings the tpm2_supports_ecc_curve() api in line with the other tpm2_supports_*() functions, of returning a boolean.
624bb82
to
639dca0
Compare
@@ -402,6 +402,8 @@ static int tpm2_get_capability_handles( | |||
assert(ret_handles); | |||
assert(ret_n_handles); | |||
|
|||
max = MIN(max, UINT32_MAX); |
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.
wouldn't it make more sense to leave "max" as is is, but simply reduce the range passed to tpm2_get_capability(). i.e. allow ridiculous sizes to be returned if people ask for it, but never pass them to the tpm2 apis?
i.e. drop this line here, but instead change the 4th param of tpm2_get_capability() below to do MIN(max, UINT32_MAX)
?
These are some minor changes for tpm2, split out from #28519 and on top of #29425.