Skip to content

Commit

Permalink
Fix linter complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpherrinm committed May 24, 2024
1 parent 3a2c27a commit 4f2f91a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion challtestsrv/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (s *ChallSrv) caaAnswers(q dns.Question) []dns.RR {
}

type writeMsg interface {
WriteMsg(*dns.Msg) error
WriteMsg(msg *dns.Msg) error
}

type dnsToHTTPWriter struct {
Expand Down
2 changes: 1 addition & 1 deletion challtestsrv/dnsone.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (s *doh) ListenAndServe() error {
}

// dohServer creates a DoH server.
func dohServer(address string, tlsCert, tlsCertKey string, handler http.Handler) (challengeServer, error) {
func dohServer(address string, tlsCert, tlsCertKey string, handler http.Handler) (*doh, error) {

Check failure on line 75 in challtestsrv/dnsone.go

View workflow job for this annotation

GitHub Actions / go-lint-checks

dohServer returns interface (github.com/letsencrypt/pebble/v2/challtestsrv.challengeServer) (ireturn)
return &doh{
&http.Server{
Handler: handler,
Expand Down
5 changes: 1 addition & 4 deletions challtestsrv/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ func (e DNSRequestEvent) Type() RequestEventType {
// in the question name is removed.
func (e DNSRequestEvent) Key() string {
key := e.Question.Name
if strings.HasSuffix(key, ".") {
key = strings.TrimSuffix(key, ".")
}
return key
return strings.TrimSuffix(key, ".")
}

// TLSALPNRequestEvent corresponds to a TLS request received by
Expand Down
2 changes: 1 addition & 1 deletion challtestsrv/httpone.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (c challHTTPServer) Shutdown() error {
// resulting challengeServer will run a HTTPS server with a self-signed
// certificate useful for HTTP-01 -> HTTPS HTTP-01 redirect responses. If HTTPS
// is false the resulting challengeServer will run an HTTP server.
func httpOneServer(address string, handler http.Handler, https bool) challengeServer {
func httpOneServer(address string, handler http.Handler, https bool) challHTTPServer {

Check failure on line 184 in challtestsrv/httpone.go

View workflow job for this annotation

GitHub Actions / go-lint-checks

httpOneServer returns interface (github.com/letsencrypt/pebble/v2/challtestsrv.challengeServer) (ireturn)
// If HTTPS is requested build a TLS Config that uses the self-signed
// certificate generated at startup.
var tlsConfig *tls.Config
Expand Down
6 changes: 3 additions & 3 deletions challtestsrv/tlsalpnone.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (s *ChallSrv) ServeChallengeCertFunc(k *ecdsa.PrivateKey) func(*tls.ClientH
kaHash := sha256.Sum256([]byte(ka))
extValue, err := asn1.Marshal(kaHash[:])
if err != nil {
return nil, fmt.Errorf("failed marshalling hash OCTET STRING: %s", err)
return nil, fmt.Errorf("failed marshaling hash OCTET STRING: %w", err)
}
certTmpl := x509.Certificate{
SerialNumber: big.NewInt(1729),
Expand All @@ -84,7 +84,7 @@ func (s *ChallSrv) ServeChallengeCertFunc(k *ecdsa.PrivateKey) func(*tls.ClientH
}
certBytes, err := x509.CreateCertificate(rand.Reader, &certTmpl, &certTmpl, k.Public(), k)
if err != nil {
return nil, fmt.Errorf("failed creating challenge certificate: %s", err)
return nil, fmt.Errorf("failed creating challenge certificate: %w", err)
}
return &tls.Certificate{
Certificate: [][]byte{certBytes},
Expand All @@ -107,7 +107,7 @@ func (c challTLSServer) ListenAndServe() error {
return c.Server.ListenAndServeTLS("", "")
}

func tlsALPNOneServer(address string, challSrv *ChallSrv) challengeServer {
func tlsALPNOneServer(address string, challSrv *ChallSrv) challTLSServer {

Check failure on line 110 in challtestsrv/tlsalpnone.go

View workflow job for this annotation

GitHub Actions / go-lint-checks

tlsALPNOneServer returns interface (github.com/letsencrypt/pebble/v2/challtestsrv.challengeServer) (ireturn)
key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
if err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion va/va.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

"github.com/miekg/dns"

"github.com/letsencrypt/pebble/v2/challtestsrv"
"github.com/letsencrypt/pebble/v2/acme"
"github.com/letsencrypt/pebble/v2/challtestsrv"
"github.com/letsencrypt/pebble/v2/core"
"github.com/letsencrypt/pebble/v2/db"
)
Expand Down

0 comments on commit 4f2f91a

Please sign in to comment.