wgengine/wgcfg: remove unused helper function.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson 2021-10-28 10:38:13 -07:00
parent 0c546a28ba
commit 3164c7410e

View File

@ -6,7 +6,6 @@
import (
"bufio"
"encoding/hex"
"fmt"
"io"
"net"
@ -16,7 +15,6 @@
"go4.org/mem"
"inet.af/netaddr"
"tailscale.com/types/key"
"tailscale.com/types/wgkey"
)
type ParseError struct {
@ -118,17 +116,6 @@ func FromUAPI(r io.Reader) (*Config, error) {
return cfg, nil
}
func parseKeyHex(s []byte, dst []byte) error {
n, err := hex.Decode(dst, s)
if err != nil {
return &ParseError{"Invalid key: " + err.Error(), string(s)}
}
if n != wgkey.Size {
return &ParseError{"Keys must decode to exactly 32 bytes", string(s)}
}
return nil
}
func (cfg *Config) handleDeviceLine(k, value mem.RO, valueBytes []byte) error {
switch {
case k.EqualString("private_key"):