aboutsummaryrefslogtreecommitdiffstats
path: root/device/noise-protocol.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* global: update header comments and modulesJason A. Donenfeld2020-05-021-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* device: use atomic access for unlocked keypair.nextJason A. Donenfeld2020-05-021-7/+9
| | | | | | | | | Go's GC semantics might not always guarantee the safety of this, and the race detector gets upset too, so instead we wrap this all in atomic accessors. Reported-by: David Anderson <danderson@tailscale.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* device: add debug logs describing handshake rejectionAvery Pennarun2020-05-021-4/+8
| | | | | | | Useful in testing when bad network stacks repeat or batch large numbers of packets. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
* device: give handshake state a typeDavid Crawshaw2020-05-021-17/+38
| | | | | | And unexport handshake constants. Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
* noise: unify zero checking of ecdhJason A. Donenfeld2020-03-171-53/+47
|
* global: fix a few typos courtesy of codespellJonathan Tooker2019-10-221-3/+3
| | | | Signed-off-by: Jonathan Tooker <jonathan.tooker@netprotect.com>
* device: recheck counters while holding write lockJason A. Donenfeld2019-10-171-2/+7
|
* device, ratelimiter: replace uses of time.Now().Sub() with time.Since()Matt Layher2019-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Simplification found by staticcheck: $ staticcheck ./... | grep S1012 device/cookie.go:90:5: should use time.Since instead of time.Now().Sub (S1012) device/cookie.go:127:5: should use time.Since instead of time.Now().Sub (S1012) device/cookie.go:242:5: should use time.Since instead of time.Now().Sub (S1012) device/noise-protocol.go:304:13: should use time.Since instead of time.Now().Sub (S1012) device/receive.go:82:46: should use time.Since instead of time.Now().Sub (S1012) device/send.go:132:5: should use time.Since instead of time.Now().Sub (S1012) device/send.go:139:5: should use time.Since instead of time.Now().Sub (S1012) device/send.go:235:59: should use time.Since instead of time.Now().Sub (S1012) device/send.go:393:9: should use time.Since instead of time.Now().Sub (S1012) ratelimiter/ratelimiter.go:79:10: should use time.Since instead of time.Now().Sub (S1012) ratelimiter/ratelimiter.go:87:10: should use time.Since instead of time.Now().Sub (S1012) Change applied using: $ find . -type f -name "*.go" -exec sed -i "s/Now().Sub(/Since(/g" {} \; Signed-off-by: Matt Layher <mdlayher@gmail.com>
* global: regroup all importsJason A. Donenfeld2019-05-141-2/+3
|
* global: begin modularizationJason A. Donenfeld2019-03-031-0/+600