aboutsummaryrefslogtreecommitdiff
path: root/cmd/tmp/submit
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@mullvad.net>2021-12-20 19:53:54 +0100
committerRasmus Dahlberg <rasmus@mullvad.net>2021-12-20 19:53:54 +0100
commitdda238b9fc105219f220f0ec3b341b0c81b71301 (patch)
treeedbbb787ccd1c1816edfa44caf749c8be68b7bf9 /cmd/tmp/submit
parent5ba4a77233549819440cc41a02503f3a85213e24 (diff)
types: Start using sigsum-lib-go
This commit does not change the way in which the log behaves externally. In other words, all changes are internal and involves renaming and code restructuring. Most notably picking up the refactored sigsum-lib-go.
Diffstat (limited to 'cmd/tmp/submit')
-rw-r--r--cmd/tmp/submit/main.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/tmp/submit/main.go b/cmd/tmp/submit/main.go
index 2b8050c..f29b168 100644
--- a/cmd/tmp/submit/main.go
+++ b/cmd/tmp/submit/main.go
@@ -10,7 +10,7 @@ import (
"fmt"
"log"
- "git.sigsum.org/sigsum-log-go/pkg/types"
+ "git.sigsum.org/sigsum-lib-go/pkg/types"
)
var (
@@ -18,7 +18,7 @@ var (
checksum = flag.String("checksum", "", "checksum (hex)")
sk = flag.String("sk", "", "secret key (hex)")
domainHint = flag.String("domain_hint", "example.com", "domain hint (string)")
- base_url = flag.String("base_url", "localhost:6965", "base url (string)")
+ base_url = flag.String("base_url", "localhost:6965/testonly", "base url (string)")
)
func main() {
@@ -28,18 +28,18 @@ func main() {
var priv ed25519.PrivateKey = ed25519.PrivateKey(privBuf[:])
mustDecodeHex(*sk, priv[:])
- var c [types.HashSize]byte
+ var c types.Hash
if *checksum != "" {
mustDecodeHex(*checksum, c[:])
} else {
mustPutRandom(c[:])
}
- msg := types.Message{
+ msg := types.Statement{
ShardHint: *shardHint,
- Checksum: &c,
+ Checksum: c,
}
- sig := ed25519.Sign(priv, msg.Marshal())
+ sig := ed25519.Sign(priv, msg.ToBinary())
fmt.Printf("echo \"shard_hint=%d\nchecksum=%x\nsignature=%x\nverification_key=%x\ndomain_hint=%s\" | curl --data-binary @- %s/sigsum/v0/add-leaf\n",
msg.ShardHint,