]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
Added missing mutex acquisition
authorMathias Hall-Andersen <mathias@hall-andersen.dk>
Sun, 11 Feb 2018 22:07:07 +0000 (23:07 +0100)
committerMathias Hall-Andersen <mathias@hall-andersen.dk>
Sun, 11 Feb 2018 22:07:07 +0000 (23:07 +0100)
cookie.go

index 7cea75c458a7166eaa81c50a22ac075a851aeefd..72455a46f05cdf5d4343cec787a553aa7f2c339d 100644 (file)
--- 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