fix linter errors

This commit is contained in:
Raal Goff 2022-09-08 10:09:37 +08:00
parent d2483f3a70
commit 924082bb49
3 changed files with 10 additions and 8 deletions

View file

@ -794,14 +794,13 @@ func (a *Authority) startCRLGenerator() error {
go func() { go func() {
for { for {
select { <-a.crlTicker.C
case <-a.crlTicker.C:
log.Println("Regenerating CRL") log.Println("Regenerating CRL")
err := a.GenerateCertificateRevocationList() err := a.GenerateCertificateRevocationList()
if err != nil { if err != nil {
log.Printf("ERROR: authority.crlGenerator encountered an error when regenerating the CRL: %v", err) log.Printf("ERROR: authority.crlGenerator encountered an error when regenerating the CRL: %v", err)
} }
}
} }
}() }()

View file

@ -549,6 +549,9 @@ func (a *Authority) Revoke(ctx context.Context, revokeOpts *RevokeOptions) error
// Save as revoked in the Db. // Save as revoked in the Db.
err = a.revoke(revokedCert, rci) err = a.revoke(revokedCert, rci)
if err != nil {
return errs.Wrap(http.StatusInternalServerError, err, "authority.Revoke", opts...)
}
// Generate a new CRL so CRL requesters will always get an up-to-date CRL whenever they request it // Generate a new CRL so CRL requesters will always get an up-to-date CRL whenever they request it
err = a.GenerateCertificateRevocationList() err = a.GenerateCertificateRevocationList()

View file

@ -3,8 +3,8 @@ package softcas
import ( import (
"context" "context"
"crypto" "crypto"
"crypto/rsa"
"crypto/rand" "crypto/rand"
"crypto/rsa"
"crypto/x509" "crypto/x509"
"time" "time"