()
| 275 | } |
| 276 | |
| 277 | func (peer *Peer) ExpireCurrentKeypairs() { |
| 278 | handshake := &peer.handshake |
| 279 | handshake.mutex.Lock() |
| 280 | peer.device.indexTable.Delete(handshake.localIndex) |
| 281 | handshake.Clear() |
| 282 | peer.handshake.lastSentHandshake = time.Now().Add(-(RekeyTimeout + time.Second)) |
| 283 | handshake.mutex.Unlock() |
| 284 | |
| 285 | keypairs := &peer.keypairs |
| 286 | keypairs.Lock() |
| 287 | if keypairs.current != nil { |
| 288 | keypairs.current.sendNonce.Store(RejectAfterMessages) |
| 289 | } |
| 290 | if next := keypairs.next.Load(); next != nil { |
| 291 | next.sendNonce.Store(RejectAfterMessages) |
| 292 | } |
| 293 | keypairs.Unlock() |
| 294 | } |
| 295 | |
| 296 | func (peer *Peer) Stop() { |
| 297 | peer.state.Lock() |
no test coverage detected