From 04ded4c63183927feba565a43fafc987dba32005 Mon Sep 17 00:00:00 2001 From: Mathias Hall-Andersen Date: Sun, 11 Feb 2018 23:07:07 +0100 Subject: [PATCH] Added missing mutex acquisition --- cookie.go | 3 +++ 1 file changed, 3 insertions(+) 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