Clear cryptographic state when interface down

Attempts to clear the cryptographic state for every
peer when the device goes down.
This commit is contained in:
Mathias Hall-Andersen
2018-02-02 17:24:29 +01:00
parent 029410b118
commit 4f97b52ea6
5 changed files with 58 additions and 41 deletions
+1 -6
View File
@@ -274,12 +274,7 @@ func (peer *Peer) RoutineTimerHandler() {
// zero out handshake
device.indices.Delete(hs.localIndex)
hs.localIndex = 0
setZero(hs.localEphemeral[:])
setZero(hs.remoteEphemeral[:])
setZero(hs.chainKey[:])
setZero(hs.hash[:])
hs.Clear()
hs.mutex.Unlock()
// handshake timers