mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 14:57:49 +00:00
various: remove remaining uses of key.NewPrivate.
Updates #3206 Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
parent
ccd36cb5b1
commit
eeb97fd89f
@ -90,7 +90,7 @@ func TestLocalLogLines(t *testing.T) {
|
||||
TxBytes: 10,
|
||||
RxBytes: 10,
|
||||
LastHandshake: time.Now(),
|
||||
NodeKey: tailcfg.NodeKey(key.NewPrivate()),
|
||||
NodeKey: tailcfg.NodeKeyFromNodePublic(key.NewNode().Public()),
|
||||
}},
|
||||
})
|
||||
lb.mu.Unlock()
|
||||
@ -105,7 +105,7 @@ func TestLocalLogLines(t *testing.T) {
|
||||
TxBytes: 11,
|
||||
RxBytes: 12,
|
||||
LastHandshake: time.Now(),
|
||||
NodeKey: tailcfg.NodeKey(key.NewPrivate()),
|
||||
NodeKey: tailcfg.NodeKeyFromNodePublic(key.NewNode().Public()),
|
||||
}},
|
||||
})
|
||||
lb.mu.Unlock()
|
||||
|
@ -274,9 +274,9 @@ func (s *Server) AddFakeNode() {
|
||||
if s.nodes == nil {
|
||||
s.nodes = make(map[tailcfg.NodeKey]*tailcfg.Node)
|
||||
}
|
||||
nk := tailcfg.NodeKey(key.NewPrivate().Public())
|
||||
nk := tailcfg.NodeKeyFromNodePublic(key.NewNode().Public())
|
||||
mk := key.NewMachine().Public()
|
||||
dk := tailcfg.DiscoKey(key.NewPrivate().Public())
|
||||
dk := tailcfg.DiscoKeyFromDiscoPublic(key.NewDisco().Public())
|
||||
id := int64(binary.LittleEndian.Uint64(nk[:]))
|
||||
ip := netaddr.IPv4(nk[0], nk[1], nk[2], nk[3])
|
||||
addr := netaddr.IPPrefixFrom(ip, 32)
|
||||
|
@ -1136,7 +1136,7 @@ func TestDiscoMessage(t *testing.T) {
|
||||
peer1Pub := c.DiscoPublicKey()
|
||||
peer1Priv := c.discoPrivate
|
||||
n := &tailcfg.Node{
|
||||
Key: tailcfg.NodeKey(key.NewPrivate().Public()),
|
||||
Key: tailcfg.NodeKeyFromNodePublic(key.NewNode().Public()),
|
||||
DiscoKey: tailcfg.DiscoKeyFromDiscoPublic(peer1Pub),
|
||||
}
|
||||
c.peerMap.upsertEndpoint(&endpoint{
|
||||
|
@ -45,7 +45,7 @@ func TestNoteReceiveActivity(t *testing.T) {
|
||||
}
|
||||
ra := e.recvActivityAt
|
||||
|
||||
nk := tailcfg.NodeKey(key.NewPrivate().Public())
|
||||
nk := tailcfg.NodeKeyFromNodePublic(key.NewNode().Public())
|
||||
|
||||
// Activity on an untracked key should do nothing.
|
||||
e.noteRecvActivity(nk)
|
||||
|
Loading…
x
Reference in New Issue
Block a user