various: use NodePublic.AsNodeKey() instead of tailcfg.NodeKeyFromNodePublic()

Updates #3206

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2021-10-29 16:19:27 -07:00
parent ff16e58d23
commit 418adae379
10 changed files with 28 additions and 28 deletions
+3 -3
View File
@@ -357,8 +357,8 @@ func (c *Direct) doLogin(ctx context.Context, opt loginOpt) (mustRegen bool, new
now := time.Now().Round(time.Second)
request := tailcfg.RegisterRequest{
Version: 1,
OldNodeKey: tailcfg.NodeKeyFromNodePublic(oldNodeKey),
NodeKey: tailcfg.NodeKeyFromNodePublic(tryingNewKey.Public()),
OldNodeKey: oldNodeKey.AsNodeKey(),
NodeKey: tryingNewKey.Public().AsNodeKey(),
Hostinfo: hostinfo,
Followup: opt.URL,
Timestamp: &now,
@@ -595,7 +595,7 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netm
request := &tailcfg.MapRequest{
Version: tailcfg.CurrentMapRequestVersion,
KeepAlive: c.keepAlive,
NodeKey: tailcfg.NodeKeyFromNodePublic(persist.PrivateNodeKey.Public()),
NodeKey: persist.PrivateNodeKey.Public().AsNodeKey(),
DiscoKey: c.discoPubKey,
Endpoints: epStrs,
EndpointTypes: epTypes,
+1 -1
View File
@@ -110,7 +110,7 @@ func (ms *mapSession) netmapForResponse(resp *tailcfg.MapResponse) *netmap.Netwo
}
nm := &netmap.NetworkMap{
NodeKey: tailcfg.NodeKeyFromNodePublic(ms.privateNodeKey.Public()),
NodeKey: ms.privateNodeKey.Public().AsNodeKey(),
PrivateKey: ms.privateNodeKey,
MachineKey: ms.machinePubKey,
Peers: resp.Peers,