Cleanup
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package peer
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"net/netip"
|
||||
"time"
|
||||
"vppn/m"
|
||||
@@ -21,7 +20,6 @@ type remoteFSM struct {
|
||||
lastSeen time.Time
|
||||
traceID uint64
|
||||
probes map[uint64]sentProbe
|
||||
sharedKey [32]byte
|
||||
|
||||
buf []byte
|
||||
}
|
||||
@@ -117,7 +115,6 @@ func (r *remoteFSM) enterServer() stateFunc {
|
||||
|
||||
r.pingTimer.Reset(pingInterval)
|
||||
r.lastSeen = time.Now()
|
||||
clear(r.sharedKey[:])
|
||||
return r.stateServer
|
||||
}
|
||||
|
||||
@@ -174,9 +171,8 @@ func (r *remoteFSM) stateServer_onSyn(msg controlMsg[packetSyn]) {
|
||||
conf.DirectAddr = msg.SrcAddr
|
||||
|
||||
// Update data cipher if the key has changed.
|
||||
if !bytes.Equal(r.sharedKey[:], p.SharedKey[:]) {
|
||||
if !conf.DataCipher.HasKey(p.SharedKey) {
|
||||
conf.DataCipher = newDataCipherFromKey(p.SharedKey)
|
||||
copy(r.sharedKey[:], p.SharedKey[:])
|
||||
}
|
||||
|
||||
r.updateConf(conf)
|
||||
|
||||
Reference in New Issue
Block a user