summaryrefslogtreecommitdiff
path: root/src/or/main.c
AgeCommit message (Collapse)Author
2015-11-25Merge branch 'bug17686_v2_027'Nick Mathewson
2015-11-25Make crypto_seed_rng() and crypto_rand() less scary.Nick Mathewson
These functions must really never fail; so have crypto_rand() assert that it's working okay, and have crypto_seed_rng() demand that callers check its return value. Also have crypto_seed_rng() check RAND_status() before returning.
2015-11-19Merge remote-tracking branch 'public/decouple_conn_attach_2'Nick Mathewson
2015-11-18Fix a startup time assert caused by periodic events not being initialized.Yawning Angel
Loading a on disk bridge descriptor causes a directory download to be scheduled, which asserts due to the periodic events not being initialized yet. Fixes bug #17635, not in any released version of tor.
2015-11-17windows already has a CALLBACK macro...Nick Mathewson
2015-11-17Fix a server-side crash on DNS initNick Mathewson
2015-11-17Some unit tests now require that periodic events be initialized.Nick Mathewson
2015-11-17Free pending_entry_connections on shutdown.Nick Mathewson
2015-11-17Be more conservative in scanning the list of pending streamsNick Mathewson
Now we only re-scan the list in the cases we did before: when we have a new circuit that we should try attaching to, or when we have added a new stream that we haven't tried to attach yet. This is part of 17590.
2015-11-17Decouple ..attach_circuit() from most of its callers.Nick Mathewson
Long ago we used to call connection_ap_handshake_attach_circuit() only in a few places, since connection_ap_attach_pending() attaches all the pending connections, and does so regularly. But this turned out to have a performance problem: it would introduce a delay to launching or connecting a stream. We couldn't just call connection_ap_attach_pending() every time we make a new connection, since it walks the whole connection list. So we started calling connection_ap_attach_pending all over, instead! But that's kind of ugly and messes up our callgraph. So instead, we now have connection_ap_attach_pending() use a list only of the pending connections, so we can call it much more frequently. We have a separate function to scan the whole connection array to see if we missed adding anything, and log a warning if so. Closes ticket #17590
2015-11-17Whoops; in this context the EV_TIMEOUT flag is neededNick Mathewson
2015-11-17Changes to 3199 branch based on feedback from specialNick Mathewson
2015-11-16Add documentation for periodic event apiNick Mathewson
2015-11-13fix whitespace; remove dead codeNick Mathewson
2015-11-13Fold all of the run-every-second stuff back into run_scheduled_events()Nick Mathewson
2015-11-13Turn all of run_scheduled_events() into a bunch of periodic eventsNick Mathewson
This patch is designed to look good when you see it through 'diff -b': it mostly leaves entries in the same order, and leaves the code unmodified.
2015-11-13Connect periodic events to mainNick Mathewson
2015-10-15Merge remote-tracking branch 'origin/maint-0.2.7'Nick Mathewson
2015-10-15Merge remote-tracking branch 'origin/maint-0.2.6' into maint-0.2.7Nick Mathewson
2015-10-15Add hidserv-stats filname to our sandbox filterDavid Goulet
Fixes #17354 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-10-02Merge remote-tracking branch 'donncha/feature14846_4'Nick Mathewson
2015-09-10Merge remote-tracking branch 'public/ed25519_hup_v2'Nick Mathewson
2015-09-08Clean old descriptors from the service-side rend cacheDonncha O'Cearbhaill
Parameterize the rend_cache_clean() function to allow it clean old rendezvous descriptors from the service-side cache as well as the client descriptor cache.
2015-09-02Let recent relays run with the chutney sandbox.Nick Mathewson
Fixes 16965
2015-09-02Let bridge authorities run under the sandboxNick Mathewson
(found thanks to teor's chutney haxx)
2015-08-19Reload Ed25519 keys on sighup.Nick Mathewson
Closes ticket 16790.
2015-08-19Merge branch 'ed25519_keygen_squashed'Nick Mathewson
2015-08-19Don' call failure to get keys a bug; it's possible now.Nick Mathewson
2015-08-19Resolve failing test_keygen tests.Nick Mathewson
2015-08-18Merge branch 'decouple_controller_events_squashed'Nick Mathewson
2015-08-18Refactor our logic for sending events to controllersNick Mathewson
Previously we'd put these strings right on the controllers' outbufs. But this could cause some trouble, for these reasons: 1) Calling the network stack directly here would make a huge portion of our networking code (from which so much of the rest of Tor is reachable) reachable from everything that potentially generated controller events. 2) Since _some_ events (EVENT_ERR for instance) would cause us to call connection_flush(), every control_event_* function would appear to be able to reach even _more_ of the network stack in our cllgraph. 3) Every time we generated an event, we'd have to walk the whole connection list, which isn't exactly fast. This is an attempt to break down the "blob" described in http://archives.seul.org/tor/dev/Mar-2015/msg00197.html -- the set of functions from which nearly all the other functions in Tor are reachable. Closes ticket 16695.
2015-08-17Merge remote-tracking branches 'public/decouple_lost_owner' and ↵Nick Mathewson
'public/decouple_signals'
2015-08-17Merge remote-tracking branch 'public/decouple_retry_directory'Nick Mathewson
2015-08-14Merge remote-tracking branch 'public/decouple_init_keys'Nick Mathewson
2015-08-13Decouple routerlist_retry_directory_downloads() from the blobNick Mathewson
Instead of having it call update_all_descriptor_downloads and update_networkstatus_downloads directly, we can have it cause them to get rescheduled and called from run_scheduled_events. Closes ticket 16789.
2015-08-12Fix a windows compilation errorNick Mathewson
2015-08-12Try to decouple process_signal() from anything not event-drivenNick Mathewson
This needs debugging; it currently breaks the stem tests.
2015-08-12Decouple the backend for directory_all_unreachable to simplify our CFGNick Mathewson
See ticket 16762.
2015-08-11Split the client-only parts of init_keys() into a separate functionNick Mathewson
This should simplify the callgraph a little more.
2015-08-11Expire after 5 minutes rend cache failure entriesDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-07-21Remove casting of void pointers when handling signals.cypherpunks
2015-07-14Change the name for the keypinning file; delete the old one if foundNick Mathewson
This is a brute-force fix for #16580, wherein #16530 caused some routers to do bad things with the old keypinning journal.
2015-06-17Merge branch '13642_offline_master_v2_squashed'Nick Mathewson
2015-06-17Support encrypted offline master keys with a new --keygen flagNick Mathewson
When --keygen is provided, we prompt for a passphrase when we make a new master key; if it is nonempty, we store the secret key in a new crypto_pwbox. Also, if --keygen is provided and there *is* an encrypted master key, we load it and prompt for a passphrase unconditionally. We make a new signing key unconditionally when --keygen is provided. We never overwrite a master key.
2015-06-17Merge remote-tracking branch 'origin/maint-0.2.6'Nick Mathewson
2015-06-17Merge remote-tracking branch 'origin/maint-0.2.5' into maint-0.2.6Nick Mathewson
2015-06-17Correctly handle failed crypto_early_initteor
If crypto_early_init fails, a typo in a return value from tor_init means that tor_main continues running, rather than returning an error value. Fixes bug 16360; bugfix on d3fb846d8c98 in 0.2.5.2-alpha, introduced when implementing #4900. Patch by "teor".
2015-06-02Merge remote-tracking branch 'origin/maint-0.2.6'Nick Mathewson
2015-06-02Fix sandboxing to work when running as a relayPeter Palfrader
This includes correctly allowing renaming secret_id_key and allowing the eventfd2 and futex syscalls. Fixes bug 16244; bugfix on 0.2.6.1-alpha.
2015-05-28Merge branch '12498_ed25519_keys_v6'Nick Mathewson
Fixed numerous conflicts, and ported code to use new base64 api.