Closed rikuks closed 1 year ago
Hi, @rikuks, thanks for this pull request!
The official documentation for Tbsi_Get_TCG_Log promises to return TBS_E_INVALID_CONTEXT
if passed an invalid context. I think we should avoid taking a dependency on something that might be broken without a change to the external API.
https://github.com/google/go-tpm/blob/3270509f088425fc9499bc9b7b8ff0811119bedb/tpmutil/tbs/tbs_windows.go#L261-L265
Overview
The following image shows the result of reverse engineering tbs.dll.
The context that is the argument of
Tbsi_Get_TCG_Log
is unnecessary because it is never used in processing.Thus it can be written as follows.
Conclusion
Contexts can be eliminated, thus reducing overhead.