diff --git a/core/core_test.go b/core/core_test.go index 095595836..411e35f3a 100644 --- a/core/core_test.go +++ b/core/core_test.go @@ -82,17 +82,20 @@ func TestMergeChallenge(t *testing.T) { t1 := time.Now() t2 := time.Now().Add(-5 * time.Hour) challenge := Challenge{ + Type: ChallengeTypeSimpleHTTP, Status: StatusPending, Validated: &t1, Token: "asdf", } response := Challenge{ + Type: ChallengeTypeSimpleHTTP, Status: StatusValid, Validated: &t2, Token: "qwer", TLS: &tls, } merged := Challenge{ + Type: ChallengeTypeSimpleHTTP, Status: StatusPending, Validated: &t1, Token: "asdf", diff --git a/core/objects.go b/core/objects.go index 3b979224d..df7521377 100644 --- a/core/objects.go +++ b/core/objects.go @@ -15,7 +15,7 @@ import ( "strings" "time" - jose "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/letsencrypt/go-jose" + "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/letsencrypt/go-jose" ) // AcmeStatus defines the state of a given authorization @@ -75,7 +75,10 @@ const ( ChallengeTypeDNS = "dns" ) +// The suffix appended to pseudo-domain names in DVSNI challenges const DVSNISuffix = "acme.invalid" + +// The label attached to DNS names in DNS challenges const DNSPrefix = "_acme-challenge" func (pd *ProblemDetails) Error() string { @@ -311,9 +314,9 @@ func (ch Challenge) MergeResponse(resp Challenge) Challenge { *ch.TLS = true } - case DVSNI: + case ChallengeTypeDVSNI: fallthrough - case DNS: + case ChallengeTypeDNS: // For dvsni and dns, only "validation" is client-provided if resp.Validation != nil { ch.Validation = resp.Validation diff --git a/core/objects_test.go b/core/objects_test.go index 21cb9d402..c10605a0d 100644 --- a/core/objects_test.go +++ b/core/objects_test.go @@ -10,6 +10,8 @@ import ( "net/url" "testing" + "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/letsencrypt/go-jose" + "github.com/letsencrypt/boulder/test" ) @@ -60,7 +62,7 @@ func TestSanityCheck(t *testing.T) { chall.TLS = &tls test.Assert(t, chall.IsSane(false), "IsSane should be true") } else if challengeType == ChallengeTypeDVSNI || challengeType == ChallengeTypeDNS { - chall.Validation = new(AcmeJWS) + chall.Validation = new(jose.JsonWebSignature) test.Assert(t, chall.IsSane(true), "IsSane should be true") } }