diff options
author | teor <teor@torproject.org> | 2019-11-06 11:19:38 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-11-06 11:19:38 +1000 |
commit | 03e77ef036e41486b8bfe138d11790c928f49f35 (patch) | |
tree | 637844fa0ea98b61df95dc2985f2cbfe62580a04 /src/core | |
parent | 54e2d0dc2d790a9e84ec44db2d53d535d8076602 (diff) | |
parent | 1bde356bf645f3c3d3b0a6e70c03e2baf9f89d26 (diff) | |
download | tor-03e77ef036e41486b8bfe138d11790c928f49f35.tar.gz tor-03e77ef036e41486b8bfe138d11790c928f49f35.zip |
Merge branch 'maint-0.3.5' into maint-0.4.0
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/or/channeltls.c | 10 | ||||
-rw-r--r-- | src/core/or/connection_edge.c | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/core/or/channeltls.c b/src/core/or/channeltls.c index 5a00a9e00f..d508c91988 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; diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c index 085c641859..20c48bcedd 100644 --- a/src/core/or/connection_edge.c +++ b/src/core/or/connection_edge.c @@ -1610,8 +1610,10 @@ connection_ap_handshake_rewrite(entry_connection_t *conn, * disallowed when they're coming straight from the client, but you're * allowed to have them in MapAddress commands and so forth. */ if (!strcmpend(socks->address, ".exit")) { - log_warn(LD_APP, "The \".exit\" notation is disabled in Tor due to " - "security risks."); + static ratelim_t exit_warning_limit = RATELIM_INIT(60*15); + log_fn_ratelim(&exit_warning_limit, LOG_WARN, LD_APP, + "The \".exit\" notation is disabled in Tor due to " + "security risks."); control_event_client_status(LOG_WARN, "SOCKS_BAD_HOSTNAME HOSTNAME=%s", escaped(socks->address)); out->end_reason = END_STREAM_REASON_TORPROTOCOL; |