From 924082bb492e2e13e4a26f327717fe6d26c9aaf1 Mon Sep 17 00:00:00 2001 From: Raal Goff Date: Thu, 8 Sep 2022 10:09:37 +0800 Subject: [PATCH] fix linter errors --- authority/authority.go | 13 ++++++------- authority/tls.go | 3 +++ cas/softcas/softcas.go | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/authority/authority.go b/authority/authority.go index 31c2890e..efd7ab66 100644 --- a/authority/authority.go +++ b/authority/authority.go @@ -794,14 +794,13 @@ func (a *Authority) startCRLGenerator() error { go func() { for { - select { - case <-a.crlTicker.C: - log.Println("Regenerating CRL") - err := a.GenerateCertificateRevocationList() - if err != nil { - log.Printf("ERROR: authority.crlGenerator encountered an error when regenerating the CRL: %v", err) - } + <-a.crlTicker.C + log.Println("Regenerating CRL") + err := a.GenerateCertificateRevocationList() + if err != nil { + log.Printf("ERROR: authority.crlGenerator encountered an error when regenerating the CRL: %v", err) } + } }() diff --git a/authority/tls.go b/authority/tls.go index 8d3bd73d..5cde341c 100644 --- a/authority/tls.go +++ b/authority/tls.go @@ -549,6 +549,9 @@ func (a *Authority) Revoke(ctx context.Context, revokeOpts *RevokeOptions) error // Save as revoked in the Db. 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 err = a.GenerateCertificateRevocationList() diff --git a/cas/softcas/softcas.go b/cas/softcas/softcas.go index 03adc667..ed909d6d 100644 --- a/cas/softcas/softcas.go +++ b/cas/softcas/softcas.go @@ -3,8 +3,8 @@ package softcas import ( "context" "crypto" - "crypto/rsa" "crypto/rand" + "crypto/rsa" "crypto/x509" "time"