summaryrefslogtreecommitdiff
path: root/src/or/main.c
AgeCommit message (Collapse)Author
2017-03-01Prevent SRV assert when called from misconfigured bridge auth.George Kadianakis
2017-02-02Merge remote-tracking branch 'public/bug21356_029'Nick Mathewson
2017-01-31Call monotime_init() earlier.Nick Mathewson
We need to call it before nt_service_parse_options(), since nt_service_parse_options() can call back into nt_service_main(), which calls do_main_loop(). Fixes bug 21356; bugfix on 0.2.9.1-alpha.
2017-01-08comment fixupsChelsea H. Komlo
2016-12-16Merge branch 'prop271_030_v1_squashed'Nick Mathewson
2016-12-16Have multiple guard contexts we can switch between.Nick Mathewson
Currently, this code doesn't actually have the contexts behave differently, (except for the legacy context), but it does switch back and forth between them nicely.
2016-12-16Expire circuits that have been WAITING_FOR_BETTER_GUARD too longNick Mathewson
(This is required by 3.9 in prop271, but is better done as a separate function IMO)
2016-12-16Rebuild the guard lists as appropriate on torrc change.Nick Mathewson
(Also, prepare to tie guard changes into the mark-all-old-circuits logic.)
2016-12-14Merge branch 'dgoulet_ticket19043_030_03_squashed'Nick Mathewson
2016-12-14prop224 prepwork: Use of HS circuitmap in existing HS code.George Kadianakis
The new HS circuitmap API replaces old public functions as follows: circuit_clear_rend_token -> hs_circuitmap_remove_circuit circuit_get_rendezvous -> hs_circuitmap_get_rend_circ circuit_get_intro_point -> hs_circuitmap_get_intro_circ_v2 circuit_set_rendezvous_cookie -> hs_circuitmap_register_rend_circ circuit_set_intro_point_digest -> hs_circuitmap_register_intro_circ_v2 This commit also removes the old rendinfo code that is now unused. It also fixes the broken rendinfo unittests.
2016-12-08Rename connection_or_remove_from_identity_mapNick Mathewson
2016-12-08Migrate main data loop for set_bad_connections to use channel structuresNick Mathewson
This was the last user of our or_connections-by-ID map. It also had a tendency to be O(N) in cases that only had to be O(1).
2016-11-30Use the new guard notification/selection APIs throughout TorNick Mathewson
This patch doesn't cover every case; omitted cases are marked with "XXXX prop271", as usual. It leaves both the old interface and the new interface for guard status notification, since they don't actually work in the same way: the new API wants to be told when a circuit has failed or succeeded, whereas the old API wants to know when a channel has failed or succeeded. I ran into some trouble with directory guard stuff, since when we pick the directory guard, we don't actually have a circuit to associate it with. I solved that by allowing guard states to be associated with directory connections, not just circuits.
2016-11-30Split bridge functions into a new module.Nick Mathewson
This patch is just: * Code movement * Adding headers here and there as needed * Adding a bridges_free_all() with a call to it. It breaks compilation, since the bridge code needed to make exactly 2 calls into entrynodes.c internals. I'll fix those in the next commit.
2016-11-04Merge branch 'ticket17238_029_02-resquash'Nick Mathewson
Conflicts: src/or/rendclient.c src/or/rendcommon.c src/or/routerparse.c src/test/test_dir.c src/trunnel/ed25519_cert.h
2016-11-04prop224: Add a cache free all functionDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-11-04prop224: Directory cache supportDavid Goulet
This implements the proposal 224 directory descriptor cache store and lookup functionalities. Furthermore, it merges the OOM call for the HSDir cache with current protocol v2 and the new upcoming v3. Add hs_cache.{c|h} with store/lookup API. Closes #18572 Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-11-03Merge branch 'maint-0.2.9'Nick Mathewson
2016-11-03Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2016-11-01Always call connection_ap_attach_pending() once a second.Nick Mathewson
Fixes bug 19969; bugfix on b1d56fc58. We can fix this some more in later Tors, but for now, this is probably the simplest fix possible. This is a belt-and-suspenders fix, where the earlier fix ("Ask event_base_loop to finish when we add a pending stream") aims to respond to new streams as soon as they arrive, and this one aims to make sure that we definitely respond to all of the streams.
2016-11-01refactor out the tor_event_base_loopexit() callRoger Dingledine
no actual changes
2016-10-27Document main.c a lot betterNick Mathewson
2016-09-26Merge branch 'protover_v2_squashed'Nick Mathewson
2016-09-26checkpoint basic protover backendNick Mathewson
2016-09-13Remove a duplicate non-anonymous warning log messageteor
We log this message every time we validate tor's options. There's no need to log a duplicate in main() as well. (It is impossible to run main() without validating our options.)
2016-09-13Refactor crypto init to use existing options variableteor (Tim Wilson-Brown)
2016-09-13Implement Prop #260: Single Onion Servicesteor (Tim Wilson-Brown)
Add experimental OnionServiceSingleHopMode and OnionServiceNonAnonymousMode options. When both are set to 1, every hidden service on a tor instance becomes a non-anonymous Single Onion Service. Single Onions make one-hop (direct) connections to their introduction and renzedvous points. One-hop circuits make Single Onion servers easily locatable, but clients remain location-anonymous. This is compatible with the existing hidden service implementation, and works on the current tor network without any changes to older relays or clients. Implements proposal #260, completes ticket #17178. Patch by teor & asn. squash! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Implement Prop #260: Single Onion Services Redesign single onion service poisoning. When in OnionServiceSingleHopMode, each hidden service key is poisoned (marked as non-anonymous) on creation by creating a poison file in the hidden service directory. Existing keys are considered non-anonymous if this file exists, and anonymous if it does not. Tor refuses to launch in OnionServiceSingleHopMode if any existing keys are anonymous. Similarly, it refuses to launch in anonymous client mode if any existing keys are non-anonymous. Rewrite the unit tests to match and be more comprehensive. Adds a bonus unit test for rend_service_load_all_keys().
2016-08-25Merge remote-tracking branch 'andrea/ticket18640_v3'Nick Mathewson
2016-08-20Consider the case that a connection doesn't have a valid socket during OOSAndrea Shepard
2016-08-20Add connection_is_moribund() inlineAndrea Shepard
2016-08-20Use SMARTLIST_FOREACH in connection_count_moribund() per code reviewAndrea Shepard
2016-08-20Unit test for pick_oos_victims()Andrea Shepard
2016-08-20Unit test for connection_handle_oos()Andrea Shepard
2016-08-20Implement connection_count_moribund() for OOS handlerAndrea Shepard
2016-08-16Fixes inconsistent version prefix in log messages.Daniel Pinto
Fixes #15381.
2016-08-12Merge remote-tracking branch 'public/Fix_19450'Nick Mathewson
2016-08-10Eliminate redundant hourly reset of descriptor download failuresAndrea Shepard
2016-08-02Search for remaining references to 'bufferevent'.Nick Mathewson
Remove or adjust as appropriate.
2016-08-02Bufferevent removal: remove HAS_BUFFEREVENT macros and usageNick Mathewson
This is another way that we had bufferevents-only code marked.
2016-08-02More bufferevent removal: bev_str is no longer needed in tor_initNick Mathewson
2016-07-19Be sure to call monotime_init() at startup.Nick Mathewson
2016-07-14Remove bufferevents dead codeU+039b
Signed-off-by: U+039b <*@0x39b.fr>
2016-07-08Merge remote-tracking branch 'sebastian/libevent2'Nick Mathewson
2016-07-05Merge remote-tracking branch 'teor/bug18456'Nick Mathewson
2016-07-05Merge branch 'maint-0.2.8'Nick Mathewson
2016-07-04Raise libevent dependency to 2.0.10-stable or newerSebastian Hahn
Only some very ancient distributions don't ship with Libevent 2 anymore, even the oldest supported Ubuntu LTS version has it. This allows us to get rid of a lot of compat code.
2016-07-03sandboxing: allow writing to stats/hidserv-statsPeter Palfrader
Our sandboxing code would not allow us to write to stats/hidserv-stats, causing tor to abort while trying to write stats. This was previously masked by bug#19556.
2016-07-03sandboxing: allow open() of stats dirPeter Palfrader
When sandboxing is enabled, we could not write any stats to disk. check_or_create_data_subdir("stats"), which prepares the private stats directory, calls check_private_dir(), which also opens and not just stats() the directory. Therefore, we need to also allow open() for the stats dir in our sandboxing setup.
2016-07-01Merge remote-tracking branch 'dgoulet/ticket16943_029_05-squashed'Nick Mathewson
Trivial Conflicts: src/or/or.h src/or/routerparse.c
2016-07-01prop250: Initialize the SR subsystem and us it!David Goulet
This commit makes it that tor now uses the shared random protocol by initializing the subsystem. Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>