Age | Commit message (Collapse) | Author |
|
|
|
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]
|
|
|
|
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>
|
|
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
|
|
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
- 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>
|
|
- 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>
|
|
|
|
- make tor_util static library name configurable
- fix Rust libary dependency order for Windows
|
|
|
|
|
|
|
|
|
|
|
|
Also improve the unittest to make sure it catches the right error.
|
|
This will fail currently since the bug is not fixed yet.
|
|
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>
|
|
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.
|
|
|
|
Make sure we have a live consensus (for SRV) and enough descriptors (for
hash ring).
Also fix unittests that broke.
|
|
Partially fix #23224.
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
Partially fixes #23223
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
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>
|
|
|
|
- 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."
|
|
|
|
Also fix a check-spaces instance.
|
|
Also add some unittests.
|
|
Also add a unittest for hs_get_responsible_hsdirs() which was used to
find and fix the bug.
|
|
|
|
|
|
|
|
The structure was not zeroed out, and left some boolean fields
uninitialized.
|
|
|
|
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.
|
|
- 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/
|
|
|
|
|
|
|
|
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>
|
|
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
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>
|
|
|
|
This is also needed to make the HS desc overlap mode function
independent of absolute hours.
|
|
This function will be used to make the HS desc overlap function be
independent of absolute times.
|
|
Renamed to rend_num_services() so it is consistent with the legacy naming.
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
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>
|
|
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
Signed-off-by: David Goulet <dgoulet@torproject.org>
|