Fix error messages for consistency in ca.go and certdb.go

This commit is contained in:
2025-12-10 21:13:51 +01:00
parent 5d2675450d
commit 714a38d612
2 changed files with 6 additions and 6 deletions

View File

@@ -98,7 +98,7 @@ func SaveCAState() error {
// UpdateCAStateAfterIssue updates the CA state JSON after issuing a certificate
func (s *CAState) UpdateCAStateAfterIssue(serialType, name string, subject string, certType string, serialNumber any, validity time.Duration) error {
if s == nil {
return fmt.Errorf("CAState is nil in UpdateCAStateAfterIssue. This indicates a programming error.")
return fmt.Errorf("CAState is nil in UpdateCAStateAfterIssue. This indicates a programming error")
}
issued := time.Now().UTC().Format(time.RFC3339)
expires := time.Now().Add(validity).UTC().Format(time.RFC3339)
@@ -135,7 +135,7 @@ func (s *CAState) AddCertificate(name, subject, certType, issued, expires, seria
// RevokeCertificate revokes a certificate by serial number and reason code, updates state, and saves to disk
func (s *CAState) RevokeCertificate(serial string, reason int) error {
if s == nil {
return fmt.Errorf("CAState is nil in RevokeCertificate. This indicates a programming error.")
return fmt.Errorf("CAState is nil in RevokeCertificate. This indicates a programming error")
}
revoked := false
revokedAt := time.Now().UTC().Format(time.RFC3339)