aboutsummaryrefslogtreecommitdiffstats
path: root/cookie.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2018-02-11 23:07:07 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2018-02-11 23:07:07 +0100
commit04ded4c63183927feba565a43fafc987dba32005 (patch)
treeca363d094317cf96d05a2fbfbb179ab6d2385373 /cookie.go
parentRemoved exported methods from ratelimiter package (diff)
downloadwireguard-go-04ded4c63183927feba565a43fafc987dba32005.tar.xz
wireguard-go-04ded4c63183927feba565a43fafc987dba32005.zip
Added missing mutex acquisition
Diffstat (limited to '')
-rw-r--r--cookie.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/cookie.go b/cookie.go
index 7cea75c..72455a4 100644
--- a/cookie.go
+++ b/cookie.go
@@ -62,6 +62,9 @@ func (st *CookieChecker) Init(pk NoisePublicKey) {
}
func (st *CookieChecker) CheckMAC1(msg []byte) bool {
+ st.mutex.RLock()
+ defer st.mutex.RUnlock()
+
size := len(msg)
smac2 := size - blake2s.Size128
smac1 := smac2 - blake2s.Size128