From 1b42ee2849f844793fdb0e3da6619de41fd0525e Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 25 Apr 2025 10:24:50 -0400 Subject: [PATCH] Restore a pair of erroneously removed cases The one in connection_or.c was crucial: it's the thing that made OR negotiation actually work. The one in channeltls.c was just defensive programming, but it's valid defensive programming: by the time we enter from channel_handle_var_cell, channel_tls_process_vesions_cell, we have changed our state via enter_v3_handshake_with_cell. --- src/core/or/channeltls.c | 1 + src/core/or/connection_or.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/core/or/channeltls.c b/src/core/or/channeltls.c index e904fe1c4b..e885033225 100644 --- a/src/core/or/channeltls.c +++ b/src/core/or/channeltls.c @@ -1476,6 +1476,7 @@ channel_tls_process_versions_cell(var_cell_t *cell, channel_tls_t *chan) case OR_CONN_STATE_OR_HANDSHAKING_V3: break; case OR_CONN_STATE_TLS_HANDSHAKING: + case OR_CONN_STATE_SERVER_VERSIONS_WAIT: default: log_fn(LOG_PROTOCOL_WARN, LD_OR, "VERSIONS cell while in unexpected state"); diff --git a/src/core/or/connection_or.c b/src/core/or/connection_or.c index 703d13a28e..c7eb26df00 100644 --- a/src/core/or/connection_or.c +++ b/src/core/or/connection_or.c @@ -597,6 +597,7 @@ connection_or_process_inbuf(or_connection_t *conn) return ret; case OR_CONN_STATE_OPEN: + case OR_CONN_STATE_SERVER_VERSIONS_WAIT: case OR_CONN_STATE_OR_HANDSHAKING_V3: return connection_or_process_cells_from_inbuf(conn); default: -- 2.47.2