aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/sigsum/cmd.go19
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
}