return from peer loop if crypto fails, oops

This commit is contained in:
zelig 2015-01-23 13:04:28 +00:00
parent 7f12ac702f
commit 876fd8bd17

View file

@ -349,6 +349,7 @@ func (p *Peer) handleCryptoHandshake() (err error) {
// this bit handles the handshake and creates a secure communications channel with
if sessionToken, crw, err = crypto.NewSession(bufio.NewReader(p.conn), p.conn, p.PublicKey(), sessionToken, initiator); err != nil {
p.Errorf("unable to setup secure session: %v", err)
return
}
default:
err = fmt.Errorf("unrecognised crypto type %v", p.CryptoType)