aboutsummaryrefslogtreecommitdiff
path: root/device/peer.go
diff options
context:
space:
mode:
authorDavid Crawshaw <crawshaw@tailscale.com>2020-04-07 15:52:04 +1000
committerDavid Crawshaw <crawshaw@tailscale.com>2020-04-07 15:52:41 +1000
commitf6020a2085d9a6b911c00875752bb40bfe629e00 (patch)
treecc89cec68f8a182dfc36206e268c9dc8f0a5d3f2 /device/peer.go
parentad256f0b739b835e8836f84571424cb4adc01b1e (diff)
downloadwireguard-go-f6020a2085d9a6b911c00875752bb40bfe629e00.tar.gz
wireguard-go-f6020a2085d9a6b911c00875752bb40bfe629e00.zip
Revert "device: use wgcfg key types"
More cleanup work of wgcfg to do before bringing this in. This reverts commit 83ca9b47b63b4d07630c4d579faf1111e42537d3.
Diffstat (limited to 'device/peer.go')
-rw-r--r--device/peer.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/device/peer.go b/device/peer.go
index 3ec625f..a96f261 100644
--- a/device/peer.go
+++ b/device/peer.go
@@ -14,7 +14,6 @@ import (
"time"
"golang.zx2c4.com/wireguard/conn"
- "golang.zx2c4.com/wireguard/wgcfg"
)
const (
@@ -77,8 +76,7 @@ type Peer struct {
cookieGenerator CookieGenerator
}
-func (device *Device) NewPeer(pk wgcfg.Key) (*Peer, error) {
-
+func (device *Device) NewPeer(pk NoisePublicKey) (*Peer, error) {
if device.isClosed.Get() {
return nil, errors.New("device closed")
}
@@ -118,7 +116,7 @@ func (device *Device) NewPeer(pk wgcfg.Key) (*Peer, error) {
handshake := &peer.handshake
handshake.mutex.Lock()
- handshake.precomputedStaticStatic = device.staticIdentity.privateKey.SharedSecret(pk)
+ handshake.precomputedStaticStatic = device.staticIdentity.privateKey.sharedSecret(pk)
handshake.remoteStatic = pk
handshake.mutex.Unlock()