all: delete wgcfg.Key and wgcfg.PrivateKey
For historical reasons, we ended up with two near-duplicate copies of curve25519 key types, one in the wireguard-go module (wgcfg) and one in the tailscale module (types/wgkey). Then we moved wgcfg to the tailscale module. We can now remove the wgcfg key type in favor of wgkey. Signed-off-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
@@ -22,13 +22,13 @@ import (
|
||||
)
|
||||
|
||||
func TestDeviceConfig(t *testing.T) {
|
||||
newPrivateKey := func() (Key, PrivateKey) {
|
||||
newPrivateKey := func() (wgkey.Key, wgkey.Private) {
|
||||
t.Helper()
|
||||
pk, err := wgkey.NewPrivate()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return Key(pk.Public()), PrivateKey(pk)
|
||||
return wgkey.Key(pk.Public()), wgkey.Private(pk)
|
||||
}
|
||||
k1, pk1 := newPrivateKey()
|
||||
ip1 := netaddr.MustParseIPPrefix("10.0.0.1/32")
|
||||
@@ -40,7 +40,7 @@ func TestDeviceConfig(t *testing.T) {
|
||||
ip3 := netaddr.MustParseIPPrefix("10.0.0.3/32")
|
||||
|
||||
cfg1 := &Config{
|
||||
PrivateKey: PrivateKey(pk1),
|
||||
PrivateKey: wgkey.Private(pk1),
|
||||
Peers: []Peer{{
|
||||
PublicKey: k2,
|
||||
AllowedIPs: []netaddr.IPPrefix{ip2},
|
||||
@@ -48,7 +48,7 @@ func TestDeviceConfig(t *testing.T) {
|
||||
}
|
||||
|
||||
cfg2 := &Config{
|
||||
PrivateKey: PrivateKey(pk2),
|
||||
PrivateKey: wgkey.Private(pk2),
|
||||
Peers: []Peer{{
|
||||
PublicKey: k1,
|
||||
AllowedIPs: []netaddr.IPPrefix{ip1},
|
||||
|
||||
Reference in New Issue
Block a user