diff options
author | Linus Nordberg <linus@nordberg.se> | 2022-03-23 09:12:26 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2022-03-23 09:12:26 +0100 |
commit | f7d2c65559a5149e4923554695a99540abdcc56f (patch) | |
tree | 28a4c17471844b193938b83fe6e0b66a9d86f064 /cmd | |
parent | 8da382069f42f6d88d3abf914dd38d7e40a845bc (diff) |
follow SSHSIG changes in lib
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/sigsum/cmd.go | 19 |
1 files changed, 11 insertions, 8 deletions
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 } |