X-Git-Url: http://www.git.cypherpunks.ru/?p=govpn.git;a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgovpn%2Fhandshake.go;h=054c73e32f3718c7293fb575d91e6ea175a1f09b;hp=c71ed3ba9c40d5ef4a9e189a1d324c7a1ebff1c9;hb=8deaf99f98548064f51a3fe5a163456257c089bb;hpb=572cac17bde738055312f7a468a0bde0e760a262 diff --git a/src/cypherpunks.ru/govpn/handshake.go b/src/cypherpunks.ru/govpn/handshake.go index c71ed3b..054c73e 100644 --- a/src/cypherpunks.ru/govpn/handshake.go +++ b/src/cypherpunks.ru/govpn/handshake.go @@ -141,13 +141,13 @@ 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 -// for starting the handshake procedure. // First handshake packet -// will be sent immediately. +// for starting the handshake procedure. +// First handshake packet will be sent immediately. func HandshakeStart(addr string, conn io.Writer, conf *PeerConf) *Handshake { state := NewHandshake(addr, conn, conf) var dhPubRepr *[32]byte