Skip to content

Commit 317fcbd

Browse files
committed
Detailed comments
1 parent 4994409 commit 317fcbd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/ceremony/cert.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,14 @@ func makeTemplate(randReader io.Reader, profile *certProfile, pubKey []byte, tbc
258258
}
259259
validity := notAfter.Add(time.Second).Sub(notBefore)
260260
if ct == rootCert && validity >= 9132*24*time.Hour {
261+
// The value 9132 comes directly from the BRs, where it is described
262+
// as "approximately 25 years". It's equal to 365 * 25 + 7, to allow
263+
// for some leap years.
261264
return nil, fmt.Errorf("root cert validity too large: %s >= 25 years", validity)
262265
} else if (ct == intermediateCert || ct == crossCert) && validity >= 8*365*24*time.Hour {
266+
// Our CP/CPS states "at most 8 years", so we calculate that number
267+
// in the most conservative way (i.e. not accounting for leap years)
268+
// to give ourselves a buffer.
263269
return nil, fmt.Errorf("subordinate CA cert validity too large: %s >= 8 years", validity)
264270
}
265271
cert.NotBefore = notBefore

0 commit comments

Comments
 (0)