Skip to content

Commit

Permalink
*: make linters happy
Browse files Browse the repository at this point in the history
  • Loading branch information
abursavich committed Mar 16, 2020
1 parent d06eff9 commit 8d8502f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dynamic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func TestMTLS(t *testing.T) {
handler := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
fmt.Fprint(w, msg)
})
go http.Serve(NewListener(lis, serverCfg), handler)
go http.Serve(NewListener(lis, serverCfg), handler) //nolint:errcheck

// create client
client := &http.Client{
Expand Down
12 changes: 9 additions & 3 deletions dynamictls.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,12 @@ func readCerts(h hash.Hash, pairs []keyPair) ([]tls.Certificate, error) {
return nil, fmt.Errorf("dynamictls: cert parsing error: %w", err)
}
certs = append(certs, cert)
h.Write(certPEMBlock)
h.Write(keyPEMBlock)
if _, err := h.Write(certPEMBlock); err != nil {
return nil, fmt.Errorf("dynamictls: hash write error: %w", err)
}
if _, err := h.Write(keyPEMBlock); err != nil {
return nil, fmt.Errorf("dynamictls: hash write error: %w", err)
}
}
return certs, nil
}
Expand All @@ -392,7 +396,9 @@ func readCAs(h hash.Hash, files []string) (*x509.CertPool, error) {
return nil, fmt.Errorf("dynamictls: certificate authorities read error: %w", err)
}
pool.AppendCertsFromPEM(caPEMCerts)
h.Write(caPEMCerts)
if _, err := h.Write(caPEMCerts); err != nil {
return nil, fmt.Errorf("dynamictls: hash write error: %w", err)
}
}
return pool, nil
}
Expand Down
4 changes: 0 additions & 4 deletions dynamictls_hidden_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package dynamictls_test

import (
"log"
"net/http"
)

var (
Expand All @@ -15,11 +14,8 @@ var (
certFile, keyFile, caFile string
primaryCertFile, primaryKeyFile string
secondaryCertFile, secondaryKeyFile string
rootCAsFile, clientCAsFile string
)

func makeRequests(*http.Client) {}

func check(err error) {
if err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion grpctls/grpctls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestGRPC(t *testing.T) {
srv := grpc.NewServer(grpc.Creds(serverCreds))
pb.RegisterTestServiceServer(srv, &testServiceServer{})
defer srv.GracefulStop()
go srv.Serve(lis)
go srv.Serve(lis) //nolint:errcheck

// create client
_, clientCertPEM, clientKeyPEM, err := tlstest.GenerateCert(&tlstest.CertOptions{
Expand Down
1 change: 1 addition & 0 deletions internal/http2/ciphers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package http2
// A list of the possible cipher suite ids. Taken from
// https://www.iana.org/assignments/tls-parameters/tls-parameters.txt

//nolint:unused,varcheck,deadcode
const (
cipherxTLSxNULLxWITHxNULLxNULL uint16 = 0x0000
cipherxTLSxRSAxWITHxNULLxMD5 uint16 = 0x0001
Expand Down

0 comments on commit 8d8502f

Please sign in to comment.