diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2020-06-12 11:49:45 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2020-06-12 11:49:45 -0600 |
commit | d81a69ef162ae027c91a45db85647ae9626f7c8d (patch) | |
tree | 5791cd9a55c6bc36803a3e476303fa153b726dba /modules/caddytls/acmeissuer.go | |
parent | 99dcc10f3183e7c4871e54a73de1d403ece183fd (diff) | |
parent | 6d03fb48f9189d286733913f189117d3cced3df5 (diff) |
Merge branch 'eab-fix'
Diffstat (limited to 'modules/caddytls/acmeissuer.go')
-rw-r--r-- | modules/caddytls/acmeissuer.go | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/modules/caddytls/acmeissuer.go b/modules/caddytls/acmeissuer.go index d610946..195ddeb 100644 --- a/modules/caddytls/acmeissuer.go +++ b/modules/caddytls/acmeissuer.go @@ -17,7 +17,6 @@ package caddytls import ( "context" "crypto/x509" - "encoding/base64" "fmt" "io/ioutil" "net/url" @@ -141,16 +140,12 @@ func (m *ACMEIssuer) makeIssuerTemplate() (certmagic.ACMEManager, error) { } if m.ExternalAccount != nil { - hmac, err := base64.StdEncoding.DecodeString(m.ExternalAccount.EncodedHMAC) - if err != nil { - return template, err - } - if m.ExternalAccount.KeyID == "" || len(hmac) == 0 { + if m.ExternalAccount.KeyID == "" || m.ExternalAccount.HMAC == "" { return template, fmt.Errorf("when an external account binding is specified, both key ID and HMAC are required") } template.ExternalAccount = &certmagic.ExternalAccountBinding{ KeyID: m.ExternalAccount.KeyID, - HMAC: hmac, + HMAC: m.ExternalAccount.HMAC, } } @@ -238,8 +233,8 @@ type ExternalAccountBinding struct { // The key identifier. KeyID string `json:"key_id,omitempty"` - // The base64-encoded HMAC. - EncodedHMAC string `json:"hmac,omitempty"` + // The HMAC. + HMAC string `json:"hmac,omitempty"` } // Interface guards |