Skip to content

Commit d3db851

Browse files
benileocpu
authored andcommitted
remove regID from WillingToIssue (letsencrypt#1957)
The `regID` parameter in the PA's `WillingToIssue` function was originally used for whitelisting purposes, but is not used any longer. This PR removes it.
1 parent 77e64fe commit d3db851

File tree

8 files changed

+12
-18
lines changed

8 files changed

+12
-18
lines changed

cmd/cert-checker/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func (c *certChecker) checkCert(cert core.Certificate) (problems []string) {
206206
// Check that the PA is still willing to issue for each name in DNSNames + CommonName
207207
for _, name := range append(parsedCert.DNSNames, parsedCert.Subject.CommonName) {
208208
id := core.AcmeIdentifier{Type: core.IdentifierDNS, Value: name}
209-
if err = c.pa.WillingToIssue(id, cert.RegistrationID); err != nil {
209+
if err = c.pa.WillingToIssue(id); err != nil {
210210
problems = append(problems, fmt.Sprintf("Policy Authority isn't willing to issue for '%s': %s", name, err))
211211
}
212212
}

core/interfaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ type CertificateAuthority interface {
8181

8282
// PolicyAuthority defines the public interface for the Boulder PA
8383
type PolicyAuthority interface {
84-
WillingToIssue(domain AcmeIdentifier, regID int64) error
84+
WillingToIssue(domain AcmeIdentifier) error
8585
ChallengesFor(domain AcmeIdentifier) (challenges []Challenge, validCombinations [][]int)
8686
}
8787

csr/csr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func VerifyCSR(csr *x509.CertificateRequest, maxNames int, keyPolicy *goodkey.Ke
6464
if err := pa.WillingToIssue(core.AcmeIdentifier{
6565
Type: core.IdentifierDNS,
6666
Value: name,
67-
}, regID); err != nil {
67+
}); err != nil {
6868
badNames = append(badNames, name)
6969
}
7070
}

csr/csr_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func (pa *mockPA) ChallengesFor(identifier core.AcmeIdentifier) (challenges []co
2626
return
2727
}
2828

29-
func (pa *mockPA) WillingToIssue(id core.AcmeIdentifier, regID int64) error {
29+
func (pa *mockPA) WillingToIssue(id core.AcmeIdentifier) error {
3030
if id.Value == "bad-name.com" {
3131
return errors.New("")
3232
}

policy/pa.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,6 @@ const (
9494
// octets: https://tools.ietf.org/html/rfc1035#page-10
9595
maxLabelLength = 63
9696
maxDNSIdentifierLength = 255
97-
98-
// whitelistedPartnerRegID is the registartion ID we check for to see if we need
99-
// to skip the domain whitelist (but not the blacklist). This is for an
100-
// early partner integration during the beta period and should be removed
101-
// later.
102-
whitelistedPartnerRegID = 131
10397
)
10498

10599
var dnsLabelRegexp = regexp.MustCompile("^[a-z0-9][a-z0-9-]{0,62}$")
@@ -163,7 +157,7 @@ var (
163157
// where comparison is case-independent (normalized to lower case)
164158
//
165159
// If WillingToIssue returns an error, it will be of type MalformedRequestError.
166-
func (pa *AuthorityImpl) WillingToIssue(id core.AcmeIdentifier, regID int64) error {
160+
func (pa *AuthorityImpl) WillingToIssue(id core.AcmeIdentifier) error {
167161
if id.Type != core.IdentifierDNS {
168162
return errInvalidIdentifier
169163
}

policy/pa_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ func TestWillingToIssue(t *testing.T) {
140140

141141
// Test for invalid identifier type
142142
identifier := core.AcmeIdentifier{Type: "ip", Value: "example.com"}
143-
err = pa.WillingToIssue(identifier, 100)
143+
err = pa.WillingToIssue(identifier)
144144
if err != errInvalidIdentifier {
145145
t.Error("Identifier was not correctly forbidden: ", identifier)
146146
}
147147

148148
// Test syntax errors
149149
for _, tc := range testCases {
150150
identifier := core.AcmeIdentifier{Type: core.IdentifierDNS, Value: tc.domain}
151-
err := pa.WillingToIssue(identifier, 100)
151+
err := pa.WillingToIssue(identifier)
152152
if err != tc.err {
153153
t.Errorf("WillingToIssue(%q) = %q, expected %q", tc.domain, err, tc.err)
154154
}
@@ -157,7 +157,7 @@ func TestWillingToIssue(t *testing.T) {
157157
// Test domains that are equal to public suffixes
158158
for _, domain := range shouldBeTLDError {
159159
identifier := core.AcmeIdentifier{Type: core.IdentifierDNS, Value: domain}
160-
err := pa.WillingToIssue(identifier, 100)
160+
err := pa.WillingToIssue(identifier)
161161
if err != errICANNTLD {
162162
t.Error("Identifier was not correctly forbidden: ", identifier, err)
163163
}
@@ -166,7 +166,7 @@ func TestWillingToIssue(t *testing.T) {
166166
// Test blacklisting
167167
for _, domain := range shouldBeBlacklisted {
168168
identifier := core.AcmeIdentifier{Type: core.IdentifierDNS, Value: domain}
169-
err := pa.WillingToIssue(identifier, 100)
169+
err := pa.WillingToIssue(identifier)
170170
if err != errBlacklisted {
171171
t.Error("Identifier was not correctly forbidden: ", identifier, err)
172172
}
@@ -175,7 +175,7 @@ func TestWillingToIssue(t *testing.T) {
175175
// Test acceptance of good names
176176
for _, domain := range shouldBeAccepted {
177177
identifier := core.AcmeIdentifier{Type: core.IdentifierDNS, Value: domain}
178-
if err := pa.WillingToIssue(identifier, 100); err != nil {
178+
if err := pa.WillingToIssue(identifier); err != nil {
179179
t.Error("Identifier was incorrectly forbidden: ", identifier, err)
180180
}
181181
}

ra/ra.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ func (ra *RegistrationAuthorityImpl) NewAuthorization(ctx context.Context, reque
345345
identifier.Value = strings.ToLower(identifier.Value)
346346

347347
// Check that the identifier is present and appropriate
348-
if err = ra.PA.WillingToIssue(identifier, regID); err != nil {
348+
if err = ra.PA.WillingToIssue(identifier); err != nil {
349349
return authz, err
350350
}
351351

wfe/wfe_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func (pa *mockPA) ChallengesFor(identifier core.AcmeIdentifier) (challenges []co
181181
return
182182
}
183183

184-
func (pa *mockPA) WillingToIssue(id core.AcmeIdentifier, regID int64) error {
184+
func (pa *mockPA) WillingToIssue(id core.AcmeIdentifier) error {
185185
return nil
186186
}
187187

0 commit comments

Comments
 (0)