summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2017-08-24apply ahf's test_assert_zero.cocciNick Mathewson
2017-08-24Fix operator usage in src/test/*.cAlexander Færøy
This patch fixes the operator usage in src/test/*.c to use the symbolic operators instead of the normal C comparison operators. This patch was generated using: ./scripts/coccinelle/test-operator-cleanup src/test/*.[ch]
2017-08-24Merge remote-tracking branch 'dgoulet/ticket17242_032_03-squashed'Nick Mathewson
2017-08-24prop224: Register RP circuit when it opensDavid Goulet
Only register the RP circuit when it opens and not when we send the INTRODUCE1 cell else, when re-extending to a new IP, we would register the same RP circuit with the same cookie twice leading to the circuit being closed. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24test: Fix broken HS upload descriptor testDavid Goulet
We can't trigger a valid upload because it would require us to MOCK a long list of functions ultimately not really testing the upload because we aren't on a running network. Signed-off-by: David Goulet <dgoulet@torproject.org> Conflicts: src/test/test_hs_service.c
2017-08-24prop224: Add client-side rend circuit support to HS circuitmapGeorge Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24test: Add tests for fetching descs and handling SOCKS conns.George Kadianakis
- Add tests that ensure that SOCKS requests for v2/v3 addresses get intercepted and handled. - Add test that stores and lookups an HS descriptor in the client-side cache. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Refactor rendclient.c to use the new hsdir_req code.George Kadianakis
- Also add tests for the hidserv_req subsystem. - Introduce purge_v2_hidserv_req() wrapper to simplify v2 code. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-23Add test_hs_descriptor.inc to include.am to unbreak distcheck.Nick Mathewson
2017-08-2122839: Build tor with rust enabled on winTies Stuij
- make tor_util static library name configurable - fix Rust libary dependency order for Windows
2017-08-21Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-21Merge branch 'bug23291_028' into maint-0.3.1Nick Mathewson
2017-08-2122839: fix check_heap_buffer buffer size in test-memwipeTies Stuij
2017-08-21Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-21whitespace fixesNick Mathewson
2017-08-21Fix triggerable BUG() when decoding hsv3 descriptors.George Kadianakis
Also improve the unittest to make sure it catches the right error.
2017-08-21Add unittest for #23233.George Kadianakis
This will fail currently since the bug is not fixed yet.
2017-08-19prop224: Refactor parse_extended_hostname() to parse v3 addrs.George Kadianakis
We need this func so that we recognize SOCKS conns to v3 addresses. - Also rename rend_valid_service_id() to rend_valid_v2_service_id() - Also move parse_extended_hostname() tests to their own unittest, and add a v3 address to the test as well. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-19prop224: Improve descriptor reupload logic.George Kadianakis
We want to reupload our descriptor if its set of responsible HSDirs changed to minimize reachability issues. This patch adds a callback everytime we get new dirinfo which checks if the hash ring changed and reuploads descriptor if needed.
2017-08-19test: Improve get_responsible_hsdirs test.George Kadianakis
2017-08-19prop224: Only upload descriptor if we have good hash ring and SRV.George Kadianakis
Make sure we have a live consensus (for SRV) and enough descriptors (for hash ring). Also fix unittests that broke.
2017-08-11test: Fix typing issues found by clangDavid Goulet
Partially fix #23224. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11test: Fix memory leak in test_hs_common.cDavid Goulet
Partially fixes #23223 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11test: Fix hs common test for WindowsDavid Goulet
Use the PATH_SEPARATOR for a path comparaison so it works with Windows as well. Partially fix #23223 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-09fix another 32-bit warningNick Mathewson
2017-08-09prop224: Fix coverity warnings from #20657 merge.George Kadianakis
- Fix various ssize_t/size_t confusions in the tests. - Fix a weird memset argument: "bad_memset: Argument -16 in memset loses precision in memset(&desc_two->blinded_kp.pubkey.pubkey, -16, 32UL)." - Fix check_after_deref instance in check_state_line_for_service_rev_counter(): "check_after_deref: Null-checking items suggests that it may be null, but it has already been dereferenced on all paths leading to the check."
2017-08-08Merge branch 'ticket20657_nickm_bugfixes_squashed'Nick Mathewson
2017-08-08Add note about handling INTRODUCE2 cells.George Kadianakis
Also fix a check-spaces instance.
2017-08-08Start caching disaster SRV values.George Kadianakis
Also add some unittests.
2017-08-08Fix the build_hs_index() function.George Kadianakis
Also add a unittest for hs_get_responsible_hsdirs() which was used to find and fix the bug.
2017-08-08prop224 tests: Better HS time period tests.George Kadianakis
2017-08-08prop224 tests: Better HS address tests.George Kadianakis
2017-08-08prop224 tests: Improve SRV protocol tests.George Kadianakis
2017-08-08Fix broken intro point unittest.George Kadianakis
The structure was not zeroed out, and left some boolean fields uninitialized.
2017-08-08prop224 tests: test_gen_establish_intro_cell() check cell contents.George Kadianakis
2017-08-08Don't double hash the ed25519 blind key parameter.George Kadianakis
We used to do: h = H(BLIND_STRING | H(A | s | B | N ) when we should be doing: h = H(BLIND_STRING | A | s | B | N) Change the logic so that hs_common.c does the hashing, and our ed25519 libraries just receive the hashed parameter ready-made. That's easier than doing the hashing on the ed25519 libraries, since that means we would have to pass them a variable-length param (depending on whether 's' is set or not). Also fix the ed25519 test vectors since they were also double hashing.
2017-08-08Fix small easy bugs all aroundGeorge Kadianakis
- Fix log message format string. - Do extra circuit purpose check. - wipe memory in a clear function - Make sure we don't double add intro points in our list - Make sure we don't double close intro circuits. - s/tt_u64_op/tt_i64_op/
2017-08-08Improve documentation all around the codebase.George Kadianakis
2017-08-08Make ed25519 id keys optional for IPs and RPs.George Kadianakis
2017-08-08Relax assertions: turn them to BUGs and non-fatal asserts.George Kadianakis
2017-08-08test: Unbreak test_upload_descriptors()George Kadianakis
To upload the descriptor we needed a state file to write the rev counters in, but that test did not have a state file initialized. Also fix the typo in its func name. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Unit tests for the revision counter state file codetheGeorge Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Refactor the overlap function to not use absolute time.George Kadianakis
We consider to be in overlap mode when we are in the period of time between a fresh SRV and the beginning of the new time period (in the normal network this is between 00:00 and 12:00 UTC). This commit edits that function to use the above semantic logic instead of absolute times. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Compute start time of next time period.George Kadianakis
2017-08-08SR: Calculate current SRV phase/run duration.George Kadianakis
This is also needed to make the HS desc overlap mode function independent of absolute hours.
2017-08-08SR: Compute the start time of the current protocol run.George Kadianakis
This function will be used to make the HS desc overlap function be independent of absolute times.
2017-08-08hs: Rename num_rend_services()David Goulet
Renamed to rend_num_services() so it is consistent with the legacy naming. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Fix prop224 HS descriptor to use subcredentialGeorge Kadianakis
We used to use NULL subcredential which is a terrible terrible idea. Refactor HS unittests to use subcredentials. Also add some non-fatal asserts to make sure that we always use subcredentials when decoding/encoding descs. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Add unit test coverage of hs_service.cDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Refactor HS tests to use the new ESTABLISH_INTRO cell codeDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>