MCPcopy Create free account
hub / github.com/encodeous/nylon / ExpireCurrentKeypairs

Method ExpireCurrentKeypairs

polyamide/device/peer.go:277–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

275}
276
277func (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
296func (peer *Peer) Stop() {
297 peer.state.Lock()

Callers 1

SetPrivateKeyMethod · 0.80

Calls 2

DeleteMethod · 0.80
ClearMethod · 0.45

Tested by

no test coverage detected