From 26b786d9857db21fdf110eaf9cb6d1d6e4e68ef9 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Mon, 13 Sep 2021 19:53:17 +0200 Subject: updated (co)signed tree head structures - Added key_hash in tree head, see motivation in api.md - Added separate types for (co)signed tree heads - Refactored tree head HTTP APIs to be current, see api.md --- cmd/tmp/cosign/main.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/tmp/cosign/main.go b/cmd/tmp/cosign/main.go index 629e7ac..42162e4 100644 --- a/cmd/tmp/cosign/main.go +++ b/cmd/tmp/cosign/main.go @@ -13,11 +13,17 @@ import ( ) var ( - url = flag.String("url", "http://localhost:6965/sigsum/v0", "base url") - sk = flag.String("sk", "e1d7c494dacb0ddf809a17e4528b01f584af22e3766fa740ec52a1711c59500d711090dd2286040b50961b0fe09f58aa665ccee5cb7ee042d819f18f6ab5046b", "hex key") + url = flag.String("url", "http://localhost:6965/sigsum/v0", "base url") + sk = flag.String("sk", "e1d7c494dacb0ddf809a17e4528b01f584af22e3766fa740ec52a1711c59500d711090dd2286040b50961b0fe09f58aa665ccee5cb7ee042d819f18f6ab5046b", "witness secret key (hex)") + log_vk = flag.String("log_vk", "cc0e7294a9d002c33aaa828efba6622ab1ce8ebdb8a795902555c2813133cfe8", "log public key (hex)") ) func main() { + log_vk, err := hex.DecodeString(*log_vk) + if err != nil { + log.Fatalf("DecodeString: %v", err) + } + priv, err := hex.DecodeString(*sk) if err != nil { log.Fatalf("DecodeString: %v", err) @@ -34,7 +40,8 @@ func main() { if err := sth.UnmarshalASCII(rsp.Body); err != nil { log.Fatalf("UnmarshalASCII: %v", err) } - fmt.Printf("%+v\n", sth) + sth.TreeHead.KeyHash = types.Hash(log_vk) + fmt.Printf("%+v\n\n", sth) msg := sth.TreeHead.Marshal() sig := ed25519.Sign(sk, msg) -- cgit v1.2.3