aboutsummaryrefslogtreecommitdiff
path: root/pkg/instance/instance.go
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2022-03-28 13:18:52 +0200
committerRasmus Dahlberg <rasmus@mullvad.net>2022-03-28 19:18:11 +0200
commit3f8010612c376ba9775101a3c823125ce9c82304 (patch)
tree4a806b3e4b452a28cbfab97e7412ed9182f4588d /pkg/instance/instance.go
parent4e1b2586576012a1be561a2337192ee517f13fbb (diff)
follow SSHSIG changes in lib
Diffstat (limited to 'pkg/instance/instance.go')
-rw-r--r--pkg/instance/instance.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go
index bbd6cde..7ade955 100644
--- a/pkg/instance/instance.go
+++ b/pkg/instance/instance.go
@@ -56,8 +56,11 @@ func (i *Instance) leafRequestFromHTTP(ctx context.Context, r *http.Request) (*r
if err := req.FromASCII(r.Body); err != nil {
return nil, fmt.Errorf("FromASCII: %v", err)
}
-
- if !req.Statement.Verify(&req.VerificationKey, &req.Signature) {
+ stmt := types.Statement{
+ ShardHint: req.ShardHint,
+ Checksum: *types.HashFn(req.Preimage[:]),
+ }
+ if !stmt.Verify(&req.VerificationKey, &req.Signature) {
return nil, fmt.Errorf("invalid signature")
}
shardEnd := uint64(time.Now().Unix())