From f7d2c65559a5149e4923554695a99540abdcc56f Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 23 Mar 2022 09:12:26 +0100 Subject: follow SSHSIG changes in lib --- cmd/sigsum/cmd.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'cmd/sigsum/cmd.go') diff --git a/cmd/sigsum/cmd.go b/cmd/sigsum/cmd.go index 70a1c51..417e68d 100644 --- a/cmd/sigsum/cmd.go +++ b/cmd/sigsum/cmd.go @@ -66,15 +66,18 @@ func cmdBundle(args []string, policy policy.Policy, optBundleType, optBundleKey, } req := requests.Leaf{ - Statement: types.Statement{ - ShardHint: policy.ShardHint(), - Checksum: *checksum, - }, + ShardHint: policy.ShardHint(), + Preimage: *checksum, Signature: *sig, VerificationKey: *pub, DomainHint: optBundleDomainHint, } - if !req.Statement.Verify(&req.VerificationKey, &req.Signature) { + + sd := types.SignedData{ + ShardHint: req.ShardHint, + Checksum: *types.HashFn(req.Preimage[:]), + } + if !sd.Verify(&req.VerificationKey, &req.Signature) { return fmt.Errorf("bundle: invalid signature for file %q", path) } reqs = append(reqs, req) @@ -103,12 +106,12 @@ func cmdFormat(args []string, policy policy.Policy) error { if err != nil { return fmt.Errorf("format: %v", err) } - stm := types.Statement{ + sd := types.SignedData{ ShardHint: policy.ShardHint(), - Checksum: *checksum, + Checksum: *types.HashFn(checksum[:]), } - fmt.Printf("%s", stm.ToBinary()) + fmt.Printf("%s", sd.ToBinary()) return nil } -- cgit v1.2.3 From 150244638cd425313523f4c95a353fdeea9f593a Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 24 Mar 2022 14:00:02 +0100 Subject: get rid of the last traces of "checksum" --- cmd/sigsum/cmd.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmd/sigsum/cmd.go') diff --git a/cmd/sigsum/cmd.go b/cmd/sigsum/cmd.go index 417e68d..fc2274e 100644 --- a/cmd/sigsum/cmd.go +++ b/cmd/sigsum/cmd.go @@ -50,7 +50,7 @@ func cmdBundle(args []string, policy policy.Policy, optBundleType, optBundleKey, var reqs []requests.Leaf for _, path := range args { - checksum, err := fileHash(path) + preimage, err := fileHash(path) if err != nil { return fmt.Errorf("bundle: %v", err) } @@ -67,7 +67,7 @@ func cmdBundle(args []string, policy policy.Policy, optBundleType, optBundleKey, req := requests.Leaf{ ShardHint: policy.ShardHint(), - Preimage: *checksum, + Preimage: *preimage, Signature: *sig, VerificationKey: *pub, DomainHint: optBundleDomainHint, @@ -102,13 +102,13 @@ func cmdFormat(args []string, policy policy.Policy) error { return fmt.Errorf("format: need exactly one file") } - checksum, err := fileHash(args[0]) + preimage, err := fileHash(args[0]) if err != nil { return fmt.Errorf("format: %v", err) } sd := types.SignedData{ ShardHint: policy.ShardHint(), - Checksum: *types.HashFn(checksum[:]), + Checksum: *types.HashFn(preimage[:]), } fmt.Printf("%s", sd.ToBinary()) -- cgit v1.2.3 From ee322c9e18b9675aab08f4c9f38f6be19b1d6890 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Wed, 13 Apr 2022 15:04:44 +0200 Subject: minor edits to make sshsig stuff compile --- cmd/sigsum/cmd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/sigsum/cmd.go') diff --git a/cmd/sigsum/cmd.go b/cmd/sigsum/cmd.go index fc2274e..69598d5 100644 --- a/cmd/sigsum/cmd.go +++ b/cmd/sigsum/cmd.go @@ -73,7 +73,7 @@ func cmdBundle(args []string, policy policy.Policy, optBundleType, optBundleKey, DomainHint: optBundleDomainHint, } - sd := types.SignedData{ + sd := types.Statement{ ShardHint: req.ShardHint, Checksum: *types.HashFn(req.Preimage[:]), } @@ -106,7 +106,7 @@ func cmdFormat(args []string, policy policy.Policy) error { if err != nil { return fmt.Errorf("format: %v", err) } - sd := types.SignedData{ + sd := types.Statement{ ShardHint: policy.ShardHint(), Checksum: *types.HashFn(preimage[:]), } -- cgit v1.2.3