Commit 80ec51f1 authored by Brendan Mc's avatar Brendan Mc

Added last step of negotiation.

parent 0e185788
......@@ -226,6 +226,15 @@ func Handshake(self, remote *peer.Peer, in, out chan []byte) (chan []byte, chan
}
}()
finished := []byte("Finished")
secureOut <- finished
resp2 := <-secureIn
if bytes.Compare(resp2, finished) != 0 {
return nil, nil, errors.New("Negotiation failed.")
}
u.DOut("[%s] identify: Got node id: %s\n", self.ID.Pretty(), remote.ID.Pretty())
return secureIn, secureOut, nil
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment