aboutsummaryrefslogtreecommitdiff
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
parentcb5c579ae46ee0570f2f32408e0427f989bd33ab (diff)
change verification_key to public_key
Issue: #40
-rw-r--r--cmd/sigsum_log_go/main.go4
-rw-r--r--cmd/tmp/dns/main.go2
-rw-r--r--cmd/tmp/submit/main.go2
-rwxr-xr-xintegration/test.sh2
-rw-r--r--pkg/db/trillian.go2
-rw-r--r--pkg/db/trillian_test.go2
-rw-r--r--pkg/instance/handler_test.go2
-rw-r--r--pkg/instance/instance.go6
8 files changed, 11 insertions, 11 deletions
diff --git a/cmd/sigsum_log_go/main.go b/cmd/sigsum_log_go/main.go
index 1e4d943..042c2df 100644
--- a/cmd/sigsum_log_go/main.go
+++ b/cmd/sigsum_log_go/main.go
@@ -35,7 +35,7 @@ var (
trillianID = flag.Int64("trillian_id", 0, "log identifier in the Trillian database")
deadline = flag.Duration("deadline", time.Second*10, "deadline for backend requests")
key = flag.String("key", "", "hex-encoded Ed25519 signing key")
- witnesses = flag.String("witnesses", "", "comma-separated list of trusted witness verification keys in hex")
+ witnesses = flag.String("witnesses", "", "comma-separated list of trusted witness public keys in hex")
maxRange = flag.Int64("max_range", 10, "maximum number of entries that can be retrived in a single request")
interval = flag.Duration("interval", time.Second*30, "interval used to rotate the log's cosigned STH")
shardStart = flag.Int64("shard_interval_start", 0, "start of shard interval since the UNIX epoch in seconds")
@@ -168,7 +168,7 @@ func newWitnessMap(witnesses string) (map[types.Hash]types.PublicKey, error) {
var vk types.PublicKey
if n := copy(vk[:], b); n != types.PublicKeySize {
- return nil, fmt.Errorf("Invalid verification key size: %v", n)
+ return nil, fmt.Errorf("Invalid public key size: %v", n)
}
w[*types.HashFn(vk[:])] = vk
}
diff --git a/cmd/tmp/dns/main.go b/cmd/tmp/dns/main.go
index bb505b3..ea0a4e5 100644
--- a/cmd/tmp/dns/main.go
+++ b/cmd/tmp/dns/main.go
@@ -12,7 +12,7 @@ import (
)
var (
- vk = flag.String("vk", "5aed7ffc3bc088221f6579567b2e6e3c4ac3579bd5e77670755179052c68d5d3", "verification key (hex)")
+ vk = flag.String("vk", "5aed7ffc3bc088221f6579567b2e6e3c4ac3579bd5e77670755179052c68d5d3", "public key (hex)")
domain_hint = flag.String("domain_hint", "example.com", "domain name that is aware of public key hash in hex")
)
diff --git a/cmd/tmp/submit/main.go b/cmd/tmp/submit/main.go
index ff7a353..5699945 100644
--- a/cmd/tmp/submit/main.go
+++ b/cmd/tmp/submit/main.go
@@ -41,7 +41,7 @@ func main() {
}
sig := ed25519.Sign(priv, msg.ToBinary())
- fmt.Printf("echo \"shard_hint=%d\nmessage=%x\nsignature=%x\nverification_key=%x\ndomain_hint=%s\" | curl --data-binary @- %s/sigsum/v0/add-leaf\n",
+ fmt.Printf("echo \"shard_hint=%d\nmessage=%x\nsignature=%x\npublic_key=%x\ndomain_hint=%s\" | curl --data-binary @- %s/sigsum/v0/add-leaf\n",
*shardHint,
p[:],
sig,
diff --git a/integration/test.sh b/integration/test.sh
index 7ba9dc9..3bc967c 100755
--- a/integration/test.sh
+++ b/integration/test.sh
@@ -365,7 +365,7 @@ function test_add_leaf() {
echo "message=$(openssl dgst -binary <(echo $1) | base16)" >> $log_dir/req
echo "signature=$(echo $1 |
sigsum-debug leaf sign -k $cli_priv -h $ssrv_shard_start)" >> $log_dir/req
- echo "verification_key=$cli_pub" >> $log_dir/req
+ echo "public_key=$cli_pub" >> $log_dir/req
echo "domain_hint=$cli_domain_hint" >> $log_dir/req
cat $log_dir/req |
curl -s -w "%{http_code}" --data-binary @- $log_url/add-leaf \
diff --git a/pkg/db/trillian.go b/pkg/db/trillian.go
index 97f1305..024a021 100644
--- a/pkg/db/trillian.go
+++ b/pkg/db/trillian.go
@@ -29,7 +29,7 @@ func (c *TrillianClient) AddLeaf(ctx context.Context, req *requests.Leaf) error
Checksum: *types.HashFn(req.Message[:]),
},
Signature: req.Signature,
- KeyHash: *types.HashFn(req.VerificationKey[:]),
+ KeyHash: *types.HashFn(req.PublicKey[:]),
}
serialized := leaf.ToBinary()
diff --git a/pkg/db/trillian_test.go b/pkg/db/trillian_test.go
index 9a390a1..2b19096 100644
--- a/pkg/db/trillian_test.go
+++ b/pkg/db/trillian_test.go
@@ -23,7 +23,7 @@ func TestAddLeaf(t *testing.T) {
ShardHint: 0,
Message: types.Hash{},
Signature: types.Signature{},
- VerificationKey: types.PublicKey{},
+ PublicKey: types.PublicKey{},
DomainHint: "example.com",
}
for _, table := range []struct {
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