]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/cypherpunks.ru/govpn/handshake.go
Fix handshake peer identification
[govpn.git] / src / cypherpunks.ru / govpn / handshake.go
index 47fe4e9056f1131d8e2b3e7b361cee0d24c585c6..054c73e32f3718c7293fb575d91e6ea175a1f09b 100644 (file)
@@ -141,8 +141,8 @@ func idTag(id *PeerId, timeSync int, data []byte) []byte {
                panic(err)
        }
        mac.Write(enc)
-       mac.Sum(enc[:0])
-       return enc
+       sum := mac.Sum(nil)
+       return sum[len(sum)-8:]
 }
 
 // Start handshake's procedure from the client. It is the entry point