aboutsummaryrefslogtreecommitdiff
path: root/client/get-consistency-proof
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-05 17:05:21 +0100
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-05 17:05:21 +0100
commite34ec5b2159ac2c7272c3abef1084ba6b763fc56 (patch)
treea79f6849613392fb169af628f2be45552af9e799 /client/get-consistency-proof
parent36743a05a39f449628b153f1051bd854cf4ed6aa (diff)
added error handling for public key parsing
Diffstat (limited to 'client/get-consistency-proof')
-rw-r--r--client/get-consistency-proof/main.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/get-consistency-proof/main.go b/client/get-consistency-proof/main.go
index 72fa804..acf116e 100644
--- a/client/get-consistency-proof/main.go
+++ b/client/get-consistency-proof/main.go
@@ -28,11 +28,16 @@ func main() {
glog.Fatal(err)
}
+ k, err := cli.Log.Key()
+ if err != nil {
+ glog.Fatalf("bad public key: %v", err)
+ }
+
var sth1 stfe.StItem
if err := sth1.UnmarshalB64(*first); err != nil {
glog.Fatalf("bad signed tree head: %v", err)
}
- if err := client.VerifySignedTreeHeadV1(&sth1, cli.Log.Scheme, cli.Log.Key()); err != nil {
+ if err := client.VerifySignedTreeHeadV1(&sth1, cli.Log.Scheme, k); err != nil {
glog.Fatalf("bad signed tree head: %v", err)
}
glog.V(3).Info("verified first sth")
@@ -41,7 +46,7 @@ func main() {
if err := sth2.UnmarshalB64(*second); err != nil {
glog.Fatalf("bad signed tree head: %v", err)
}
- if err := client.VerifySignedTreeHeadV1(&sth2, cli.Log.Scheme, cli.Log.Key()); err != nil {
+ if err := client.VerifySignedTreeHeadV1(&sth2, cli.Log.Scheme, k); err != nil {
glog.Fatalf("bad signed tree head: %v", err)
}
glog.V(3).Info("verified second sth")