encoding/asn1: use GeneralizedTime for times outside the range of UTCTime.
Fixes issue #6976. LGTM=r R=golang-codereviews, r CC=golang-codereviews https://golang.org/cl/72080044
This commit is contained in:
parent
ab3538d779
commit
cb66b63918
@ -58,12 +58,6 @@ func main() {
|
|||||||
|
|
||||||
notAfter := notBefore.Add(*validFor)
|
notAfter := notBefore.Add(*validFor)
|
||||||
|
|
||||||
// end of ASN.1 time
|
|
||||||
endOfTime := time.Date(2049, 12, 31, 23, 59, 59, 0, time.UTC)
|
|
||||||
if notAfter.After(endOfTime) {
|
|
||||||
notAfter = endOfTime
|
|
||||||
}
|
|
||||||
|
|
||||||
serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
|
serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
|
||||||
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
|
serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user