aboutsummaryrefslogtreecommitdiffstats
path: root/src/noise_protocol.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-07-17 16:16:18 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-07-17 16:16:18 +0200
commitc5d7efc2467abb6cd8365c83fae68da6924c17f2 (patch)
tree0324219cf4979a87fc45fc575e26f7058b0a196f /src/noise_protocol.go
parentAdded padding (diff)
downloadwireguard-go-c5d7efc2467abb6cd8365c83fae68da6924c17f2.tar.xz
wireguard-go-c5d7efc2467abb6cd8365c83fae68da6924c17f2.zip
Fixed deadlock in index.go
Diffstat (limited to '')
-rw-r--r--src/noise_protocol.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/noise_protocol.go b/src/noise_protocol.go
index bfa3797..5fe6fb2 100644
--- a/src/noise_protocol.go
+++ b/src/noise_protocol.go
@@ -459,7 +459,8 @@ func (peer *Peer) NewKeyPair() *KeyPair {
// remap index
- peer.device.indices.Insert(handshake.localIndex, IndexTableEntry{
+ indices := &peer.device.indices
+ indices.Insert(handshake.localIndex, IndexTableEntry{
peer: peer,
keyPair: keyPair,
handshake: nil,
@@ -476,7 +477,7 @@ func (peer *Peer) NewKeyPair() *KeyPair {
if kp.previous != nil {
kp.previous.send = nil
kp.previous.receive = nil
- peer.device.indices.Delete(kp.previous.localIndex)
+ indices.Delete(kp.previous.localIndex)
}
kp.previous = kp.current
kp.current = keyPair