diff options
author | Nick Mathewson <nickm@torproject.org> | 2024-06-24 13:29:04 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2024-06-24 13:29:04 -0400 |
commit | a696559d7844f9e81ae5f8f82ab6e2b8aa421e25 (patch) | |
tree | e92d3d8846310a4fed195903436a84e6b331dc56 /src | |
parent | ef059795873eecae9e25273f9c1332797e5c24f2 (diff) | |
download | tor-a696559d7844f9e81ae5f8f82ab6e2b8aa421e25.tar.gz tor-a696559d7844f9e81ae5f8f82ab6e2b8aa421e25.zip |
prop350: Stop accepting CREATE and EXTEND.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/or/command.c | 8 | ||||
-rw-r--r-- | src/feature/relay/circuitbuild_relay.c | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/core/or/command.c b/src/core/or/command.c index cad7a173b6..c35400d7a1 100644 --- a/src/core/or/command.c +++ b/src/core/or/command.c @@ -331,6 +331,14 @@ command_process_create_cell(cell_t *cell, channel_t *chan) return; } + /* We no longer accept TAP, for any reason. */ + if (create_cell->handshake_type == ONION_HANDSHAKE_TYPE_TAP) { + tor_free(create_cell); + /* TODO: Should we collect statistics here? Should we log? */ + circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL); + return; + } + /* Mark whether this circuit used TAP in case we need to use this * information for onion service statistics later on. */ if (create_cell->handshake_type == ONION_HANDSHAKE_TYPE_FAST || diff --git a/src/feature/relay/circuitbuild_relay.c b/src/feature/relay/circuitbuild_relay.c index ce6cbe6df4..88b578c4a4 100644 --- a/src/feature/relay/circuitbuild_relay.c +++ b/src/feature/relay/circuitbuild_relay.c @@ -443,6 +443,12 @@ circuit_extend(struct cell_t *cell, struct circuit_t *circ) relay_header_unpack(&rh, cell->payload); + /* We no longer accept EXTEND messages; only EXTEND2. */ + if (rh.command == RELAY_COMMAND_EXTEND) { + /* TODO: Should we log this? */ + return -1; + } + if (extend_cell_parse(&ec, rh.command, cell->payload+RELAY_HEADER_SIZE, rh.length) < 0) { |