aboutsummaryrefslogtreecommitdiff
path: root/client/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'client/client.go')
-rw-r--r--client/client.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/client/client.go b/client/client.go
index 88ccf2f..159a5df 100644
--- a/client/client.go
+++ b/client/client.go
@@ -104,7 +104,9 @@ func (c *Client) AddEntry(ctx context.Context, name, checksum []byte) (*stfe.StI
return nil, fmt.Errorf("bad StItem format: %v", item.Format)
}
- if err := VerifySignedDebugInfoV1(item, c.Log.Scheme, c.Log.Key(), leaf); err != nil {
+ if k, err := c.Log.Key(); err != nil {
+ return nil, fmt.Errorf("bad public key: %v", err)
+ } else if err := VerifySignedDebugInfoV1(item, c.Log.Scheme, k, leaf); err != nil {
return nil, fmt.Errorf("bad SignedDebugInfoV1 signature: %v", err)
}
return item, nil
@@ -125,7 +127,9 @@ func (c *Client) GetSth(ctx context.Context) (*stfe.StItem, error) {
return nil, fmt.Errorf("bad StItem format: %v", item.Format)
}
- if err := VerifySignedTreeHeadV1(item, c.Log.Scheme, c.Log.Key()); err != nil {
+ if k, err := c.Log.Key(); err != nil {
+ return nil, fmt.Errorf("bad public key: %v", err)
+ } else if err := VerifySignedTreeHeadV1(item, c.Log.Scheme, k); err != nil {
return nil, fmt.Errorf("bad SignedDebugInfoV1 signature: %v", err)
}
return item, nil