aboutsummaryrefslogtreecommitdiff
path: root/client/get-proof-by-hash
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-proof-by-hash
parent36743a05a39f449628b153f1051bd854cf4ed6aa (diff)
added error handling for public key parsing
Diffstat (limited to 'client/get-proof-by-hash')
-rw-r--r--client/get-proof-by-hash/main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/get-proof-by-hash/main.go b/client/get-proof-by-hash/main.go
index 897a8aa..04dd7dc 100644
--- a/client/get-proof-by-hash/main.go
+++ b/client/get-proof-by-hash/main.go
@@ -33,7 +33,9 @@ func main() {
if err := sth.UnmarshalB64(*signedTreeHead); err != nil {
glog.Fatalf("bad signed tree head: %v", err)
}
- if err := client.VerifySignedTreeHeadV1(&sth, cli.Log.Scheme, cli.Log.Key()); err != nil {
+ if k, err := cli.Log.Key(); err != nil {
+ glog.Fatalf("bad public key: %v", err)
+ } else if err := client.VerifySignedTreeHeadV1(&sth, cli.Log.Scheme, k); err != nil {
glog.Fatalf("bad signed tree head: %v", err)
}
glog.V(3).Info("verified sth")