Unmarshal keys in the non-deprecated way

This commit is contained in:
Kristoffer Dalby 2021-11-26 23:50:42 +00:00
parent 0012c76170
commit c38f00fab8
7 changed files with 27 additions and 40 deletions

View file

@ -11,7 +11,6 @@ import (
v1 "github.com/juanfont/headscale/gen/go/headscale/v1"
"github.com/pterm/pterm"
"github.com/spf13/cobra"
"go4.org/mem"
"google.golang.org/grpc/status"
"tailscale.com/types/key"
)
@ -486,7 +485,8 @@ func nodesToPtables(
expiry = machine.Expiry.AsTime()
}
nodeKey, err := key.ParseNodePublicUntyped(mem.S(machine.NodeKey))
var nodeKey key.NodePublic
err := nodeKey.UnmarshalText([]byte(machine.NodeKey))
if err != nil {
return nil, err
}