@@ -39,9 +39,9 @@ import (
3939 berrors "github.com/letsencrypt/boulder/errors"
4040 "github.com/letsencrypt/boulder/features"
4141 "github.com/letsencrypt/boulder/goodkey"
42+ "github.com/letsencrypt/boulder/issuance"
4243 blog "github.com/letsencrypt/boulder/log"
4344 sapb "github.com/letsencrypt/boulder/sa/proto"
44- bsigner "github.com/letsencrypt/boulder/signer"
4545)
4646
4747// Miscellaneous PKIX OIDs that we need to refer to
@@ -167,42 +167,42 @@ type internalIssuer struct {
167167 cert * x509.Certificate
168168 ocspSigner crypto.Signer
169169
170- // Only one of cfsslSigner and boulderSigner will be non-nill
170+ // Only one of cfsslSigner and boulderIssuer will be non-nill
171171 cfsslSigner localSigner
172- boulderSigner * bsigner. Signer
172+ boulderIssuer * issuance. Issuer
173173}
174174
175- func makeInternalIssuers (issuers []bsigner. Config , lifespanOCSP time.Duration ) (issuerMaps , error ) {
175+ func makeInternalIssuers (configs []issuance. IssuerConfig , lifespanOCSP time.Duration ) (issuerMaps , error ) {
176176 issuersByAlg := make (map [x509.PublicKeyAlgorithm ]* internalIssuer , 2 )
177- issuersByName := make (map [string ]* internalIssuer , len (issuers ))
178- issuersByID := make (map [int64 ]* internalIssuer , len (issuers ))
179- for _ , issuer := range issuers {
180- signer , err := bsigner . NewSigner ( issuer )
177+ issuersByName := make (map [string ]* internalIssuer , len (configs ))
178+ issuersByID := make (map [int64 ]* internalIssuer , len (configs ))
179+ for _ , config := range configs {
180+ issuer , err := issuance . New ( config )
181181 if err != nil {
182182 return issuerMaps {}, err
183183 }
184184 ii := & internalIssuer {
185- cert : issuer . Issuer ,
186- ocspSigner : issuer .Signer ,
187- boulderSigner : signer ,
185+ cert : config . Cert ,
186+ ocspSigner : config .Signer ,
187+ boulderIssuer : issuer ,
188188 }
189- if issuer .Profile .UseForRSALeaves {
189+ if config .Profile .UseForRSALeaves {
190190 if issuersByAlg [x509 .RSA ] != nil {
191191 return issuerMaps {}, errors .New ("Multiple issuer certs for RSA are not allowed" )
192192 }
193193 issuersByAlg [x509 .RSA ] = ii
194194 }
195- if issuer .Profile .UseForECDSALeaves {
195+ if config .Profile .UseForECDSALeaves {
196196 if issuersByAlg [x509 .ECDSA ] != nil {
197197 return issuerMaps {}, errors .New ("Multiple issuer certs for ECDSA are not allowed" )
198198 }
199199 issuersByAlg [x509 .ECDSA ] = ii
200200 }
201- if issuersByName [issuer . Issuer .Subject .CommonName ] != nil {
201+ if issuersByName [config . Cert .Subject .CommonName ] != nil {
202202 return issuerMaps {}, errors .New ("Multiple issuer certs with the same CommonName are not supported" )
203203 }
204- issuersByName [issuer . Issuer .Subject .CommonName ] = ii
205- issuersByID [idForIssuer ( issuer . Issuer )] = ii
204+ issuersByName [config . Cert .Subject .CommonName ] = ii
205+ issuersByID [idForCert ( config . Cert )] = ii
206206 }
207207 return issuerMaps {issuersByAlg , issuersByName , issuersByID }, nil
208208}
@@ -245,15 +245,15 @@ func makeCFSSLInternalIssuers(issuers []Issuer, policy *cfsslConfig.Signing, lif
245245 issuersByAlg [x509 .ECDSA ] = ii
246246 }
247247 issuersByName [cn ] = ii
248- issuersByID [idForIssuer (iss .Cert )] = ii
248+ issuersByID [idForCert (iss .Cert )] = ii
249249 }
250250 return issuerMaps {issuersByAlg , issuersByName , issuersByID }, nil
251251}
252252
253- // idForIssuer generates a stable ID for an issuer certificate. This
253+ // idForCert generates a stable ID for an issuer certificate. This
254254// is used for identifying which issuer issued a certificate in the
255255// certificateStatus table.
256- func idForIssuer (cert * x509.Certificate ) int64 {
256+ func idForCert (cert * x509.Certificate ) int64 {
257257 h := sha256 .Sum256 (cert .Raw )
258258 return big .NewInt (0 ).SetBytes (h [:4 ]).Int64 ()
259259}
@@ -268,7 +268,7 @@ func NewCertificateAuthorityImpl(
268268 clk clock.Clock ,
269269 stats prometheus.Registerer ,
270270 cfsslIssuers []Issuer ,
271- boulderIssuers []bsigner. Config ,
271+ boulderIssuers []issuance. IssuerConfig ,
272272 keyPolicy goodkey.KeyPolicy ,
273273 logger blog.Logger ,
274274 orphanQueue * goque.Queue ,
@@ -600,7 +600,7 @@ func (ca *CertificateAuthorityImpl) IssuePrecertificate(ctx context.Context, iss
600600 RegID : regID ,
601601 Ocsp : ocspResp .Response ,
602602 Issued : nowNanos ,
603- IssuerID : idForIssuer (issuer .cert ),
603+ IssuerID : idForCert (issuer .cert ),
604604 }
605605
606606 _ , err = ca .sa .AddPrecertificate (ctx , req )
@@ -617,7 +617,7 @@ func (ca *CertificateAuthorityImpl) IssuePrecertificate(ctx context.Context, iss
617617 RegID : regID ,
618618 OCSPResp : ocspResp .Response ,
619619 Precert : true ,
620- IssuerID : idForIssuer (issuer .cert ),
620+ IssuerID : idForCert (issuer .cert ),
621621 })
622622 }
623623 return nil , err
@@ -686,11 +686,11 @@ func (ca *CertificateAuthorityImpl) IssueCertificateForPrecertificate(ctx contex
686686
687687 var certDER []byte
688688 if features .Enabled (features .NonCFSSLSigner ) {
689- issuanceReq , err := bsigner .RequestFromPrecert (precert , scts )
689+ issuanceReq , err := issuance .RequestFromPrecert (precert , scts )
690690 if err != nil {
691691 return nil , err
692692 }
693- certDER , err = issuer .boulderSigner .Issue (issuanceReq )
693+ certDER , err = issuer .boulderIssuer .Issue (issuanceReq )
694694 if err != nil {
695695 return nil , err
696696 }
@@ -711,7 +711,7 @@ func (ca *CertificateAuthorityImpl) IssueCertificateForPrecertificate(ctx contex
711711 ca .log .AuditInfof ("Signing success: serial=[%s] names=[%s] csr=[%s] certificate=[%s]" ,
712712 serialHex , strings .Join (precert .DNSNames , ", " ), hex .EncodeToString (req .DER ),
713713 hex .EncodeToString (certDER ))
714- err = ca .storeCertificate (ctx , req .RegistrationID , req .OrderID , precert .SerialNumber , certDER , idForIssuer (issuer .cert ))
714+ err = ca .storeCertificate (ctx , req .RegistrationID , req .OrderID , precert .SerialNumber , certDER , idForCert (issuer .cert ))
715715 if err != nil {
716716 return nil , err
717717 }
@@ -795,13 +795,13 @@ func (ca *CertificateAuthorityImpl) issuePrecertificateInner(ctx context.Context
795795 if features .Enabled (features .NonCFSSLSigner ) {
796796 ca .log .AuditInfof ("Signing: serial=[%s] names=[%s] csr=[%s]" ,
797797 serialHex , strings .Join (csr .DNSNames , ", " ), hex .EncodeToString (csr .Raw ))
798- certDER , err = issuer .boulderSigner .Issue (& bsigner .IssuanceRequest {
798+ certDER , err = issuer .boulderIssuer .Issue (& issuance .IssuanceRequest {
799799 PublicKey : csr .PublicKey ,
800800 Serial : serialBigInt .Bytes (),
801801 CommonName : csr .Subject .CommonName ,
802802 DNSNames : csr .DNSNames ,
803803 IncludeCTPoison : true ,
804- IncludeMustStaple : bsigner .ContainsMustStaple (csr .Extensions ),
804+ IncludeMustStaple : issuance .ContainsMustStaple (csr .Extensions ),
805805 NotBefore : validity .NotBefore ,
806806 NotAfter : validity .NotAfter ,
807807 })
0 commit comments