tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit da8ba5010b59ac3d55563df420711f862faeb2f8
parent 896a1ac50b6ab182c1e15cc5271d0b24fcb90a31
Author: Nick Mathewson <nickm@torproject.org>
Date:   Tue, 17 Sep 2019 09:16:52 -0400

Merge branch 'bug31107_035' into bug31107_040

Diffstat:
Achanges/bug31107 | 4++++
Msrc/core/or/channeltls.c | 10+++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/changes/bug31107 b/changes/bug31107 @@ -0,0 +1,4 @@ + o Minor bugfixes (logging, protocol violations): + - Do not log a nonfatal assertion failure when receiving a VERSIONS + cell on a connection using the obsolete v1 link protocol. Log a + protocol_warn instead. Fixes bug 31107; bugfix on 0.2.4.4-alpha. diff --git a/src/core/or/channeltls.c b/src/core/or/channeltls.c @@ -1106,7 +1106,15 @@ channel_tls_handle_cell(cell_t *cell, or_connection_t *conn) /* do nothing */ break; case CELL_VERSIONS: - tor_fragile_assert(); + /* A VERSIONS cell should always be a variable-length cell, and + * so should never reach this function (which handles constant-sized + * cells). But if the connection is using the (obsolete) v1 link + * protocol, all cells will be treated as constant-sized, and so + * it's possible we'll reach this code. + */ + log_fn(LOG_PROTOCOL_WARN, LD_CHANNEL, + "Received unexpected VERSIONS cell on a channel using link " + "protocol %d; ignoring.", conn->link_proto); break; case CELL_NETINFO: ++stats_n_netinfo_cells_processed;