aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@mullvad.net>2022-04-22 01:36:03 +0200
committerRasmus Dahlberg <rasmus@mullvad.net>2022-04-22 01:36:03 +0200
commit1faf49638b379be263999b322ad07a8acf391ca6 (patch)
tree7f819daab6f068c806e6126df90d91e865a54ae1
parentf2329dfaf4803d2f60dead0194d97e684f203de7 (diff)
fix so that checksum is H(H(data))
-rw-r--r--cmd/sigsum-debug/hashleaf/hashleaf.go3
-rw-r--r--cmd/sigsum-debug/sign/sign.go3
2 files changed, 4 insertions, 2 deletions
diff --git a/cmd/sigsum-debug/hashleaf/hashleaf.go b/cmd/sigsum-debug/hashleaf/hashleaf.go
index 00f8bbb..0f5d3e3 100644
--- a/cmd/sigsum-debug/hashleaf/hashleaf.go
+++ b/cmd/sigsum-debug/hashleaf/hashleaf.go
@@ -18,9 +18,10 @@ func Main(_ []string, optPriv string, optShardHint uint64) error {
if err != nil {
return fmt.Errorf("sign: %v", err)
}
+ preimage := types.HashFn(data)
stm := types.Statement{
ShardHint: optShardHint,
- Checksum: *types.HashFn(data),
+ Checksum: *types.HashFn(preimage[:]),
}
sig, err := stm.Sign(priv)
if err != nil {
diff --git a/cmd/sigsum-debug/sign/sign.go b/cmd/sigsum-debug/sign/sign.go
index ac21472..c984cb5 100644
--- a/cmd/sigsum-debug/sign/sign.go
+++ b/cmd/sigsum-debug/sign/sign.go
@@ -17,9 +17,10 @@ func Main(_ []string, optPriv string, optShardHint uint64) error {
if err != nil {
return fmt.Errorf("sign: %v", err)
}
+ preimage := types.HashFn(data)
stm := types.Statement{
ShardHint: optShardHint,
- Checksum: *types.HashFn(data),
+ Checksum: *types.HashFn(preimage[:]),
}
sig, err := stm.Sign(priv)
if err != nil {