diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-07 22:27:03 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-10 16:08:03 +0200 |
commit | 233f079a9479279d2aab68f4accb139ee87ad664 (patch) | |
tree | 338dfb681ffafbb53b81d353aa5612866ff935f5 /keypair.go | |
parent | 375dcbd4aefc8054700dcb072a5e74a9ed7e9d39 (diff) | |
download | wireguard-go-233f079a9479279d2aab68f4accb139ee87ad664.tar.gz wireguard-go-233f079a9479279d2aab68f4accb139ee87ad664.zip |
Rewrite timers and related state machines
Diffstat (limited to 'keypair.go')
-rw-r--r-- | keypair.go | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -18,7 +18,7 @@ import ( * we plan to resolve this issue; whenever Go allows us to do so. */ -type KeyPair struct { +type Keypair struct { sendNonce uint64 send cipher.AEAD receive cipher.AEAD @@ -29,20 +29,20 @@ type KeyPair struct { remoteIndex uint32 } -type KeyPairs struct { +type Keypairs struct { mutex sync.RWMutex - current *KeyPair - previous *KeyPair - next *KeyPair // not yet "confirmed by transport" + current *Keypair + previous *Keypair + next *Keypair // not yet "confirmed by transport" } -func (kp *KeyPairs) Current() *KeyPair { +func (kp *Keypairs) Current() *Keypair { kp.mutex.RLock() defer kp.mutex.RUnlock() return kp.current } -func (device *Device) DeleteKeyPair(key *KeyPair) { +func (device *Device) DeleteKeypair(key *Keypair) { if key != nil { device.indices.Delete(key.localIndex) } |