Skip to content

Commit

Permalink
🐛 Oh, that's nasty.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihara committed Jun 19, 2023
1 parent e8deb74 commit eb6a1eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,12 @@ func main() {
_, err = cert.Verify(x509.VerifyOptions{
Intermediates: extraCerts,
Roots: roots,
CurrentTime: verificationTime,
KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageAny},
// LoTW intermediate certificates are *expected* to expire during
// the public key's lifetime, so we must verify it with time
// set to the day it was issued, rather than any other day,
// otherwise verification can fail for no good reason.
CurrentTime: cert.NotBefore.Add(time.Hour),
KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageAny},
})
check(err, "Failed to verify public key:")

Expand Down

0 comments on commit eb6a1eb

Please sign in to comment.