diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2015-12-26 01:44:46 +0100 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2015-12-26 01:44:46 +0100 |
commit | bc9b3520410ff64e4d15c946ab922f00e9698232 (patch) | |
tree | 9084d8eae3527c227f9772144c17413d8c988ccf | |
parent | f087a951510f3047d6d2a74e7a296a4eafd68fa6 (diff) |
bikeshading
-rw-r--r-- | challange_dns.go | 2 | ||||
-rw-r--r-- | challange_http.go | 2 | ||||
-rw-r--r-- | challange_tls_sni.go | 11 | ||||
-rw-r--r-- | challenge.go | 8 | ||||
-rw-r--r-- | errors.go | 4 |
5 files changed, 21 insertions, 6 deletions
diff --git a/challange_dns.go b/challange_dns.go index 8d2a213..c0480a8 100644 --- a/challange_dns.go +++ b/challange_dns.go @@ -1 +1,3 @@ package acme + +// not implemented diff --git a/challange_http.go b/challange_http.go index bcc4691..b1fe9c0 100644 --- a/challange_http.go +++ b/challange_http.go @@ -12,7 +12,7 @@ import ( const wellKnown = `/.well-known/acme-challenge/` func init() { - registerChallenge(ChallengeHTTP) + registerSolver(ChallengeHTTP) } type httpChallenge struct { diff --git a/challange_tls_sni.go b/challange_tls_sni.go index 8d2a213..5c03fce 100644 --- a/challange_tls_sni.go +++ b/challange_tls_sni.go @@ -1 +1,12 @@ package acme + +import "errors" + +var errZ = errors.New("invalid Z") + +func SNIName(z string) (string, error) { + if len(z) != 64 { + return "", errZ + } + return z[0:32] + "." + z[32:64] + ".acme.invalid", nil +} diff --git a/challenge.go b/challenge.go index 2571012..dc4a5eb 100644 --- a/challenge.go +++ b/challenge.go @@ -11,10 +11,12 @@ type Solver interface { Abort() error } -var canSolve = make(map[ChallengeType]bool) -var errTimeOut = errors.New("time out") +var ( + canSolve = make(map[ChallengeType]bool) + errTimeOut = errors.New("time out") +) -func registerChallenge(c ChallengeType) { +func registerSolver(c ChallengeType) { canSolve[c] = true } @@ -6,7 +6,7 @@ var ( ErrBadCSR = errors.New("CSR is unacceptable") ErrBadNonce = errors.New("Client sent an unacceptable anti-replay nonce") ErrConnection = errors.New("Server could not connect to the client for DV") - ErrDnssec = errors.New("Server could not validate a DNSSEC signed domain") + ErrDNSSEC = errors.New("Server could not validate a DNSSEC signed domain") ErrMalformed = errors.New("Request message was malformed") ErrServerInternal = errors.New("Server experienced an internal error") ErrTLS = errors.New("Server experienced a TLS error during DV") @@ -19,7 +19,7 @@ var urnErrors = map[string]error{ "urn:acme:error:badCSR": ErrBadCSR, "urn:acme:error:badNonce": ErrBadNonce, "urn:acme:error:connection": ErrConnection, - "urn:acme:error:dnssec": ErrDnssec, + "urn:acme:error:dnssec": ErrDNSSEC, "urn:acme:error:malformed": ErrMalformed, "urn:acme:error:serverInternal": ErrServerInternal, "urn:acme:error:tls": ErrTLS, |