X-Git-Url: http://www.git.cypherpunks.ru/?p=govpn.git;a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgovpn%2Fidentity.go;h=d738c5563e091179bd1e1fa287fb1bbcbd6ef1d9;hp=09f7e337b361bb629f1213616567048d5108e9b1;hb=8deaf99f98548064f51a3fe5a163456257c089bb;hpb=20ff2ad78ed00dea12b7fd689963a863a53ef993 diff --git a/src/cypherpunks.ru/govpn/identity.go b/src/cypherpunks.ru/govpn/identity.go index 09f7e33..d738c55 100644 --- a/src/cypherpunks.ru/govpn/identity.go +++ b/src/cypherpunks.ru/govpn/identity.go @@ -113,9 +113,9 @@ func (mc *MACCache) Find(data []byte) *PeerId { mt.l.Lock() mt.mac.Reset() mt.mac.Write(buf) - mt.mac.Sum(buf[:0]) + sum := mt.mac.Sum(nil) mt.l.Unlock() - if subtle.ConstantTimeCompare(buf, data[len(data)-8:]) == 1 { + if subtle.ConstantTimeCompare(sum[len(sum)-8:], data[len(data)-8:]) == 1 { ppid := PeerId(pid) mc.l.RUnlock() return &ppid