From 62962b695bee2f7551e29b529c7401237f0b7a2a Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sun, 6 Mar 2022 16:52:40 +0100 Subject: [PATCH] Implement golangci-lint suggestions --- internal/ocspsource/ocspsource.go | 3 +-- internal/ocspsource/opensslcertdb.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/ocspsource/ocspsource.go b/internal/ocspsource/ocspsource.go index cbe6433..6e67ff6 100644 --- a/internal/ocspsource/ocspsource.go +++ b/internal/ocspsource/ocspsource.go @@ -40,7 +40,6 @@ type CertificateIssuer struct { responderKey crypto.Signer caCertificate *x509.Certificate certDb *OpenSSLCertDB - certificateList []*x509.Certificate } // NewIssuer is used to construct a new CertificateIssuer instance @@ -73,7 +72,7 @@ func (i *CertificateIssuer) publicKeyMatches(requestHash []byte, algorithm crypt } issuerHash := h.Sum(nil) - return bytes.Compare(issuerHash, requestHash) == 0, nil + return bytes.Equal(issuerHash, requestHash), nil } // buildUnknownResponse builds the OCSP response template for an unknown certificate diff --git a/internal/ocspsource/opensslcertdb.go b/internal/ocspsource/opensslcertdb.go index a62c264..a420587 100644 --- a/internal/ocspsource/opensslcertdb.go +++ b/internal/ocspsource/opensslcertdb.go @@ -67,7 +67,7 @@ func (o *OpenSSLCertDB) update() error { _ = f.Close() }(f) - newContent := make(map[string]*ocsp.Response, 0) + newContent := make(map[string]*ocsp.Response) b := bufio.NewReader(f) lastLine := false for {