aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_relaycell.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2019-05-22 10:37:27 -0400
committerNick Mathewson <nickm@torproject.org>2019-05-22 11:47:20 -0400
commit5479ffabf8ec1a3c63e9f237c6696c4ef0b74a55 (patch)
tree1e3714b79efecf839f36752ad0cbf9ae29616996 /src/test/test_relaycell.c
parent482c4972b996fc7b1a3a8cc13f93c8ecc8748590 (diff)
downloadtor-5479ffabf8ec1a3c63e9f237c6696c4ef0b74a55.tar.gz
tor-5479ffabf8ec1a3c63e9f237c6696c4ef0b74a55.zip
sendme: Always pop last SENDME digest from circuit
We must not accumulate digests on the circuit if the other end point is using another SENDME version that is not using those digests like v0. This commit makes it that we always pop the digest regardless of the version. Part of #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_relaycell.c')
-rw-r--r--src/test/test_relaycell.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index d6372d3956..c65279fb25 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -17,6 +17,7 @@
#include "core/or/circuitbuild.h"
#include "core/or/circuitlist.h"
#include "core/or/connection_edge.h"
+#include "core/or/sendme.h"
#include "core/or/relay.h"
#include "test/test.h"
#include "test/log_test_helpers.h"
@@ -813,6 +814,10 @@ test_circbw_relay(void *arg)
/* Sendme on circuit with non-full window: counted */
PACK_CELL(0, RELAY_COMMAND_SENDME, "");
+ /* Recording a cell, the window is updated after decryption so off by one in
+ * order to record and then we process it with the proper window. */
+ circ->cpath->package_window = 901;
+ sendme_record_cell_digest_on_circ(TO_CIRCUIT(circ), circ->cpath);
circ->cpath->package_window = 900;
connection_edge_process_relay_cell(&cell, TO_CIRCUIT(circ), edgeconn,
circ->cpath);