-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The Microsoft TPM2 and IBM SW TPM simulator both use an absolute value method of `expiration = -expiration` in ComputeAuthTimeout. As abs(Int32Min) cannot be represented an an int32, this expression evaluates to Int32Min. See https://github.com/microsoft/ms-tpm-20-ref/blob/b94f9f92c579b723a16be72a69efbbf9c35ce44e/TPMCmd/tpm/src/command/EA/Policy_spt.c#L189 The function goes on to cast expiration to UINT64. This can either be sign-extended or zero-extended, which is undefined behavior. If it is sign-extended, this carries the negative bit to create a large number (9.22 e+18 ms ~ 292471140.58 years). If it is zero-extended, this results in 2147483648000 ms ~ 68.1 years. Also, enable non-zero expirations on TestPolicySecret The TPM2.0 spec, Revision 1.16, states that TPM2_PolicySecret doesn't return a timeout/ticket for a nonzero expiration without a nonce.
- Loading branch information
Showing
1 changed file
with
72 additions
and
3 deletions.
There are no files selected for viewing
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