wolfSSL / wolfTPM

wolfTPM is a highly portable TPM 2.0 library, designed for embedded use.
https://www.wolfssl.com
GNU General Public License v2.0
230 stars 55 forks source link

Is 1,000,000 a reasonable value for TPM_TIMEOUT_TRIES? #349

Closed gojimmypi closed 2 months ago

gojimmypi commented 2 months ago

See wolftpm/tpm2_types.h#L388 for #define TPM_TIMEOUT_TRIES 1000000.

Perhaps a few orders of magnitude smaller is more reasonable? Even if after, say 10 attempts, should the I2C operation keep trying?

This might be a good place for an optional user-specified timeout, too.

dgarske commented 2 months ago

It is an overridable macro. For slower microcontrollers a value like 1,000 or 10,000 may be more appropriate. To avoid a busy spin you can also implement XTPM_WAIT() to enable some sleep() / context switching.

gojimmypi commented 2 months ago

ok, I'll leave it.