diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-07-06 15:43:55 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-07-06 15:43:55 +0200 |
commit | 59f9316f51ce3cb470200b0cfe847116a0583d25 (patch) | |
tree | e9cfb69aa8b58d8b009167730713c4bde67d7cd4 /src/noise_protocol.go | |
parent | 2aa0daf4d58ffc930fde611e7efe6ae3c9515130 (diff) | |
download | wireguard-go-59f9316f51ce3cb470200b0cfe847116a0583d25.tar.gz wireguard-go-59f9316f51ce3cb470200b0cfe847116a0583d25.zip |
Initial working full exchange
The implementation is now capable of connecting to another
wireguard instance, complete a handshake and exchange transport
messages.
Diffstat (limited to '')
-rw-r--r-- | src/noise_protocol.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/noise_protocol.go b/src/noise_protocol.go index 5a62901..0258288 100644 --- a/src/noise_protocol.go +++ b/src/noise_protocol.go @@ -446,10 +446,10 @@ func (peer *Peer) NewKeyPair() *KeyPair { keyPair := new(KeyPair) keyPair.send, _ = chacha20poly1305.New(sendKey[:]) - keyPair.recv, _ = chacha20poly1305.New(recvKey[:]) + keyPair.receive, _ = chacha20poly1305.New(recvKey[:]) keyPair.sendNonce = 0 - keyPair.recvNonce = 0 keyPair.created = time.Now() + keyPair.isInitiator = isInitiator keyPair.localIndex = peer.handshake.localIndex keyPair.remoteIndex = peer.handshake.remoteIndex @@ -462,7 +462,7 @@ func (peer *Peer) NewKeyPair() *KeyPair { }) handshake.localIndex = 0 - // start timer for keypair + // TODO: start timer for keypair (clearing) // rotate key pairs @@ -473,7 +473,7 @@ func (peer *Peer) NewKeyPair() *KeyPair { if isInitiator { if kp.previous != nil { kp.previous.send = nil - kp.previous.recv = nil + kp.previous.receive = nil peer.device.indices.Delete(kp.previous.localIndex) } kp.previous = kp.current |