aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_circuitpadding.c
AgeCommit message (Collapse)Author
2022-02-22Extend info argument updates for non-ntorv3 casesMike Perry
2022-02-22Use protover to signal support for ntor3 + congestion control.Nick Mathewson
2021-07-22circpad: Be smarter on when to send back STOP cells.George Kadianakis
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-07-03Merge branch 'tor-github/pr/1934'George Kadianakis
2020-07-02Extract extend_info manipulation functions into a new file.Nick Mathewson
2020-06-16Bug 32040: TestsMike Perry
2020-06-10Bug 30992: Update testsMike Perry
2019-12-20Replace several C identifiers.teor
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ EXPOSE_CLEAN_BACKTRACE BACKTRACE_PRIVATE \ TOR_CHANNEL_INTERNAL_ CHANNEL_OBJECT_PRIVATE \ CHANNEL_PRIVATE_ CHANNEL_FILE_PRIVATE \ EXPOSE_ROUTERDESC_TOKEN_TABLE ROUTERDESC_TOKEN_TABLE_PRIVATE \ SCHEDULER_PRIVATE_ SCHEDULER_PRIVATE
2019-12-20Code Style: Delete headers that are included twiceteor
These changes were created using the "make autostyle" from 32522, and then split into commits.
2019-10-28test: Add fakecircs.{h|c} helperDavid Goulet
Fake circuits are created everywhere in the unit tests. This is an attempt at centralizing a "fake circuit creation" API like fakechans.c does for channel. This commit introduces fakecircs.c and changes test_relay.c and test_circpadding.c which were using roughly the same code. This will allow easier OR circuit creation for the future tests in test_circuitmux.c Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-19Merge remote-tracking branch 'mike/bug31356+logs-rebased2' into bug31356_finalGeorge Kadianakis
2019-08-12Bug 31356: Propogate protover padding support to circpadMike Perry
2019-08-05Rename handle_relay_command to handle_relay_cell_command .George Kadianakis
As per David's review.
2019-08-05Test that regular cells get ignored in padding circuits.George Kadianakis
2019-06-05Run "make autostyle."Nick Mathewson
2019-05-23Merge branch 'tor-github/pr/1022'David Goulet
2019-05-22circuitpadding tests: Use tt_i64_op() to compare int64_t valuestor-0.4.1.1-alphaNick Mathewson
Bug not in any released Tor.
2019-05-16Refactor intro machines, stage 2/2: Move histogram code.Mike Perry
The client side had garbage histograms and deadcode here, too. That code has been removed. The tests have also been updated to properly test the intro circ by sending padding from the relay side to the client, and verifying that both shut down when padding was up. (The tests previously erroneously tested only the client side of intro circs, which actually were supposed to be doing nothing).
2019-05-16Add unittests for the new machines.George Kadianakis
2019-05-16Add client-side onion service circuit hiding machines.George Kadianakis
2019-05-16Make register_padding_machine part of the public API.George Kadianakis
We are gonna use this function to register our new machine.
2019-05-15Merge branch 'bug28780-squashed3-rebased' into bug28780_rebaseGeorge Kadianakis
2019-05-15Bug 28780: Add testsMike Perry
Also test circpad expiry safeguard.
2019-05-15Add test to explicitly check state lengths and token counts.Mike Perry
Our other tests tested state lengths against padding packets, and token counts against non-padding packets. This test checks state lengths against non-padding packets (and also padding packets too), and checks token counts against padding packets (and also non-padding packets too). The next three commits are needed to make this test pass (it found 3 bugs). Yay?
2019-05-15Eliminate unneeded casts to circuit_t in circpad tests.Mike Perry
2019-05-15Bug 29085: Avoid monotime usage for rtt estimates if it is not in use.Mike Perry
2019-05-15Use reproducible RNG logic in circuitpadding tests.Nick Mathewson
2019-05-15Bug 29085: Minor unit test updates for refactoring.Mike Perry
Deliver nonpadding events instead of calling token removal functions.
2019-05-13Merge branch 'bug28683_30173_29203_squashed'Nick Mathewson
2019-05-13Tests for bugs 28683, 30173, and 29203.Mike Perry
2019-05-03Hiding crypt_path_t: Change code to use the privatization macro.George Kadianakis
2019-05-03Revert "Hiding crypt_path_t: Create a constructor for crypt_path_t."George Kadianakis
This reverts commit ab8b80944967ee5a6a0c45dbf61839cf257bfe44.
2019-05-03Hiding crypt_path_t: Rename some functions to fit the crypt_path API.George Kadianakis
Some of these functions are now public and cpath-specific so their name should signify the fact they are part of the cpath module: assert_cpath_layer_ok -> cpath_assert_layer_ok assert_cpath_ok -> cpath_assert_ok onion_append_hop -> cpath_append_hop circuit_init_cpath_crypto -> cpath_init_circuit_crypto circuit_free_cpath_node -> cpath_free onion_append_to_cpath -> cpath_extend_linked_list
2019-05-03Hiding crypt_path_t: Create a constructor for crypt_path_t.George Kadianakis
We are using an opaque pointer so the structure needs to be allocated on the heap. This means we now need a constructor for crypt_path_t. Also modify all places initializing a crypt_path_t to use the constructor.
2019-05-03Hiding crypt_path_t: Fixup broken unittests.George Kadianakis
2019-05-03Hiding crypt_path_t: Move init functions to crypt_path.c.George Kadianakis
This commit only moves code.
2019-04-05Merge branch 'bug29500_040_monoinit_revert' into bug29500_master_monoinitteor
Apply data structure changes between 0.4.0 and 0.4.1.
2019-04-05Revert "test/circuitpadding: Delete circuitpadding_circuitsetup_machine()"teor
This reverts commit 387d9448de4c5044800706b4ed21b48b4426cb7e.
2019-04-05circuitpadding: comment fixesteor
2019-04-05test/circuitpadding: Delete circuitpadding_circuitsetup_machine()teor
This test was disabled in 0.4.0 and later, but the fix in #29298 was only merged to 0.4.1. So this test will never be re-enabled in 0.4.0. Part of 29500.
2019-04-05Bug #29500: Fix monotime mocking in circpad unittests.Mike Perry
Our monotime mocking forces us to call monotime_init() *before* we set the mocked time value. monotime_init() thus stores the first ratchet value at whatever the platform is at, and then we set fake mocked time to some later value. If monotime_init() gets a value from the host that is greater than what we choose to mock time at for our unittests, all subsequent monotime_abosolute() calls return zero, which breaks all unittests that depend on time moving forward by updating mocked monotime values. So, we need to adjust our mocked time to take the weird monotime_init() time into account, when we set fake time.
2019-04-05Bug 29500: Start monotime at 1000 nsec.Mike Perry
Hopefully this will stop monotime_absolute_usec() from returning 0 on some platforms in the tests.
2019-04-05Bug 29500: Attempt to fix the tokens test.Mike Perry
Cancel the padding timer by changing order of sent vs recv (sent cancels).
2019-03-22Merge remote-tracking branch 'tor-github/pr/819'teor
2019-03-22circpad: Rename circpad_machine_state_t to circpad_machine_runtime_t.George Kadianakis
The name of circpad_machine_state_t was very confusing since it was conflicting with circpad_state_t and circpad_circuit_state_t. Right now here is the current meaning of these structs: circpad_state_t -> A state of the state machine. circpad_machine_runtime_t -> The current mutable runtime info of the state machine. circpad_circuit_state_t -> Circuit conditions based on which we should apply a machine to the circuit
2019-03-21circpad: Don't pad if Tor is in dormant mode.George Kadianakis
This is something we should think about harder, but we probably want dormant mode to be more powerful than padding in case a client has been inactive for a day or so. After all, there are probably no circuits open at this point and dormant mode will not allow the client to open more circuits. Furthermore, padding should not block dormant mode from being activated, since dormant mode relies on SocksPort activity, and circuit padding does not mess with that.
2019-03-14circ: Remove n_mux and p_mux membersDavid Goulet
They are simply not used apart from assigning a pointer and asserting on the pointer depending on the cell direction. Closes #29196. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-03-13Merge branch 'pr_722_squashed'Nick Mathewson
2019-03-13Fix test prob distr parameters that caused warnings.George Kadianakis
They were causing the following warnings in circuitpadding/circuitpadding_sample_distribution: src/lib/math/prob_distr.c:1311:17: runtime error: division by zero SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/lib/math/prob_distr.c:1311:17 in src/lib/math/prob_distr.c:1219:49: runtime error: division by zero SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/lib/math/prob_distr.c:1219:49 in because the distributions were called with erroneous parameters (e.g. geometric distribution with p=0). We now defined these test probability distributions with more realistic parameters. As far as the circuitpadding_sample_distribution() test is concerned, it doesn't matter if the distributions return values outside of [0,10] since we already restrict the values into that interval using min=0 and max=10 (and RTT estimate is disabled).