summaryrefslogtreecommitdiff
path: root/src/or/main.c
AgeCommit message (Collapse)Author
2018-09-07Windows: Stop calling SetProcessDEPPolicy() on 64-bit Windowsteor
It is not supported, and always fails. Some compilers warn about the function pointer cast on 64-bit Windows. Fixes bug 27461; bugfix on 0.2.2.23-alpha.
2018-01-30dos: Initial code of Denial of Service mitigationDavid Goulet
This commit introduces the src/or/dos.{c|h} files that contains the code for the Denial of Service mitigation subsystem. It currently contains basic functions to initialize and free the subsystem. They are used at this commit. The torrc options and consensus parameters are defined at this commit and getters are implemented. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-19Define HeapEnableTerminationOnCorruption if the headers don't.Nick Mathewson
MSDN says that it's always going to be 1, and they're usually pretty accurate about that. Fixes a bug in 21953.
2017-05-11Enable some windows hardening featuresNick Mathewson
One (HeapEnableTerminationOnCorruption) is on-by-default since win8; the other (PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION) supposedly only affects ATL, which (we think) we don't use. Still, these are good hygiene. Closes ticket 21953.
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-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>
2016-07-01Avoid disclosing exit IP addresses in exit policies by defaultteor (Tim Wilson-Brown)
From 0.2.7.2-alpha onwards, Exits would reject all the IP addresses they knew about in their exit policy. But this may have disclosed addresses that were otherwise unlisted. Now, only advertised addresses are rejected by default by ExitPolicyRejectPrivate. All known addresses are only rejected when ExitPolicyRejectLocalInterfaces is explicitly set to 1.
2016-06-30Move unparseable descriptor dumps into subdirectory of DataDirAndrea Shepard
2016-06-30Add multiple descriptor dump support for dump_desc() in routerparse.c; fixes ↵Andrea Shepard
bug 18322
2016-06-21Merge branch 'maint-0.2.8'Nick Mathewson
2016-06-21Fix bug when disabling heartbeats.George Kadianakis
Callbacks can't return 0.
2016-06-11Merge branch 'bug19180_easy_squashed'Nick Mathewson
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-05-30Replace nearly all XXX0vv comments with smarter onesNick Mathewson
So, back long ago, XXX012 meant, "before Tor 0.1.2 is released, we had better revisit this comment and fix it!" But we have a huge pile of such comments accumulated for a large number of released versions! Not cool. So, here's what I tried to do: * 0.2.9 and 0.2.8 are retained, since those are not yet released. * XXX+ or XXX++ or XXX++++ or whatever means, "This one looks quite important!" * The others, after one-by-one examination, are downgraded to plain old XXX. Which doesn't mean they aren't a problem -- just that they cannot possibly be a release-blocking problem.
2016-05-19Merge branch 'maint-0.2.8'Nick Mathewson
2016-05-19Merge branch 'bug18809_028_squashed' into maint-0.2.8Nick Mathewson
2016-05-17Merge branch 'maint-0.2.8'Nick Mathewson
2016-05-16touchups and refactorings on bug 18616 branchRoger Dingledine
no behavior changes
2016-05-09close other consensus fetches when we get a consensusRoger Dingledine
not once per second, and only do it when a consensus arrives
2016-05-09fix typos/etc before i go nuts on #18809Roger Dingledine
2016-04-14Merge branch 'assert_nonfatal_squashed'Nick Mathewson