sendme: Add non fatal asserts for extra safety
commit0cad83bea4019b3c448756d718f5b65718e81f6e
authorDavid Goulet <dgoulet@torproject.org>
Wed, 22 May 2019 15:05:36 +0000 (22 11:05 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 22 May 2019 15:47:20 +0000 (22 11:47 -0400)
tree0397595af7c15a35d882df24b830a8d2641b1ab0
parent5479ffabf8ec1a3c63e9f237c6696c4ef0b74a55
sendme: Add non fatal asserts for extra safety

Two non fatal asserts are added in this commit. First one is to see if the
SENDME digest list kept on the circuit for validation ever grows bigger than
the maximum number of expected SENDME on a circuit (currently 10).

The second one is to know if we ever send more than one SENDME at a time on a
circuit. In theory, we shouldn't but if we ever do, the v1 implementation
wouldn't work because we only keep one single cell digest (the previous cell
to the SENDME) on the circuit/cpath. Thus, sending two SENDME consecutively
will lead to a mismatch on the other side because the same cell digest would
be use and thus the circuit would collapse.

Finally, add an extra debug log in case we emit a v0 which also includes the
consensus emit version in that case.

Part of #30428

Signed-off-by: David Goulet <dgoulet@torproject.org>
src/core/or/sendme.c