From 089e3aea4fad4400676ea25adf1b57ee0cee857b Mon Sep 17 00:00:00 2001 From: David Cowden Date: Mon, 11 May 2020 21:26:21 -0700 Subject: [PATCH] acme/challenge: Fix error return type on KeyAuthorization In golang, one should always return error types rather than interfaces that conform to an error protocol. Why? Because of this: https://play.golang.org/p/MVa5vowuNRo Feels ~~like JavaScript~~ bad, man. --- acme/challenge.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acme/challenge.go b/acme/challenge.go index bf398678..fe3acd04 100644 --- a/acme/challenge.go +++ b/acme/challenge.go @@ -621,7 +621,7 @@ func (dc *dns01Challenge) validate(jwk *jose.JSONWebKey, vo validateOptions) (ch // KeyAuthorization creates the ACME key authorization value from a token // and a jwk. -func KeyAuthorization(token string, jwk *jose.JSONWebKey) (string, *Error) { +func KeyAuthorization(token string, jwk *jose.JSONWebKey) (string, error) { thumbprint, err := jwk.Thumbprint(crypto.SHA256) if err != nil { return "", ServerInternalErr(errors.Wrap(err, "error generating JWK thumbprint"))