From 781aca218b23c331257dc19f628b67c06b2ff1b5 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Wed, 5 Jun 2024 11:31:39 +0200 Subject: [PATCH] internal/ctlog: fix empty log hash Fixes #14 --- go.mod | 4 ++-- go.sum | 4 ++-- internal/ctlog/testlog_test.go | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 60c5f16..392bac7 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 diff --git a/go.sum b/go.sum index f200013..8097c45 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/internal/ctlog/testlog_test.go b/internal/ctlog/testlog_test.go index a87ba52..d729839 100644 --- a/internal/ctlog/testlog_test.go +++ b/internal/ctlog/testlog_test.go @@ -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 }