Skip to content

Commit

Permalink
internal/ctlog: fix empty log hash
Browse files Browse the repository at this point in the history
Fixes #14
  • Loading branch information
FiloSottile committed Jul 18, 2024
1 parent edc7305 commit 781aca2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module filippo.io/sunlight

go 1.22.0
go 1.22.4

require (
crawshaw.io/sqlite v0.3.3-0.20220618202545-d1964889ea3c
Expand All @@ -14,7 +14,7 @@ require (
github.com/google/certificate-transparency-go v1.1.7
github.com/prometheus/client_golang v1.18.0
golang.org/x/crypto v0.19.0
golang.org/x/mod v0.16.1-0.20240315155916-aa51b25a4485
golang.org/x/mod v0.19.0
golang.org/x/net v0.21.0
golang.org/x/sync v0.6.0
gopkg.in/yaml.v3 v3.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/mod v0.16.1-0.20240315155916-aa51b25a4485 h1:q+SG4bdVkCi4aZRtT8t9M/gJk15iqs59Qzhm1EwPe/g=
golang.org/x/mod v0.16.1-0.20240315155916-aa51b25a4485/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
Expand Down
5 changes: 3 additions & 2 deletions internal/ctlog/testlog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ func (tl *TestLog) CheckLog() (sthTimestamp int64) {
}

if c.N == 0 {
if c.Hash != (tlog.Hash{}) {
t.Error("empty log should have zero hash")
expected := sha256.Sum256([]byte{})
if c.Hash != expected {
t.Error("empty log should have empty string hash")
}
return
}
Expand Down

0 comments on commit 781aca2

Please sign in to comment.