cosmetic: don't mention UDP in mesh
This commit is contained in:
1 parent
dd7ffa4501
commit
1eed5fd271
2 files changed
+2
-5
No files matched your search
@@ -35,7 +35,8 @@ func FormSessionKey(remotePublicKey, localPrivateKey *[32]byte, secretKey []byte
|
|||||||
// sender - '1' for outbound; the next indicates protocol type - '1'
|
// sender - '1' for outbound; the next indicates protocol type - '1'
|
||||||
// for TCP. The remaining 126 bits are zero. The polarity is needed so
|
// for TCP. The remaining 126 bits are zero. The polarity is needed so
|
||||||
// that the two ends of a connection do not use the same nonces; the
|
// that the two ends of a connection do not use the same nonces; the
|
||||||
// protocol type so that the TCP and UDP sender nonces are disjoint.
|
// protocol type so that the TCP connection nonces are distinct from
|
||||||
|
// nonces used by overlay connections, if they share the session key.
|
||||||
// This is a requirement of the NaCl Security Model; see
|
// This is a requirement of the NaCl Security Model; see
|
||||||
// http://nacl.cr.yp.to/box.html.
|
// http://nacl.cr.yp.to/box.html.
|
||||||
type TCPCryptoState struct {
|
type TCPCryptoState struct {
|
||||||
@@ -49,7 +50,6 @@ func NewTCPCryptoState(sessionKey *[32]byte, outbound bool) *TCPCryptoState {
|
|||||||
if outbound {
|
if outbound {
|
||||||
s.nonce[0] |= (1 << 7)
|
s.nonce[0] |= (1 << 7)
|
||||||
}
|
}
|
||||||
// Ensure that TCP and UDP sequences are disjoint
|
|
||||||
s.nonce[0] |= (1 << 6)
|
s.nonce[0] |= (1 << 6)
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,9 +109,6 @@ func (router *Router) listenTCP(localPort int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (router *Router) acceptTCP(tcpConn *net.TCPConn) {
|
func (router *Router) acceptTCP(tcpConn *net.TCPConn) {
|
||||||
// someone else is dialing us, so our udp sender is the conn
|
|
||||||
// on router.Port and we wait for them to send us something on UDP to
|
|
||||||
// start.
|
|
||||||
remoteAddrStr := tcpConn.RemoteAddr().String()
|
remoteAddrStr := tcpConn.RemoteAddr().String()
|
||||||
log.Printf("->[%s] connection accepted", remoteAddrStr)
|
log.Printf("->[%s] connection accepted", remoteAddrStr)
|
||||||
connRemote := NewRemoteConnection(router.Ourself.Peer, nil, remoteAddrStr, false, false)
|
connRemote := NewRemoteConnection(router.Ourself.Peer, nil, remoteAddrStr, false, false)
|
||||||
|
|||||||
Reference in new issue
Block a user