1
0
mirror of https://git.zx2c4.com/wireguard-go synced 2024-11-15 09:15:14 +01:00

Added missing mutex acquisition

This commit is contained in:
Mathias Hall-Andersen 2018-02-11 23:07:07 +01:00
parent 8bdadaae59
commit 04ded4c631

View File

@ -62,6 +62,9 @@ func (st *CookieChecker) Init(pk NoisePublicKey) {
} }
func (st *CookieChecker) CheckMAC1(msg []byte) bool { func (st *CookieChecker) CheckMAC1(msg []byte) bool {
st.mutex.RLock()
defer st.mutex.RUnlock()
size := len(msg) size := len(msg)
smac2 := size - blake2s.Size128 smac2 := size - blake2s.Size128
smac1 := smac2 - blake2s.Size128 smac1 := smac2 - blake2s.Size128