Skip to content

Commit

Permalink
Fix CT serialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Dec 16, 2024
1 parent 6faae37 commit c465c45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ctonly/ct.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ func (c Entry) LeafData(idx uint64) []byte {
b.AddUint16(1 /* entry_type = precert_entry */)
b.AddBytes(c.IssuerKeyHash[:])
b.AddUint24LengthPrefixed(func(b *cryptobyte.Builder) {
b.AddBytes(c.Certificate)
b.AddBytes(c.Precertificate)
})
}
addExtensions(b, idx)
if c.IsPrecert {
b.AddUint24LengthPrefixed(func(b *cryptobyte.Builder) {
b.AddBytes(c.Precertificate)
b.AddBytes(c.PrecertSigningCert)
})
}
b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) {
Expand Down Expand Up @@ -105,7 +105,7 @@ func (e *Entry) MerkleTreeLeaf(idx uint64) []byte {
b.AddUint16(1 /* entry_type = precert_entry */)
b.AddBytes(e.IssuerKeyHash[:])
b.AddUint24LengthPrefixed(func(b *cryptobyte.Builder) {
b.AddBytes(e.Certificate)
b.AddBytes(e.Precertificate)
})
}
addExtensions(b, idx)
Expand Down

0 comments on commit c465c45

Please sign in to comment.