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:
Josh Bleecher Snyder
2021-04-29 13:52:20 -07:00
parent bf9ef1ca27
commit 7ee891f5fd
13 changed files with 29 additions and 375 deletions

View File

@@ -12,6 +12,7 @@ import (
"strings"
"inet.af/netaddr"
"tailscale.com/types/wgkey"
)
// ToUAPI writes cfg in UAPI format to w.
@@ -41,7 +42,7 @@ func (cfg *Config) ToUAPI(w io.Writer, prev *Config) error {
set("private_key", cfg.PrivateKey.HexString())
}
old := make(map[Key]Peer)
old := make(map[wgkey.Key]Peer)
for _, p := range prev.Peers {
old[p.PublicKey] = p
}