summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-01-11Add some more type checking.Taylor R Campbell
NOTE: This commit breaks the build, because there was a mistake in an earlier change of exactly the sort that this is meant to detect! I'm leaving it broken for illustration.
2019-01-11Use the distribution abstraction as an abstraction.Taylor R Campbell
2019-01-11Move ceil call back into the geometric sampler.Taylor R Campbell
Test exactly what the geometric sampler returns, because that's what the downstream callers of it are going to use. While here, also assert that the geometric sampler returns a positive integer. (Our geometric distribution is the one suported on {1, 2, 3, ...} that returns the number of trials before the first success, not the one supported on {0, 1, 2, ...} that returns the number of failures before the first success.)
2019-01-11Fix more type redefinition errors.Taylor R Campbell
In file included from ./src/core/or/or_circuit_st.h:12:0, from src/core/or/circuitlist.c:112: ./src/core/or/circuit_st.h:15:39: error: redefinition of typedef ‘circpad_machine_spec_t’ ./src/core/or/circuitpadding.h:572:3: note: previous declaration of ‘circpad_machine_spec_t’ was here ./src/core/or/circuit_st.h:16:40: error: redefinition of typedef ‘circpad_machine_state_t’ ./src/core/or/circuitpadding.h:517:3: note: previous declaration of ‘circpad_machine_state_t’ was here
2019-01-11Fix type redefinition errors.Taylor R Campbell
In file included from src/core/or/connection_edge.c:70:0: ./src/core/or/circuitpadding.h:16:26: error: redefinition of typedef ‘circuit_t’ ./src/core/or/or.h:930:26: note: previous declaration of ‘circuit_t’ was here ./src/core/or/circuitpadding.h:17:33: error: redefinition of typedef ‘origin_circuit_t’ ./src/core/or/or.h:931:33: note: previous declaration of ‘origin_circuit_t’ was here ./src/core/or/circuitpadding.h:18:23: error: redefinition of typedef ‘cell_t’ ./src/core/or/or.h:628:23: note: previous declaration of ‘cell_t’ was here typedef doesn't work for forward declarations, but plain struct without a typedef wrapper does (and unlike the _t type aliases makes it clearer for everyone whether you're talking about the struct or the pointer).
2019-01-10Misc trivial improvements around circpadding code.George Kadianakis
2019-01-10Unittest for tor_isinf().George Kadianakis
2019-01-10Rename crypto_rand_uint32() -> crypto_rand_u32()George Kadianakis
See https://github.com/torproject/tor/pull/624#discussion_r246453777
2019-01-10Rename circpad_machineinfo_t -> circpad_machine_state_tGeorge Kadianakis
2019-01-10Rename circpad_machine_t -> circpad_machine_spec_tGeorge Kadianakis
2019-01-10Add top-level file documentation for circuitpadding.cGeorge Kadianakis
2019-01-02Disable current padding machines.George Kadianakis
Co-authored-by: Mike Perry <mikeperry-git@torproject.org>
2019-01-02Concentrate all TOR_USEC_PER_SEC definitions in a single header file.George Kadianakis
Co-authored-by: Mike Perry <mikeperry-git@torproject.org>
2019-01-02Use the new probability distribution code in WTF-PAD.George Kadianakis
Co-authored-by: Mike Perry <mikeperry-git@torproject.org> Co-authored-by: Taylor R Campbell <campbell+tor@mumble.net>
2019-01-02Implement and test probability distributions used by WTF-PAD.George Kadianakis
This project introduces the prob_distr.c subsystem which implements all the probability distributions that WTF-PAD needs. It also adds unittests for all of them. Code and tests courtesy of Riastradh. Co-authored-by: Taylor R Campbell <campbell+tor@mumble.net> Co-authored-by: Mike Perry <mikeperry-git@torproject.org>
2019-01-02Config option to specify specific MiddleNodes.Mike Perry
Hope is this will make it easier to test on the live tor network. Does not need to be merged if we don't want to, but will come in handy for researchers. Co-authored-by: George Kadianakis <desnacked@riseup.net>
2019-01-02Circuit padding tests.George Kadianakis
Co-authored-by: George Kadianakis <desnacked@riseup.net>
2019-01-02Add relay crypto mock points for tests.Mike Perry
Co-authored-by: George Kadianakis <desnacked@riseup.net>
2019-01-02Circuit padding implementation.Mike Perry
This implements all of the event handling, state machines, and padding decisions for circuit padding. I recommend reviewing this after you look at the call-in points into it from the rest of Tor. Co-authored-by: George Kadianakis <desnacked@riseup.net>
2019-01-02Circuit padding cell event callbacks.Mike Perry
These callbacks allow the padding state machines to react to various types of sent and received relay cells. Co-authored-by: George Kadianakis <desnacked@riseup.net>
2019-01-02Circuit padding machine creation events.Mike Perry
These event callbacks allow circuit padding to decide when to attempt to launch and negotiate new padding machines, and when to tear old ones down. Co-authored-by: George Kadianakis <desnacked@riseup.net>
2019-01-02Add padding negotiation trunnel output.Mike Perry
Co-authored-by: George Kadianakis <desnacked@riseup.net>
2019-01-02Circuit padding ProtoVer plumbing.Mike Perry
This helps us to determine if a middle node can pad to us or not. Co-authored-by: George Kadianakis <desnacked@riseup.net>
2019-01-02Initialize circuit padding machines and global state.Mike Perry
Co-authored-by: George Kadianakis <desnacked@riseup.net>
2019-01-02Hook up circuit padding to circuit_t.Mike Perry
Co-authored-by: George Kadianakis <desnacked@riseup.net>
2019-01-02Circuit padding header.Mike Perry
This is a good code review start point, to get an overview of the interfaces and types used in circuit padding. Co-authored-by: George Kadianakis <desnacked@riseup.net>
2019-01-02Provide a smartlist reverse-order traversal.Mike Perry
We need this for padding negotiation so that we can have later machine revisions supercede earlier ones. Co-authored-by: George Kadianakis <desnacked@riseup.net>
2018-12-21Merge branch 'maint-0.3.5'Nick Mathewson
2018-12-21Merge branch 'maint-0.3.4' into maint-0.3.5Nick Mathewson
2018-12-21Merge branch 'orconn-tracker_squashed'Nick Mathewson
2018-12-21Add tests for bootstrap trackerTaylor Yu
Part of ticket 27617.
2018-12-21The big bootstrap phase redefinitionTaylor Yu
Redefine the set of bootstrap phases to allow display of finer-grained progress in the early connection stages of connecting to a relay. This includes adding intermediate phases for proxy and PT connections. Also add a separate new phase to indicate obtaining enough directory info to build circuits so we can report that independently of actually initiating an ORCONN to build the first application circuit. Previously, we would claim to be connecting to a relay when we had merely finished obtaining directory info. Part of ticket 27167.
2018-12-21Hook up control_event_bootstrap() to btrack_orconnTaylor Yu
Replace a few invocations of control_event_bootstrap() with calls from the bootstrap tracker subsystem. This mostly leaves behavior unchanged. The actual behavior changes come in the next commit. Part of ticket 27167.
2018-12-21Add a comment about bto_update_best.Taylor Yu
2018-12-21Fix priority on process subsystem level: it uses "net"Nick Mathewson
2018-12-21Merge branch 'ticket28847'Nick Mathewson
2018-12-21Don't initialize the process module manually in tests.Alexander Færøy
It's not longer needed for us to initialize the process module in tests. See: https://bugs.torproject.org/28847
2018-12-21Fix typo in time_sys.h.Alexander Færøy
2018-12-21Use the subsystem list to initialize and shutdown process module.Alexander Færøy
This patch makes the process module use the subsystem list for initializing and shutting down. See: https://bugs.torproject.org/28847
2018-12-21mainloop: Reactivate the linked connection event with a non empty listDavid Goulet
Linked connections aren't woken up by libevent due to I/O but rather artificially so we can, by chunks, empty the spooled object(s). Commit 5719dfb48f87a54aeb5982ff03345303bc058ebb (in 0.3.4.1-alpha) made it that the schedule_active_linked_connections_event would be only called once at startup but this is wrong because then we would never go through again the active linked connections. Fortunately, everytime a new linked connection is created, the event is activated and thus we would go through the active list again. On a busy relay, this issue is mitigated by that but on a slower relays or bridge, a connection could get stuck for a while until a new directory information request would show up. Fixes #28717, #28912
2018-12-20Add bootstrap tracker subsystemTaylor Yu
Add a tracker for bootstrap progress, tracking events related to origin circuit and ORCONN states. This uses the ocirc_event and orconn_event publish-subscribe subsystems. Part of ticket 27167.
2018-12-20Add LD_BTRACK log domain for bootstrap trackerTaylor Yu
Part of ticket 27167.
2018-12-20Add origin circuit event pubsub systemTaylor Yu
Add a publish-subscribe subsystem to publish messages about changes to origin circuits. Functions in circuitbuild.c and circuitlist.c publish messages to this subsystem. Move circuit event constants out of control.h so that subscribers don't have to include all of control.h to take actions based on messages they receive. Part of ticket 27167.
2018-12-20Add ORCONN event pubsub systemTaylor Yu
Add a publish-subscribe subsystem to publish messages about changes to OR connections. connection_or_change_state() in connection_or.c and control_event_or_conn_event() in control.c publish messages to this subsystem via helper functions. Move state constants from connection_or.h to orconn_state.h so that subscribers don't have to include all of connection_or.h to take actions based on changes in OR connection state. Move event constants from control.h for similar reasons. Part of ticket 27167.
2018-12-20Remove unused old_state var in connection_or.cTaylor Yu
connection_or_change_state() saved an old_state to pass to channel_tls_handle_state_change_on_orconn(), which promptly cast it to void. Remove this unused variable and parameter.
2018-12-20Merge remote-tracking branch 'tor-github/pr/609'Nick Mathewson
2018-12-20Escape the PT K/V data before sending it to the logger.Alexander Færøy
See: https://bugs.torproject.org/28846
2018-12-20Merge remote-tracking branch 'tor-github/pr/608'Nick Mathewson
2018-12-20Remove Process initializer/shutdown function from main.c.Alexander Færøy
See: https://bugs.torproject.org/28847
2018-12-20Forward declare smartlist_t in process.hAlexander Færøy
This allows other libraries to include process.h without including the smartlist_t headers first. See: https://bugs.torproject.org/28847