acme: remove dead code
The private encodePem() and unique() functions under the acme package had no call-sites and so can be removed. Change-Id: Ic617392e7cc9b9e795456626a623ba02df108694 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/676875 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Auto-Submit: Daniel McCarney <daniel@binaryparadox.net> Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
committed by
Gopher Robot
parent
ebc8e46315
commit
73f6362471
@@ -33,7 +33,6 @@ import (
|
|||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"encoding/pem"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
@@ -816,11 +815,5 @@ func tlsChallengeCert(san []string, opt []CertOption) (tls.Certificate, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// encodePEM returns b encoded as PEM with block of type typ.
|
|
||||||
func encodePEM(typ string, b []byte) []byte {
|
|
||||||
pb := &pem.Block{Type: typ, Bytes: b}
|
|
||||||
return pem.EncodeToMemory(pb)
|
|
||||||
}
|
|
||||||
|
|
||||||
// timeNow is time.Now, except in tests which can mess with it.
|
// timeNow is time.Now, except in tests which can mess with it.
|
||||||
var timeNow = time.Now
|
var timeNow = time.Now
|
||||||
|
|||||||
@@ -782,15 +782,3 @@ func decodePayload(v interface{}, r io.Reader) error {
|
|||||||
func challengeToken(domain, challType string, authzID int) string {
|
func challengeToken(domain, challType string, authzID int) string {
|
||||||
return fmt.Sprintf("token-%s-%s-%d", domain, challType, authzID)
|
return fmt.Sprintf("token-%s-%s-%d", domain, challType, authzID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func unique(a []string) []string {
|
|
||||||
seen := make(map[string]bool)
|
|
||||||
var res []string
|
|
||||||
for _, s := range a {
|
|
||||||
if s != "" && !seen[s] {
|
|
||||||
seen[s] = true
|
|
||||||
res = append(res, s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user