Skip to content

Commit

Permalink
Truncate rather than round OCSP time.
Browse files Browse the repository at this point in the history
Without this, we generate OCSP responses that are not yet valid half the time.
  • Loading branch information
jsha committed Aug 20, 2015
1 parent f19974e commit dd172b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ocsp/ocsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ func (s StandardSigner) Sign(req SignRequest) ([]byte, error) {
return nil, cferr.New(cferr.OCSPError, cferr.IssuerMismatch)
}

// Round thisUpdate times to the nearest hour
thisUpdate := time.Now().Round(time.Hour)
// Round thisUpdate times down to the nearest hour
thisUpdate := time.Now().Truncate(time.Hour)
nextUpdate := thisUpdate.Add(s.interval)

status, ok := statusCode[req.Status]
Expand Down

0 comments on commit dd172b5

Please sign in to comment.