Changed return type for "ChallengesFor".

This commit is contained in:
Damian Poddebniak 2016-02-13 23:01:28 +01:00
parent 8a173b1208
commit 01cee65079
6 changed files with 7 additions and 10 deletions

View File

@ -88,7 +88,7 @@ type CertificateAuthority interface {
// PolicyAuthority defines the public interface for the Boulder PA
type PolicyAuthority interface {
WillingToIssue(id AcmeIdentifier, regID int64) error
ChallengesFor(AcmeIdentifier, *jose.JsonWebKey) ([]Challenge, [][]int, error)
ChallengesFor(AcmeIdentifier, *jose.JsonWebKey) ([]Challenge, [][]int)
}
// StorageGetter are the Boulder SA's read-only methods

View File

@ -212,7 +212,7 @@ func (pa PolicyAuthorityImpl) WillingToIssue(id core.AcmeIdentifier, regID int64
// acceptable for the given identifier.
//
// Note: Current implementation is static, but future versions may not be.
func (pa PolicyAuthorityImpl) ChallengesFor(identifier core.AcmeIdentifier, accountKey *jose.JsonWebKey) ([]core.Challenge, [][]int, error) {
func (pa PolicyAuthorityImpl) ChallengesFor(identifier core.AcmeIdentifier, accountKey *jose.JsonWebKey) ([]core.Challenge, [][]int) {
challenges := []core.Challenge{}
if pa.enabledChallenges[core.ChallengeTypeHTTP01] {
@ -242,5 +242,5 @@ func (pa PolicyAuthorityImpl) ChallengesFor(identifier core.AcmeIdentifier, acco
shuffledCombos[i] = combinations[comboIdx]
}
return shuffled, shuffledCombos, nil
return shuffled, shuffledCombos
}

View File

@ -196,10 +196,7 @@ func TestChallengesFor(t *testing.T) {
t.Errorf("Error unmarshaling JWK: %v", err)
}
challenges, combinations, err := pa.ChallengesFor(core.AcmeIdentifier{}, accountKey)
if err != nil {
t.Errorf("Error generating challenges: %v", err)
}
challenges, combinations := pa.ChallengesFor(core.AcmeIdentifier{}, accountKey)
test.Assert(t, len(challenges) == len(enabledChallenges), "Wrong number of challenges returned")
test.Assert(t, len(combinations) == len(enabledChallenges), "Wrong number of combinations returned")

View File

@ -330,7 +330,7 @@ func (ra *RegistrationAuthorityImpl) NewAuthorization(request core.Authorization
}
// Create validations. The WFE will update them with URIs before sending them out.
challenges, combinations, err := ra.PA.ChallengesFor(identifier, &reg.Key)
challenges, combinations := ra.PA.ChallengesFor(identifier, &reg.Key)
expires := ra.clk.Now().Add(ra.pendingAuthorizationLifetime)

View File

@ -258,7 +258,7 @@ func initAuthorities(t *testing.T) (*DummyValidationAuthority, *sa.SQLStorageAut
AuthzInitial.RegistrationID = Registration.ID
challenges, combinations, err := pa.ChallengesFor(AuthzInitial.Identifier, &Registration.Key)
challenges, combinations := pa.ChallengesFor(AuthzInitial.Identifier, &Registration.Key)
AuthzInitial.Challenges = challenges
AuthzInitial.Combinations = combinations

View File

@ -199,7 +199,7 @@ func (ca *MockCA) RevokeCertificate(serial string, reasonCode core.RevocationCod
type MockPA struct{}
func (pa *MockPA) ChallengesFor(identifier core.AcmeIdentifier, key *jose.JsonWebKey) (challenges []core.Challenge, combinations [][]int, err error) {
func (pa *MockPA) ChallengesFor(identifier core.AcmeIdentifier, key *jose.JsonWebKey) (challenges []core.Challenge, combinations [][]int) {
return
}