summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2018-09-15 22:17:57 +0200
committerAlexander Færøy <ahf@torproject.org>2018-09-15 22:17:57 +0200
commit3477a73af99eb72f8374928fdc2fab4858485219 (patch)
treebd8b6ce9d76cbe63857d4c7bd93678ad4649324e /src/test
parent9b511dc5d6a9e44bd8c8c644ad9445cab7cdafe2 (diff)
downloadtor-3477a73af99eb72f8374928fdc2fab4858485219.tar.gz
tor-3477a73af99eb72f8374928fdc2fab4858485219.zip
Add proxy headers as early as possible.
This patch moves the logic that adds the proxy headers to an earlier point in the exit connection lifetime, which ensures that the application data cannot be written to the outbuf before the proxy header is added. See: https://bugs.torproject.org/4700
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_hs_service.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c
index 955bcc8aff..dace2b63d8 100644
--- a/src/test/test_hs_service.c
+++ b/src/test/test_hs_service.c
@@ -2047,8 +2047,7 @@ test_export_client_circuit_id(void *arg)
or_circ->global_identifier = 666;
/* Export circuit ID */
- export_hs_client_circuit_id(edge_conn, conn,
- service->config.circuit_id_protocol);
+ export_hs_client_circuit_id(edge_conn, service->config.circuit_id_protocol);
/* Check contents */
cp1 = buf_get_contents(conn->outbuf, &sz);
@@ -2059,8 +2058,7 @@ test_export_client_circuit_id(void *arg)
or_circ->global_identifier = 22;
/* check changes */
- export_hs_client_circuit_id(edge_conn, conn,
- service->config.circuit_id_protocol);
+ export_hs_client_circuit_id(edge_conn, service->config.circuit_id_protocol);
cp2 = buf_get_contents(conn->outbuf, &sz);
tt_str_op(cp1, OP_NE, cp2);
tor_free(cp1);
@@ -2068,8 +2066,7 @@ test_export_client_circuit_id(void *arg)
/* Check that GID with UINT32_MAX works. */
or_circ->global_identifier = UINT32_MAX;
- export_hs_client_circuit_id(edge_conn, conn,
- service->config.circuit_id_protocol);
+ export_hs_client_circuit_id(edge_conn, service->config.circuit_id_protocol);
cp1 = buf_get_contents(conn->outbuf, &sz);
tt_str_op(cp1, OP_EQ,
"PROXY TCP6 fc00:dead:beef:4dad::ffff:ffff ::1 65535 42\r\n");
@@ -2078,8 +2075,7 @@ test_export_client_circuit_id(void *arg)
/* Check that GID with UINT16_MAX works. */
or_circ->global_identifier = UINT16_MAX;
- export_hs_client_circuit_id(edge_conn, conn,
- service->config.circuit_id_protocol);
+ export_hs_client_circuit_id(edge_conn, service->config.circuit_id_protocol);
cp1 = buf_get_contents(conn->outbuf, &sz);
tt_str_op(cp1, OP_EQ,
"PROXY TCP6 fc00:dead:beef:4dad::0:ffff ::1 65535 42\r\n");
@@ -2088,8 +2084,7 @@ test_export_client_circuit_id(void *arg)
/* Check that GID with UINT16_MAX + 7 works. */
or_circ->global_identifier = UINT16_MAX + 7;
- export_hs_client_circuit_id(edge_conn, conn,
- service->config.circuit_id_protocol);
+ export_hs_client_circuit_id(edge_conn, service->config.circuit_id_protocol);
cp1 = buf_get_contents(conn->outbuf, &sz);
tt_str_op(cp1, OP_EQ, "PROXY TCP6 fc00:dead:beef:4dad::1:6 ::1 6 42\r\n");