summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-06-05Bump to 0.4.1.2-alphaNick Mathewson
2019-06-05Merge remote-tracking branch 'tor-github/pr/1053'Nick Mathewson
2019-06-05Merge branch 'tor-github/pr/1072'George Kadianakis
2019-06-04Merge branch 'tor-github/pr/1067'David Goulet
2019-06-04Merge branch 'bug29670_035' into bug29670_041Nick Mathewson
2019-06-03sendme: Do not decrement window in a log_debug()David Goulet
If "Log debug ..." is not set, the decrement never happens. This lead to the package/deliver window to be out of sync at the stream level and thus breaking the connection after 50+ cells. Fixes #30628 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-31Merge branch 'bug29875_035' into bug29875_masterNick Mathewson
2019-05-31num_bridges_usable(): only count configured bridges.Nick Mathewson
When this function was implemented, it counted all the entry guards in the bridge set. But this included previously configured bridges, as well as currently configured ones! Instead, only count the _filtered_ bridges (ones that are configured and possibly reachable) as maybe usable. Fixes bug 29875; bugfix on 0.3.0.1-alpha.
2019-05-31Consider dir info to have changed when the bridges changeNick Mathewson
Otherwise, we won't realize that we haven't got enough bridge information to build circuits. Part of a fix for ticket 29875.
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-30Merge branch 'tor-github/pr/1059'George Kadianakis
2019-05-30Merge branch 'tor-github/pr/1057'David Goulet
2019-05-30Merge branch 'tor-github/pr/1055'David Goulet
2019-05-30Merge branch 'tor-github/pr/1054'David Goulet
2019-05-30Merge branch 'tor-github/pr/1049'David Goulet
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-29Shutdown libevent _after_ the subsystems.Nick Mathewson
This is necessary since shutting down libevent frees some pointer that the subsystems want to free themselves. A longer term solution will be to turn the evloop module into a subsystem itself, but for now it is best to do the minimal fix. Fixes bug 30629; bugfix on 0.4.1.1-alpha.
2019-05-29Make get_proxy_type() connection-specificNick Mathewson
Previously, we were looking at our global settings to see what kind of proxy we had. But doing this would sometimes give us the wrong results when we had ClientTransportPlugin configured but we weren't using it for a particular connection. In several places in the code, we had added checks to see if we were _really_ using a PT or whether we were using a socks proxy, but we had forgotten to do so in at least once case. Instead, since every time we call this function we are asking about a single connection, it is probably best just to make this function connection-specific. Fixes bug 29670; bugfix on 0.2.6.2-alpha.
2019-05-29Remove want_cmddata from HSFETCH, which does not in fact want dataNick Mathewson
This looks a copy-and-paste error to me. Fixes bug 30646; bugfix on 0.4.1.1-alpha.
2019-05-29Merge branch 'ticket30561_029' into ticket30561_035Nick Mathewson
2019-05-29hs: Implement a helper to repurpose a circuitDavid Goulet
When we repurpose a hidden service circuit, we need to clean up from the HS circuit map and any HS related data structured contained in the circuit. This commit adds an helper function that does it when repurposing a hidden service circuit. Fixes #29034 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-29Tweak comments in tor_vasprintf(), and add a changes file for 30651Nick Mathewson
2019-05-29Fixed tor_vasprintf on systems without vasprintf.Tobias Stoeckmann
If tor is compiled on a system with neither vasprintf nor _vscprintf, the fallback implementation exposes a logic flaw which prevents proper usage of strings longer than 127 characters: * tor_vsnprintf returns -1 if supplied buffer is not large enough, but tor_vasprintf uses this function to retrieve required length * the result of tor_vsnprintf is not properly checked for negative return values Both aspects together could in theory lead to exposure of uninitialized stack memory in the resulting string. This requires an invalid format string or data that exceeds integer limitations. Fortunately tor is not even able to run with this implementation because it runs into asserts early on during startup. Also the unit tests fail during a "make check" run. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> [backported to 0.2.9 by nickm]
2019-05-29Use MAP_INHERIT_ZERO or MAP_INHERIT_NONE if available.Taylor R Campbell
Fixes assertion failure in tests on NetBSD: slow/prob_distr/stochastic_log_logistic: [forking] May 25 03:56:58.091 [err] tor_assertion_failed_(): Bug: src/lib/crypt_ops/crypto_rand_fast.c:184: crypto_fast_rng_new_from_seed: Assertion inherit != INHERIT_RES_KEEP failed; aborting. (on Tor 0.4.1.1-alpha-dev 29955f13e5bc8e61) May 25 03:56:58.091 [err] Bug: Assertion inherit != INHERIT_RES_KEEP failed in crypto_fast_rng_new_from_seed at src/lib/crypt_ops/crypto_rand_fast.c:184: . (Stack trace not available) (on Tor 0.4.1.1-alpha-dev 29955f13e5bc8e61) [Lost connection!]
2019-05-28Trivial fix for a trivial warning with gcc 9.1.1Nick Mathewson
Fix on 4e3d144fb0940d8ee5a89427d471ea3656e8e122; bug not in any released Tor.
2019-05-28Merge branch 'tor-github/pr/1047'David Goulet
2019-05-27Merge branch 'tor-github/pr/1042'George Kadianakis
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-27Make sure that we send at least some random data in RELAY_DATA cellsNick Mathewson
Proposal 289 prevents SENDME-flooding by requiring the other side to authenticate the data it has received. But this data won't actually be random if they are downloading a known resource. "No problem", we said, "let's fell the empty parts of our cells with some randomness!" and we did that in #26871. Unfortunately, if the relay data payloads are all completely full, there won't be any empty parts for us to randomize. Therefore, we now pick random "randomness windows" between CIRCWINDOW_INCREMENT/2 and CIRCWINDOW_INCREMENT. We remember whether we have sent a cell containing at least 16 bytes of randomness in that window. If we haven't, then when the window is exhausted, we send one. (This window approach is designed to lower the number of rng checks we have to do. The number 16 is pulled out of a hat to change the attacker's guessing difficulty to "impossible".) Implements 28646.
2019-05-26trivial whitespace fixesRoger Dingledine
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-23In coverage builds, use branch-free timeradd() and timersub()Nick Mathewson
The ordinary definitions of timeradd() and timersub() contain a branch. However, in coverage builds, this means that we get spurious complaints about partially covered basic blocks, in a way that makes our coverage determinism harder to check.
2019-05-23In coverage builds, avoid basic-block complexity in log_debugNick Mathewson
Ordinarily we skip calling log_fn(LOG_DEBUG,...) if debug logging is completely disabled. However, in coverage builds, this means that we get spurious complaints about partially covered basic blocks, in a way that makes our coverage determinism harder to check.
2019-05-23Merge branch 'tor-github/pr/1022'David Goulet
2019-05-23Merge branch 'tor-github/pr/1034'David Goulet
2019-05-23Merge branch 'tor-github/pr/988'David Goulet
2019-05-23Extract length-deciding function from package_raw_inbuf.Nick Mathewson
2019-05-23refactor logic to decide how much to package from inbufRoger Dingledine
no actual changes in behavior
2019-05-23Only reject POSTDESCRIPTOR purpose= when the purpose is unrecognizedNick Mathewson
Fixes bug 30580; bugfix on 0.4.1.1-alpha.
2019-05-22Now this repository is full of 0.4.1.1-alpha-devNick Mathewson
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-22Bump to 0.4.1.1-alphaNick Mathewson
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: Add non fatal asserts for extra safetyDavid Goulet
Two non fatal asserts are added in this commit. First one is to see if the SENDME digest list kept on the circuit for validation ever grows bigger than the maximum number of expected SENDME on a circuit (currently 10). The second one is to know if we ever send more than one SENDME at a time on a circuit. In theory, we shouldn't but if we ever do, the v1 implementation wouldn't work because we only keep one single cell digest (the previous cell to the SENDME) on the circuit/cpath. Thus, sending two SENDME consecutively will lead to a mismatch on the other side because the same cell digest would be use and thus the circuit would collapse. Finally, add an extra debug log in case we emit a v0 which also includes the consensus emit version in that case. Part of #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
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: Clarify how sendme_circuit_cell_is_next() worksDavid Goulet
Commit 4ef8470fa5480d3b was actually reverted before because in the end we needed to do this minus 1 check on the window. This commit clarifies that in the code, takes the useful comment changes from 4ef8470fa5480d3b and makes sendme_circuit_cell_is_next() private since it behaves in a very specific way that one external caller might expect. Part of #30428. Signed-off-by: David Goulet <dgoulet@torproject.org>