aboutsummaryrefslogtreecommitdiff
path: root/pkg/storage/index/index.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rgdd@glasklarteknik.se>2025-01-04 16:32:00 +0100
committerRasmus Dahlberg <rgdd@glasklarteknik.se>2025-01-04 16:32:58 +0100
commit791450281e72cb69dbf640cbd4094d422706b72c (patch)
tree53fe4073bc0eee7b83956bfeb68b4e04ec8a3f02 /pkg/storage/index/index.go
parent76a113a3319a421b5a1226300dd4a4b5cce500bf (diff)
Commit parsed certificate as ASCII instead of DER
Because openssl wasn't able to parse DER precertificates. And now the user can just view the file rather than fiddling with openssl.
Diffstat (limited to 'pkg/storage/index/index.go')
-rw-r--r--pkg/storage/index/index.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/storage/index/index.go b/pkg/storage/index/index.go
index bf94711..95eb04a 100644
--- a/pkg/storage/index/index.go
+++ b/pkg/storage/index/index.go
@@ -8,6 +8,7 @@ import (
"fmt"
"time"
+ "github.com/google/certificate-transparency-go/x509util"
"rgdd.se/silentct/internal/ioutil"
"rgdd.se/silentct/internal/monitor"
"rgdd.se/silentct/pkg/crtutil"
@@ -81,8 +82,8 @@ func (ix *Index) AddEntries(logID [sha256.Size]byte, entries []monitor.LogEntry)
if err := ioutil.CommitJSON(path, entry); err != nil {
return err
}
- path = fmt.Sprintf("%s/%x-%d.der", ix.cfg.MatchDirectory, logID[:], entry.LeafIndex)
- return ioutil.CommitData(path, crt.Raw)
+ path = fmt.Sprintf("%s/%x-%d.ascii", ix.cfg.MatchDirectory, logID[:], entry.LeafIndex)
+ return ioutil.CommitData(path, []byte(x509util.CertificateToString(&crt)))
}
for _, entry := range entries {