X-Git-Url: http://www.git.cypherpunks.ru/?p=govpn.git;a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgovpn%2Fhandshake.go;h=054c73e32f3718c7293fb575d91e6ea175a1f09b;hp=a3ef2b5cf536397c176678d38c8fcd4fff70d1d8;hb=8deaf99f98548064f51a3fe5a163456257c089bb;hpb=0bf04621961589bc735dc8bd8a075d7db24c4178 diff --git a/src/cypherpunks.ru/govpn/handshake.go b/src/cypherpunks.ru/govpn/handshake.go index a3ef2b5..054c73e 100644 --- a/src/cypherpunks.ru/govpn/handshake.go +++ b/src/cypherpunks.ru/govpn/handshake.go @@ -1,6 +1,6 @@ /* GoVPN -- simple secure free software virtual private network daemon -Copyright (C) 2014-2016 Sergey Matveev +Copyright (C) 2014-2017 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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