Skip to content
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

RA: Audit log and track cert profile names and hashes #7433

Merged
merged 5 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions ca/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (ca *certificateAuthorityImpl) IssuePrecertificate(ctx context.Context, iss
return nil, err
}

precertDER, certProfileHash, err := ca.issuePrecertificateInner(ctx, issueReq, serialBigInt, validity)
precertDER, cpwid, err := ca.issuePrecertificateInner(ctx, issueReq, serialBigInt, validity)
if err != nil {
return nil, err
}
Expand All @@ -318,7 +318,8 @@ func (ca *certificateAuthorityImpl) IssuePrecertificate(ctx context.Context, iss

return &capb.IssuePrecertificateResponse{
DER: precertDER,
CertProfileHash: certProfileHash,
CertProfileName: cpwid.name,
CertProfileHash: cpwid.hash[:],
}, nil
}

Expand Down Expand Up @@ -499,7 +500,7 @@ func generateSKID(pk crypto.PublicKey) ([]byte, error) {
return skid[0:20:20], nil
}

func (ca *certificateAuthorityImpl) issuePrecertificateInner(ctx context.Context, issueReq *capb.IssueCertificateRequest, serialBigInt *big.Int, validity validity) ([]byte, []byte, error) {
func (ca *certificateAuthorityImpl) issuePrecertificateInner(ctx context.Context, issueReq *capb.IssueCertificateRequest, serialBigInt *big.Int, validity validity) ([]byte, *certProfileWithID, error) {
// The CA must check if it is capable of issuing for the given certificate
// profile name. The name is checked here instead of the hash because the RA
// is unaware of what certificate profiles exist. Pre-existing orders stored
Expand Down Expand Up @@ -600,5 +601,5 @@ func (ca *certificateAuthorityImpl) issuePrecertificateInner(ctx context.Context
ca.log.AuditInfof("Signing precert success: serial=[%s] regID=[%d] names=[%s] precertificate=[%s] certProfileName=[%s] certProfileHash=[%x]",
serialHex, issueReq.RegistrationID, strings.Join(csr.DNSNames, ", "), hex.EncodeToString(certDER), certProfile.name, certProfile.hash)

return certDER, certProfile.hash[:], nil
return certDER, &certProfileWithID{certProfile.name, certProfile.hash, nil}, nil
}
177 changes: 96 additions & 81 deletions ca/proto/ca.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading