From 8634892aa6d5d59f73e50652dbe750df263853a3 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Fri, 25 Mar 2022 16:36:27 +0100 Subject: sign tree heads and leaves with SSHSIG --- pkg/requests/requests.go | 3 ++- pkg/requests/requests_test.go | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'pkg/requests') diff --git a/pkg/requests/requests.go b/pkg/requests/requests.go index 26a5213..4d09101 100644 --- a/pkg/requests/requests.go +++ b/pkg/requests/requests.go @@ -8,7 +8,8 @@ import ( ) type Leaf struct { - types.Statement + ShardHint uint64 `ascii:"shard_hint"` + Preimage types.Hash `ascii:"preimage"` Signature types.Signature `ascii:"signature"` VerificationKey types.PublicKey `ascii:"verification_key"` DomainHint string `ascii:"domain_hint"` diff --git a/pkg/requests/requests_test.go b/pkg/requests/requests_test.go index 7102714..365f90f 100644 --- a/pkg/requests/requests_test.go +++ b/pkg/requests/requests_test.go @@ -243,10 +243,8 @@ func TestCosignatureFromASCII(t *testing.T) { func validLeaf(t *testing.T) *Leaf { t.Helper() return &Leaf{ - Statement: types.Statement{ - ShardHint: 1, - Checksum: *newHashBufferInc(t), - }, + ShardHint: 1, + Preimage: *types.HashFn(newHashBufferInc(t)[:]), Signature: *newSigBufferInc(t), VerificationKey: *newPubBufferInc(t), DomainHint: "example.com", @@ -257,7 +255,7 @@ func validLeafASCII(t *testing.T) string { t.Helper() return fmt.Sprintf("%s=%d\n%s=%x\n%s=%x\n%s=%x\n%s=%s\n", "shard_hint", 1, - "checksum", newHashBufferInc(t)[:], + "preimage", types.HashFn(newHashBufferInc(t)[:])[:], "signature", newSigBufferInc(t)[:], "verification_key", newPubBufferInc(t)[:], "domain_hint", "example.com", -- cgit v1.2.3