aboutsummaryrefslogtreecommitdiff
path: root/pkg/instance
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2022-04-29 15:31:45 +0200
committerRasmus Dahlberg <rasmus@mullvad.net>2022-04-29 22:16:22 +0200
commit203e2144f67269e879716e6406bb78e8e3728938 (patch)
treefed67be13cb7dfe903eb61c2d9f87ea3333f4ee5 /pkg/instance
parentcb5c579ae46ee0570f2f32408e0427f989bd33ab (diff)
change verification_key to public_key
Issue: #40
Diffstat (limited to 'pkg/instance')
-rw-r--r--pkg/instance/handler_test.go2
-rw-r--r--pkg/instance/instance.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/instance/handler_test.go b/pkg/instance/handler_test.go
index 0b81f6c..ab429ae 100644
--- a/pkg/instance/handler_test.go
+++ b/pkg/instance/handler_test.go
@@ -682,7 +682,7 @@ func mustLeafBuffer(t *testing.T, shardHint uint64, message types.Hash, wantSig
"shard_hint", shardHint,
"message", message[:],
"signature", sig,
- "verification_key", vk,
+ "public_key", vk,
"domain_hint", "example.com",
))
}
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go
index 18255a1..4d7582a 100644
--- a/pkg/instance/instance.go
+++ b/pkg/instance/instance.go
@@ -24,7 +24,7 @@ type Config struct {
Interval time.Duration // Cosigning frequency
ShardStart uint64 // Shard interval start (num seconds since UNIX epoch)
- // Witnesses map trusted witness identifiers to public verification keys
+ // Witnesses map trusted witness identifiers to public keys
Witnesses map[types.Hash]types.PublicKey
}
@@ -65,7 +65,7 @@ func (i *Instance) leafRequestFromHTTP(ctx context.Context, r *http.Request) (*r
ShardHint: req.ShardHint,
Checksum: *types.HashFn(req.Message[:]),
}
- if !stmt.Verify(&req.VerificationKey, &req.Signature) {
+ if !stmt.Verify(&req.PublicKey, &req.Signature) {
return nil, fmt.Errorf("invalid signature")
}
shardEnd := uint64(time.Now().Unix())
@@ -75,7 +75,7 @@ func (i *Instance) leafRequestFromHTTP(ctx context.Context, r *http.Request) (*r
if req.ShardHint > shardEnd {
return nil, fmt.Errorf("invalid shard hint: %d not in [%d, %d]", req.ShardHint, i.ShardStart, shardEnd)
}
- if err := i.DNS.Verify(ctx, req.DomainHint, &req.VerificationKey); err != nil {
+ if err := i.DNS.Verify(ctx, req.DomainHint, &req.PublicKey); err != nil {
return nil, fmt.Errorf("invalid domain hint: %v", err)
}
return &req, nil