-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "dns-account-01" support from draft-ietf-acme-scoped-dns-challenges #435
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1597,30 +1597,27 @@ func (wfe *WebFrontEndImpl) makeChallenge( | |
func (wfe *WebFrontEndImpl) makeChallenges(authz *core.Authorization, request *http.Request) error { | ||
var chals []*core.Challenge | ||
|
||
// Authorizations for a wildcard identifier only get a DNS-01 challenges to | ||
// match Boulder/Let's Encrypt wildcard issuance policy | ||
// Determine which challenge types are enabled for this identifier | ||
var enabledChallenges []string | ||
if strings.HasPrefix(authz.Identifier.Value, "*.") { | ||
chal, err := wfe.makeChallenge(acme.ChallengeDNS01, authz, request) | ||
if err != nil { | ||
return err | ||
} | ||
chals = []*core.Challenge{chal} | ||
// Authorizations for a wildcard identifier get DNS-based challenges to | ||
// match Boulder/Let's Encrypt wildcard issuance policy | ||
enabledChallenges = []string{acme.ChallengeDNS01, acme.ChallengeDNSAccount01} | ||
} else { | ||
// IP addresses get HTTP-01 and TLS-ALPN challenges | ||
var enabledChallenges []string | ||
if authz.Identifier.Type == acme.IdentifierIP { | ||
enabledChallenges = []string{acme.ChallengeHTTP01, acme.ChallengeTLSALPN01} | ||
} else { | ||
// Non-wildcard, non-IP identifier authorizations get all of the enabled challenge types | ||
enabledChallenges = []string{acme.ChallengeHTTP01, acme.ChallengeTLSALPN01, acme.ChallengeDNS01} | ||
enabledChallenges = []string{acme.ChallengeHTTP01, acme.ChallengeTLSALPN01, acme.ChallengeDNS01, acme.ChallengeDNSAccount01} | ||
} | ||
for _, chalType := range enabledChallenges { | ||
chal, err := wfe.makeChallenge(chalType, authz, request) | ||
if err != nil { | ||
return err | ||
} | ||
chals = append(chals, chal) | ||
} | ||
for _, chalType := range enabledChallenges { | ||
chal, err := wfe.makeChallenge(chalType, authz, request) | ||
if err != nil { | ||
return err | ||
} | ||
chals = append(chals, chal) | ||
} | ||
|
||
// Lock the authorization for writing to update the challenges | ||
|
@@ -2377,8 +2374,12 @@ func (wfe *WebFrontEndImpl) updateChallenge( | |
|
||
// If the identifier value is for a wildcard domain then strip the wildcard | ||
// prefix before dispatching the validation to ensure the base domain is | ||
// validated. | ||
ident.Value = strings.TrimPrefix(ident.Value, "*.") | ||
// validated. Set a flag to indicate validation scope. | ||
wildcard := false | ||
if strings.HasPrefix(ident.Value, "*.") { | ||
ident.Value = strings.TrimPrefix(ident.Value, "*.") | ||
wildcard = true | ||
} | ||
|
||
// Confirm challenge status again and update it immediately before sending it to the VA | ||
prob = nil | ||
|
@@ -2395,8 +2396,11 @@ func (wfe *WebFrontEndImpl) updateChallenge( | |
return | ||
} | ||
|
||
// Reconstruct account URL for use in scoped validation methods | ||
acctURL := wfe.relativeEndpoint(request, fmt.Sprintf("%s%s", acctPath, existingAcct.ID)) | ||
|
||
// Submit a validation job to the VA, this will be processed asynchronously | ||
wfe.va.ValidateChallenge(ident, existingChal, existingAcct) | ||
wfe.va.ValidateChallenge(ident, existingChal, existingAcct, acctURL, wildcard) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same feedback here: letsencrypt/boulder#7387 (comment) |
||
|
||
// Lock the challenge for reading in order to write the response | ||
existingChal.RLock() | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels slightly awkward to pass both a *core.Account and an acctURL, given that one can be constructed from the other, but also given that the construction method is
acctURL := wfe.relativeEndpoint(request, fmt.Sprintf("%s%s", acctPath, newAcct.ID))
and half of those values are inaccessible here in the VA, I think this is fine.