Update to TPM 2.0 Reference Implementation v184#25
Conversation
|
You likely want to massage my "WIP" commit, either to by just dropping the "WIP" while stating if it has limitations (it used to have back then due to the bug) or by folding everything thing into one commit that jumps to "V184" directly. |
|
If there's a new upstream, then we should switch. |
|
@jenswi-linaro We are in contact with the TCG regarding upstreaming the TPM patches. However, they need to clarify/resolve some process challenges first. Will keep you posted. |
| // While all of the TPM reference implementation is provided "AS IS" without any | ||
| // warranty, the current design and implementation of CertifyX509 are considered | ||
| // to be especially unsuitable for product use. | ||
| #define CC_CertifyX509 CC_YES |
There was a problem hiding this comment.
I think it makes sense to disable this command, since it has been announced deprecated since V184 [1].
relates to #18
There was a problem hiding this comment.
Agreed. Thanks for digging this out!
There was a problem hiding this comment.
Thanks. I have added a corresponding commit to this PR.
29edf0c to
53a9155
Compare
|
I have just amended this PR such that it does not require upstream changes in the TCG's reference implementation of TPM 2.0 anymore. Cloning https://github.com/TrustedComputingGroup/TPM and checking out tag V184 will now work. I hope this has removed the main obstacle for accepting this PR. |
| Error: | ||
| return 0; | ||
| } | ||
| # endif |
There was a problem hiding this comment.
How does this correlate with microsoft/ms-tpm-20-ref@fcccc82? Please leave an explanation of that only temporarily or even permanently obsoletes the upstream tpm patch (because it was incorrect or so)?
There was a problem hiding this comment.
The #if / #endif here is analogous to BnToOsslMath.c and BnToWolfMath.c in the TPM 2.0 reference implementation. I believe the patch you cite is correct. I decided to be consistent with the other BnTo...Math.c files in the TPM 2.0 reference implementation. This forced me to define LIBRARY_COMPATIBILITY_CHECK - exactly because the patch you cite is missing upstream.
There was a problem hiding this comment.
Then please leave a comment that this code becomes obsolete once upstream is fixed.
| #define BN_WORD_INITIALIZED(name, initial) \ | ||
| BN_STRUCT(name, RADIX_BITS) name##_; \ | ||
| bigNum name = BnInitializeWord( \ | ||
| (bigNum) & name##_, BN_STRUCT_ALLOCATION(RADIX_BITS), initial) |
There was a problem hiding this comment.
Won't this give us duplicate definition warnings? Or how to you prevent that the incorrect upstream definition is (also) processed?
There was a problem hiding this comment.
Yes, you are right. I have added an #undef to suppress this warning and also fixed other warnings introduced by earlier commits in this PR in this commit. Remaining warnings seem to have nothing to do with the changes in this PR.
|
Again, please check if patches 3 and 4 are actually logically separate or rather fix-ups that should go into patch 2 directly. Or, if they touch code that existed before the version update, you could move bits into a separate patch between 1 and 2. |
The TPM 2.0 Reference Implementation has apparently moved to a new home at https://github.com/TrustedComputingGroup/TPM This commit contains changes to enable building optee_ftpm with the TPM 2.0 Reference Implementation v184. This is the most recent version tag at the time of writing. Co-authored-by: Sven Bauer <svenbauer@siemens.com> Signed-off-by: Sven Bauer <svenbauer@siemens.com>
Command TPM2_CertifyX509 has been declared "deprecated" in TPM spec v184. Hence, the switch to enable it is now set to "CC_NO". Signed-off-by: Sven Bauer <svenbauer@siemens.com>
4ab6c10 to
5f6f753
Compare
|
Done. |
This PR contains changes to base optee_ftpm on the TPM 2.0 Reference Implementation v184. This is the most recent version tag at the time of writing.
It depends on the following fix for the TPM reference implementation: https://github.com/svenbauer-work/TPM/tree/a9665960ddfb92b8a140cd8d37d29342ddb05b3b
Also, note that The Official TPM 2.0 Reference Implementation seems to have moved from Microsoft to the TCG and can now be found here: https://github.com/TrustedComputingGroup/TPM