@@ -211,17 +211,23 @@ func main() {
211211 }
212212 ctp = ctpolicy .New (pubc , c .RA .CTLogGroups2 , c .RA .InformationalCTLogs , logger , scope )
213213
214- // TODO(patf): remove once RA.authorizationLifetimeDays is deployed
215- authorizationLifetime := 300 * 24 * time .Hour
216- if c .RA .AuthorizationLifetimeDays != 0 {
217- authorizationLifetime = time .Duration (c .RA .AuthorizationLifetimeDays ) * 24 * time .Hour
214+ // Baseline Requirements v1.8.1 section 4.2.1: "any reused data, document,
215+ // or completed validation MUST be obtained no more than 398 days prior
216+ // to issuing the Certificate". If unconfigured or the configured value is
217+ // greater than 397 days, bail out.
218+ if c .RA .AuthorizationLifetimeDays <= 0 || c .RA .AuthorizationLifetimeDays > 397 {
219+ cmd .Fail ("authorizationLifetimeDays value must be greater than 0 and less than 398" )
218220 }
219-
220- // TODO(patf): remove once RA.pendingAuthorizationLifetimeDays is deployed
221- pendingAuthorizationLifetime := 7 * 24 * time .Hour
222- if c .RA .PendingAuthorizationLifetimeDays != 0 {
223- pendingAuthorizationLifetime = time .Duration (c .RA .PendingAuthorizationLifetimeDays ) * 24 * time .Hour
221+ authorizationLifetime := time .Duration (c .RA .AuthorizationLifetimeDays ) * 24 * time .Hour
222+
223+ // The Baseline Requirements v1.8.1 state that validation tokens "MUST
224+ // NOT be used for more than 30 days from its creation". If unconfigured
225+ // or the configured value pendingAuthorizationLifetimeDays is greater
226+ // than 29 days, bail out.
227+ if c .RA .PendingAuthorizationLifetimeDays <= 0 || c .RA .PendingAuthorizationLifetimeDays > 29 {
228+ cmd .Fail ("pendingAuthorizationLifetimeDays value must be greater than 0 and less than 30" )
224229 }
230+ pendingAuthorizationLifetime := time .Duration (c .RA .PendingAuthorizationLifetimeDays ) * 24 * time .Hour
225231
226232 // TODO(#5851): Remove these fallbacks when the old config keys are gone.
227233 if c .RA .GoodKey .WeakKeyFile == "" && c .RA .WeakKeyFile != "" {
0 commit comments