cedarcode / tpm-key_attestation

TPM 2.0 Key Attestation validation in ruby
https://rubygems.org/gems/tpm-key_attestation
Apache License 2.0
10 stars 6 forks source link

fix: race condition caused by the attribute `not_after` in a certificate being too short #9

Closed santiagorodriguez96 closed 4 years ago

santiagorodriguez96 commented 4 years ago

What

There seems to be a race condition between thenot_after attribute in OpenSSL::X509::Certificate and the execution that is causing the tests to be flaky.

Why

As I mentioned in the original discussion, the problem is that when we create a certificate, we make it that is only valid for just 60 seconds. Therefore, if the execution takes longer than 60 seconds for checking if the certificate is valid, eventually the certificate will be considered invalid.

Backtrace

How

To fix this, I decided to double the time in which a certificate is considered valid.

santiagorodriguez96 commented 4 years ago

Closing this PR given that this is not what is causing the test to be flaky