summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-10-22 12:54:37 -0400
committerNick Mathewson <nickm@torproject.org>2019-10-22 12:54:37 -0400
commit3c071f30029adcbae795150bb7d19ad2f4734658 (patch)
tree1b3458e073a78763c1107fcbf3db82701a70ab1e
parentd08d29f15f0c80b74f6440b8b84eefe241c87aad (diff)
parent3c97ab3c24ba4a133377c7ec6ec89cc6903ffb2e (diff)
downloadtor-3c071f30029adcbae795150bb7d19ad2f4734658.tar.gz
tor-3c071f30029adcbae795150bb7d19ad2f4734658.zip
Merge remote-tracking branch 'tor-github/pr/1330' into maint-0.4.1
-rw-r--r--changes/bug311074
-rw-r--r--src/core/or/channeltls.c10
2 files changed, 13 insertions, 1 deletions
diff --git a/changes/bug31107 b/changes/bug31107
new file mode 100644
index 0000000000..9652927c30
--- /dev/null
+++ 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
index 2a6edc951c..25f3baf924 100644
--- 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;