aboutsummaryrefslogtreecommitdiff
path: root/src/or
AgeCommit message (Collapse)Author
2017-04-04hs: Expose hs_service.c functions for unit testsDavid Goulet
In order to avoid src/or/hs_service.o to contain no symbols and thus making clang throw a warning, the functions are now exposed not just to unit tests. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-03Merge remote-tracking branch 'teor/bug21596_030' into maint-0.3.0Nick Mathewson
2017-04-03Merge remote-tracking branch 'public/bug21415_testfix_030' into maint-0.3.0Nick Mathewson
2017-03-27Fix max sampled size logic when in bridge mode.George Kadianakis
When calculating max sampled size, Tor would only count the number of bridges in torrc, without considering that our state file might already have sampled bridges in it. This caused problems when people swap bridges, since the following error would trigger: [warn] Not expanding the guard sample any further; just hit the maximum sample threshold of 1
2017-03-15Merge branch 'bug20059_024_v2' into maint-0.3.0Nick Mathewson
2017-03-15Avoid a double-mark bug when makring a pending circuit as "too old"Nick Mathewson
Fixes bug 20059; bugfix on 0.1.0.1-rc.
2017-03-09Fix failing bridges+ipv6-min integration test.George Kadianakis
The bridges+ipv6-min integration test has a client with bridges: Bridge 127.0.0.1:5003 Bridge [::1]:5003 which got stuck in guard_selection_have_enough_dir_info_to_build_circuits() because it couldn't find the descriptor of both bridges. Specifically, the guard_has_descriptor() function could not find the node_t of the [::1] bridge, because the [::1] bridge had no identity digest assigned to it. After further examination, it seems that during fetching the descriptor for our bridges, we used the CERTS cell to fill the identity digest of 127.0.0.1:5003 properly. However, when we received a CERTS cell from [::1]:5003 we actually ignored its identity digest because the learned_router_identity() function was using get_configured_bridge_by_addr_port_digest() which was returning the 127.0.0.1 bridge instead of the [::1] bridge (because it prioritizes digest matching over addrport matching). The fix replaces get_configured_bridge_by_addr_port_digest() with the recent get_configured_bridge_by_exact_addr_port_digest() function. It also relaxes the constraints of the get_configured_bridge_by_exact_addr_port_digest() function by making it return bridges whose identity digest is not yet known. By using the _exact_() function, learned_router_identity() actually fills in the identity digest of the [::1] bridge, which then allows guard_has_descriptor() to find the right node_t and verify that the descriptor is there. FWIW, in the bridges+ipv6-min test both 127.0.0.1 and [::1] bridges correspond to the same node_t, which I guess makes sense given that it's actually the same underlying bridge.
2017-03-09Revert "Restore correct behavior of 0.3.0.4-rc with bridges+ipv6-min"George Kadianakis
This reverts commit 5298ab59170be74aed20e04e5378ec66eef6476e.
2017-03-08Fix a memory leak in config_get_assigned_option()Nick Mathewson
This was introducd in 4d83999213712c7 in 0.3.0.3-alpha. This is bug 21682.
2017-03-07Merge branch 'bug21594_030_squashed' into maint-0.3.0Nick Mathewson
2017-03-07Remove delay in hidden service introduction point checksteor
Make hidden services with 8 to 10 introduction points check for failed circuits immediately after startup. Previously, they would wait for 5 minutes before performing their first checks. Fixes bug 21594; bugfix on commit 190aac0eab9 in Tor 0.2.3.9-alpha. Reported by alecmuffett.
2017-03-04Merge remote-tracking branch 'teor/bug21576_029_v2' into maint-0.3.0Nick Mathewson
2017-03-02Make hidden services always check for failed intro point connectionsteor
Previously, they would stop checking when they exceeded their intro point creation limit. Fixes bug 21596; bugfix on commit d67bf8b2f23 in Tor 0.2.7.2-alpha. Reported by alecmuffett.
2017-03-02Fix a crash when a connection tries to open just after it has been unlinkedteor
Fixes bug 21576; bugfix on Tor 0.2.9.3-alpha. Reported by alecmuffett.
2017-03-01Restore correct behavior of 0.3.0.4-rc with bridges+ipv6-minNick Mathewson
In that chutney test, the bridge client is configured to connect to the same bridge at 127.0.0.1:5003 _and_ at [::1]:5003, with no change in transports. That meant, I think, that the descriptor is only assigned to the first bridge when it arrives, and never the second.
2017-03-01Improve descriptor checks in the new guard algorithm.George Kadianakis
- Make sure we check at least two guards for descriptor before making circuits. We typically use the first primary guard for circuits, but it can also happen that we use the second primary guard (e.g. if we pick our first primary guard as an exit), so we should make sure we have descriptors for both of them. - Remove BUG() from the guard_has_descriptor() check since we now know that this can happen in rare but legitimate situations as well, and we should just move to the next guard in that case.
2017-02-28Merge remote-tracking branch 'public/bug21007_case2_030' into maint-0.3.0Nick Mathewson
2017-02-28Merge branch 'bug21027_v2_squashed' into maint-0.3.0Nick Mathewson
2017-02-28Change approach to preventing duplicate guards.Nick Mathewson
Previously I'd made a bad assumption in the implementation of prop271 in 0.3.0.1-alpha: I'd assumed that there couldn't be two guards with the same identity. That's true for non-bridges, but in the bridge case, we allow two bridges to have the same ID if they have different addr:port combinations -- in order to have the same bridge ID running multiple PTs. Fortunately, this assumption wasn't deeply ingrained: we stop enforcing the "one guard per ID" rule in the bridge case, and instead enforce "one guard per <id,addr,port>". We also needed to tweak our implementation of get_bridge_info_for_guard, since it made the same incorrect assumption. Fixes bug 21027; bugfix on 0.3.0.1-alpha.
2017-02-27Merge branch 'bug21369_check_029_squashed' into maint-0.3.0Nick Mathewson
2017-02-27Merge remote-tracking branch 'teor/bug20711' into maint-0.3.0Nick Mathewson
2017-02-27Add one other BUG check to try to fix/solve 21369.Nick Mathewson
Teor thinks that this connection_dirserv_add_dir_bytes_to_outbuf() might be the problem, if the "remaining" calculation underflows. So I'm adding a couple of checks there, and improving the casts.
2017-02-27Try to check for (and prevent) buffer size INT_MAX overflow better.Nick Mathewson
Possible fix or diagnostic for 21369.
2017-02-24Whitespace fix.Nick Mathewson
2017-02-24hs: Fix bad use of sizeof() when encoding ESTABLISH_INTRO legacy cellDavid Goulet
When encoding a legacy ESTABLISH_INTRO cell, we were using the sizeof() on a pointer instead of using the real size of the destination buffer leading to an overflow passing an enormous value to the signing digest function. Fortunately, that value was only used to make sure the destination buffer length was big enough for the key size and in this case it always was because of the overflow. Fixes #21553 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-02-24Also allow C_MEASURE_TIMEOUT circuits to lack guard state.Nick Mathewson
Fixes a case of 21007; bugfix on 0.3.0.1-alpha when prop271 was implemented. Found by toralf.
2017-02-17Remove a redundant check in ..transition_affects_guards()Nick Mathewson
scan-build found that we we checking UseEntryGuards twice. Fixes bug 21492.
2017-02-17Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-02-17Check for micro < 0, rather than checking "minor" twice.Nick Mathewson
Bug found with clang scan-build. Fixes bug on f63e06d3dc6757d. Bug not present in any released Tor.
2017-02-15hs: Avoid a strlen(NULL) if descriptor is not found in cacheDavid Goulet
Instead of returning 404 error code, this led to a NULL pointer being used and thus a crash of tor. Fixes #21471 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-02-15Merge branch 'maint-0.2.9'Nick Mathewson
2017-02-15whoops; make 21450 compileNick Mathewson
2017-02-15Merge branch 'maint-0.2.9'Nick Mathewson
2017-02-15Limit version numbers to 0...INT32_MAX.Nick Mathewson
Closes 21450; patch from teor.
2017-02-15Merge branch 'maint-0.2.9'Nick Mathewson
2017-02-15Merge branch 'bug21278_extra_029' into maint-0.2.9Nick Mathewson
2017-02-15Merge branch 'bug21278_redux_029_squashed' into maint-0.2.9Nick Mathewson
2017-02-15Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-02-15Merge branch 'maint-0.2.7' into maint-0.2.8Nick Mathewson
2017-02-15Merge branch 'maint-0.2.6' into maint-0.2.7Nick Mathewson
2017-02-15Merge branch 'maint-0.2.5' into maint-0.2.6Nick Mathewson
2017-02-15Merge branch 'maint-0.2.4' into maint-0.2.5Nick Mathewson
2017-02-15give tor_version_parse_platform some function documentationRoger Dingledine
2017-02-15When examining descriptors as a dirserver, reject ones with bad versionsNick Mathewson
This is an extra fix for bug 21278: it ensures that these descriptors and platforms will never be listed in a legit consensus.
2017-02-15Extract the part of tor_version_as_new_as that extracts platformNick Mathewson
Also add a "strict" mode to reject negative inputs.
2017-02-14Merge remote-tracking branch 'dgoulet/ticket20656_030_01'Nick Mathewson
2017-02-14Merge branch 'bug20894_029_v3'Nick Mathewson
2017-02-14fixup! Don't atoi off the end of a buffer chunk.Nick Mathewson
Use STATIC.
2017-02-14Don't atoi off the end of a buffer chunk.Nick Mathewson
Fixes bug 20894; bugfix on 0.2.0.16-alpha. We already applied a workaround for this as 20834, so no need to freak out (unless you didn't apply 20384 yet).
2017-02-14Prevent int underflow in dirvote.c compare_vote_rs_.Nick Mathewson
This should be "impossible" without making a SHA1 collision, but let's not keep the assumption that SHA1 collisions are super-hard. This prevents another case related to 21278. There should be no behavioral change unless -ftrapv is on.