refactor: small tweak for consistency

This commit is contained in:
Matthias Radestock committed 2015-03-27 12:17:28 +00:00
1 parent 60ba8cb90d
commit d25d295784
1 file changed
+2 -2
+2 -2
View File
@@ -114,8 +114,8 @@ func (conn *LocalConnection) handshake(enc *gob.Encoder, dec *gob.Decoder, accep
} }
conn.uid = localConnID ^ remoteConnID conn.uid = localConnID ^ remoteConnID
remotePublicStr, rpErr := fv.Value("PublicKey")
if usingPassword { if usingPassword {
remotePublicStr, rpErr := fv.Value("PublicKey")
if rpErr != nil { if rpErr != nil {
return rpErr return rpErr
} }
@@ -131,7 +131,7 @@ func (conn *LocalConnection) handshake(enc *gob.Encoder, dec *gob.Decoder, accep
conn.tcpSender = NewEncryptedTCPSender(enc, conn) conn.tcpSender = NewEncryptedTCPSender(enc, conn)
conn.Decryptor = NewNaClDecryptor(conn) conn.Decryptor = NewNaClDecryptor(conn)
} else { } else {
if _, found := handshakeRecv["PublicKey"]; found { if rpErr == nil {
return fmt.Errorf("Remote network is encrypted. Password required.") return fmt.Errorf("Remote network is encrypted. Password required.")
} }
conn.tcpSender = NewSimpleTCPSender(enc) conn.tcpSender = NewSimpleTCPSender(enc)