]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/x509/pkix: consider now==NextUpdate to be expired.
authorAnmol Sethi <anmol@aubble.com>
Thu, 19 Oct 2017 22:29:43 +0000 (18:29 -0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 6 Nov 2017 04:28:24 +0000 (04:28 +0000)
If the current time is equal to the NextUpdate time, then the CRL
should be considered expired.

Fixes #22568.

Change-Id: I55bcc95c881097e826d43eb816a43b9b377b0265
Reviewed-on: https://go-review.googlesource.com/71972
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/crypto/x509/pkix/pkix.go

index 4dfbb6c81fbe1e07987a563016e25dd68055032d..3cf884e4eb85c9a31c2cf77ca0ef21147a90bd37 100644 (file)
@@ -247,9 +247,9 @@ type CertificateList struct {
        SignatureValue     asn1.BitString
 }
 
-// HasExpired reports whether now is past the expiry time of certList.
+// HasExpired reports whether certList should have been updated by now.
 func (certList *CertificateList) HasExpired(now time.Time) bool {
-       return now.After(certList.TBSCertList.NextUpdate)
+       return !now.Before(certList.TBSCertList.NextUpdate)
 }
 
 // TBSCertificateList represents the ASN.1 structure of the same name. See RFC