aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_sendme.c
AgeCommit message (Collapse)Author
2022-02-22Add test for sendme_cell_is_next with sendme_inc of 31Mike Perry
2022-02-22Add test for circuit_sendme_cell_is_next() when sendme_inc is 100.Mike Perry
This ensures compatibility with old tor.
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-05-27Tests for deciding how full our relay cells should beNick Mathewson
2019-05-22sendme: Always pop last SENDME digest from circuitDavid Goulet
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>
2019-05-22sendme: Never fallback to v0 if unknown versionDavid Goulet
There was a missing cell version check against our max supported version. In other words, we do not fallback to v0 anymore in case we do know the SENDME version. We can either handle it or not, never fallback to the unauthenticated version in order to avoid gaming the authenticated logic. Add a unit tests making sure we properly test that and also test that we can always handle the default emit and accepted versions. Fixes #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Record cell digest on both client and exitDavid Goulet
It turns out that only the exit side is validating the authenticated SENDME v1 logic and never the client side. Which means that if a client ever uploaded data towards an exit, the authenticated SENDME logic wouldn't apply. For this to work, we have to record the cell digest client side as well which introduced a new function that supports both type of edges. This also removes a test that is not valid anymore which was that we didn't allow cell recording on an origin circuit (client). Part of #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-04-29sendme: Better function namesDavid Goulet
From nickm's review, improve the names of some functions. Part of #26288 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-04-29sendme: Better handle the random paddingDavid Goulet
We add random padding to every cell if there is room. This commit not only fixes how we compute that random padding length/offset but also improves its safety with helper functions and a unit test. Part of #26288 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-04-29prop289: Keep the digest bytes, not the objectDavid Goulet
The digest object is as large as the entire internal digest object's state, which is often much larger than the actual set of bytes you're transmitting. This commit makes it that we keep the digest itself which is 20 bytes. Part of #26288 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-04-29prop289: Use a 20 bytes digest instead of 4David Goulet
To achieve such, this commit also changes the trunnel declaration to use a union instead of a seperate object for the v1 data. A constant is added for the digest length so we can use it within the SENDME code giving us a single reference. Part of #26288 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-04-29tests: Implement unit tests for SENDME v1David Goulet
Part of #26288 Signed-off-by: David Goulet <dgoulet@torproject.org>