refactor: (almost) remove dependency of crypto on LocalConnection
This commit is contained in:
1 parent
29c02d2724
commit
ea4e84cdd3
4 files changed
+37
-35
No files matched your search
+3
-3
@@ -102,14 +102,14 @@ func (conn *LocalConnection) handshake(enc *gob.Encoder, dec *gob.Decoder, accep
|
||||
remotePublic[idx] = elem
|
||||
}
|
||||
conn.SessionKey = FormSessionKey(&remotePublic, private, conn.Router.Password)
|
||||
conn.tcpSender = NewEncryptedTCPSender(enc, conn)
|
||||
conn.Decryptor = NewNaClDecryptor(conn)
|
||||
conn.tcpSender = NewEncryptedTCPSender(enc, conn.SessionKey)
|
||||
conn.Decryptor = NewNaClDecryptor(conn.SessionKey)
|
||||
} else {
|
||||
if rpErr == nil {
|
||||
return fmt.Errorf("Remote network is encrypted. Password required.")
|
||||
}
|
||||
conn.tcpSender = NewSimpleTCPSender(enc)
|
||||
conn.Decryptor = NewNonDecryptor(conn)
|
||||
conn.Decryptor = NewNonDecryptor()
|
||||
}
|
||||
|
||||
return conn.setRemote(NewPeer(name, nickNameStr, uid, 0))
|
||||
|
||||
Reference in new issue
Block a user