@@ -140,6 +140,11 @@ type WebFrontEndImpl struct {
140140 // `LegacyKeyIDPrefix` for more information.
141141 LegacyKeyIDPrefix string
142142
143+ // AccountURIPrefix is required to set the "accounturi" field of
144+ // dns-persist-01 challenges. MUST match the first entry of the VA's
145+ // AccountURIPrefixes field.
146+ AccountURIPrefix string
147+
143148 // Key policy.
144149 keyPolicy goodkey.KeyPolicy
145150
@@ -1245,19 +1250,26 @@ func (wfe *WebFrontEndImpl) prepChallengeForDisplay(
12451250 }
12461251
12471252 if challenge .Type == core .ChallengeTypeDNSPersist01 {
1248- // draft-ietf-acme-dns-persist-00 section 3.1 states, "Servers MUST NOT
1253+ // draft-ietf-acme-dns-persist-01 section 3.1 states, "Servers MUST NOT
12491254 // send more than 10 issuer domain names." Be aware of this if we ever
12501255 // support configuration of multiple CAA identities.
12511256 challenge .IssuerDomainNames = []string {wfe .DirectoryCAAIdentity }
12521257
1258+ // TODO(#8724): Once the configuration of AccountURIPrefix is required
1259+ // to be non-empty, this conditional can be removed.
1260+ if wfe .AccountURIPrefix != "" {
1261+ challenge .AccountURI = fmt .Sprintf ("%s%d" , wfe .AccountURIPrefix , authz .RegistrationID )
1262+ }
1263+
12531264 // dns-persist-01 does not use a token, but authorizations store a
12541265 // single token which gets unconditionally assigned to all challenge
12551266 // types during deserialization.
12561267 challenge .Token = ""
12571268 } else {
1258- // Belt and suspenders: we don't expect this to ever be populated
1269+ // Belt and suspenders: we don't expect these to ever be populated
12591270 // outside of this function, but just in case.
12601271 challenge .IssuerDomainNames = nil
1272+ challenge .AccountURI = ""
12611273 }
12621274}
12631275
0 commit comments