aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2019-06-05Run "make autostyle."Nick Mathewson
2019-06-05Merge remote-tracking branch 'tor-github/pr/1053'Nick Mathewson
2019-05-31test: Add test_hs_circ.c for HS circuit testingDavid Goulet
For now, only tests HS circuit repurpose function. Part of #29034 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-29Merge branch 'tor-github/pr/1032'George Kadianakis
2019-05-29Merge branch 'maint-0.4.0'George Kadianakis
2019-05-29Merge branch 'tor-github/pr/924' into maint-0.4.0George Kadianakis
2019-05-28Merge branch 'tor-github/pr/1047'David Goulet
2019-05-27Merge branch 'tor-github/pr/1043'George Kadianakis
2019-05-27Tests for deciding how full our relay cells should beNick Mathewson
2019-05-23Coverage: do not include test-rebind in coverage builds.Nick Mathewson
Because it invokes the Tor mainloop, it does unpredictable things to test coverage of a lot of code that it doesn't actually test at all. (It is more an integration test than anything else.)
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-22Merge remote-tracking branch 'dgoulet/ticket30454_035_01'Nick Mathewson
2019-05-22Merge branch 'ticket30428_041_02_squashed'Nick 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: Validate v1 SENDMEs on both client and exit sideDavid Goulet
The validation of the SENDME cell is now done as the very first thing when receiving it for both client and exit. On failure to validate, the circuit is closed as detailed in the specification. Part of #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-05-22Merge remote-tracking branch 'nickm/ticket30454_034_01_squashed' into ↵David Goulet
ticket30454_035_01
2019-05-20hs: Remove hs_intro_auth_key_type_t enumDavid Goulet
Like the previous commit about the INTRODUCE_ACK status code, change all auth key type to use the one defined in the trunnel file. Standardize the use of these auth type to a common ABI. Part of #30454 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-17Don't forget to use the mutex in testing_enable_prefilled_rng()rl1987
2019-05-16test_channel_listener: free 'chan' explicitlyNick Mathewson
This should fix CID 1437442, where coverity can't tell that channel_free_all() frees the fake channel we allocated.
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-16hs tests: explicitly free 'service' variable.Nick Mathewson
This should fix about 15 CID issues, where coverity can't tell that hs_free_all() frees the service we allocated.
2019-05-16rng_test_helpers: add a needless lock/unlock pair to please coverityNick Mathewson
Fix for CID 1444908
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-15Testing: allow the user to pass a seed in for reproducible-RNG testsNick Mathewson
The environment variable TOR_TEST_RNG_SEED, if provided, is a hex value for the RNG seed.
2019-05-15Use new RNG and tinytest code to simplify prob_distr testsNick Mathewson
Since the reproducible RNG dumps its own seed, we don't need to do it for it. Since tinytest can tell us if the test failed, we don't need our own test_failed booleans.
2019-05-15Make testing_disable_reproducible_rng() log seed on test failureNick Mathewson
This should let us simplify test_prob_distr.c and other stuff in the future.
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-13Merge branch 'tor-github/pr/976'David Goulet
2019-05-10Merge branch 'tor-github/pr/973'George Kadianakis
2019-05-08Merge branch 'tor-github/pr/1000'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-07Merge branch 'tor-github/pr/994'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
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: Trivial changes to satisfy check-local.George Kadianakis
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