Raal Goff преди 4 години
родител
ревизия
924082bb49
променени са 3 файла, в които са добавени 10 реда и са изтрити 8 реда
  1. 6 7
      authority/authority.go
  2. 3 0
      authority/tls.go
  3. 1 1
      cas/softcas/softcas.go

+ 6 - 7
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)
 			}
+
 		}
 	}()
 

+ 3 - 0
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()

+ 1 - 1
cas/softcas/softcas.go

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