diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index e9b1ea7e3..813ce19d6 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -735,6 +735,9 @@ next: protoConn := protocol.NewConnection(remoteID, conn, wr, m) l.Infof("Established secure connection to %s at %v", remoteID, conn.RemoteAddr()) + if debugNet { + l.Debugf("cipher suite %04X", conn.ConnectionState().CipherSuite) + } events.Default.Log(events.NodeConnected, map[string]string{ "id": remoteID.String(), "addr": conn.RemoteAddr().String(), diff --git a/protocol/PROTOCOL.md b/protocol/PROTOCOL.md index 385f4335d..adefa0771 100644 --- a/protocol/PROTOCOL.md +++ b/protocol/PROTOCOL.md @@ -25,24 +25,17 @@ Transport and Authentication ---------------------------- BEP is deployed as the highest level in a protocol stack, with the lower -level protocols providing compression, encryption and authentication. +level protocols providing encryption and authentication. +-----------------------------| | Block Exchange Protocol | |-----------------------------| - | Compression (RFC 1951) | - |-----------------------------| | Encryption & Auth (TLS 1.2) | |-----------------------------| | TCP | |-----------------------------| v ... v -Compression is started directly after a successful TLS handshake, -before the first message is sent. The compression is flushed at each -message boundary. Compression SHALL use the DEFLATE format as specified -in RFC 1951. - The encryption and authentication layer SHALL use TLS 1.2 or a higher revision. A strong cipher suite SHALL be used, with "strong cipher suite" being defined as being without known weaknesses and providing diff --git a/protocol/protocol.go b/protocol/protocol.go index af32f503e..8f1ed1a08 100644 --- a/protocol/protocol.go +++ b/protocol/protocol.go @@ -6,7 +6,6 @@ package protocol import ( "bufio" - "compress/flate" "errors" "fmt" "io" @@ -78,14 +77,12 @@ type rawConnection struct { receiver Model state int - reader io.ReadCloser - cr *countingReader - xr *xdr.Reader + cr *countingReader + xr *xdr.Reader - writer io.WriteCloser - cw *countingWriter - wb *bufio.Writer - xw *xdr.Writer + cw *countingWriter + wb *bufio.Writer + xw *xdr.Writer awaiting []chan asyncResult awaitingMut sync.Mutex @@ -113,21 +110,15 @@ func NewConnection(nodeID NodeID, reader io.Reader, writer io.Writer, receiver M cr := &countingReader{Reader: reader} cw := &countingWriter{Writer: writer} - flrd := flate.NewReader(cr) - flwr, err := flate.NewWriter(cw, flate.BestSpeed) - if err != nil { - panic(err) - } - wb := bufio.NewWriter(flwr) + rb := bufio.NewReader(cr) + wb := bufio.NewWriter(cw) c := rawConnection{ id: nodeID, receiver: nativeModel{receiver}, state: stateInitial, - reader: flrd, cr: cr, - xr: xdr.NewReader(flrd), - writer: flwr, + xr: xdr.NewReader(rb), cw: cw, wb: wb, xw: xdr.NewWriter(wb), @@ -485,10 +476,6 @@ func (c *rawConnection) flush() error { return err } - if f, ok := c.writer.(flusher); ok { - return f.Flush() - } - return nil }