aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.h
AgeCommit message (Collapse)Author
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-15Split control_connection_t into its own header.Nick Mathewson
This one was actually fairly simple.
2018-05-09Give control.c responsibility for its own once-a-second eventsNick Mathewson
Now it has a function that can tell the rest of Tor whether any once-a-second controller item should fire, and a function to fire all the once-a-second events.
2018-05-01Give queued_events_flush_all() responsibility for flushing log cbsNick Mathewson
This requires that when a log cb happens, the event for flushing queued events is scheduled, so we also add the necessary machinery to have that happen. Note that this doesn't actually help with logs from outside the main thread, but those were already suppressed: see #25987 for a ticket tracking that issue.
2018-04-16Add GETINFO current-time/{local,utc} command to ControlPortNeel Chauhan
2018-04-10Remove TestingEnableTbEmptyEventNick Mathewson
This option was used for shadow testing previously, but is no longer used for anything. It interferes with refactoring our token buckets.
2017-12-05control: Don't use void pointer for ADD_ONION secret keyDavid Goulet
Make this a bit more safe with at least type checking of the pointers depending on the version. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05hs-v3: Implement HS_DESC UPLOAD eventDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05hs-v3: Implement HS_DESC RECEIVED eventDavid Goulet
Adds a v3 specific function to handle a received event. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05hs-v3: Implement HS_DESC FAILED eventDavid Goulet
A new v3 specific function has been added named control_event_hsv3_descriptor_failed(). The HS v3 subsystem now uses it. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05hs-v3: Implement HS_DESC REQUESTED eventDavid Goulet
This changes the control_event_hs_descriptor_requested() call to add the hsdir index optional value. v2 passes NULL all the time. This commit creates hs_control.{c|h} that contains wrappers for the HS subsystem to interact with the control port subsystem. The descriptor REQUESTED event is implemented following proposal 284 extension for v3. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05control: Rename two HS v2 specific functionsDavid Goulet
Make control_event_hs_descriptor_received() and control_event_hs_descriptor_failed() v2 specific because they take a rend_data_t object and v3 will need to pass a different object. No behavior change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05control: Refactor control_event_hs_descriptor_receive_endDavid Goulet
First, rename and make that function static because it is internal to control.c and called by two HS_DESC events. Second, make it take more basic parameters and thus not a rend_data_t object so we can still use the function for v3 HS that doesn't use that object. Third, move the descriptor ID lookup to the two specific events (yes little code duplication there) because they get a rend_data_t object which won't be the case for v3. Finally, through this refactoring, change the pointer check to BUG() and change some parameter names to reflect what they really are. No behavior change at this commit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05control: Refactor HS_DESC events functions to not be v2 specificDavid Goulet
This is a naming refactor mostly _except_ for a the events' function that take a rend_data_t which will require much more refactoring. No behavior change at this commit, cleanup and renaming stuff to not be only v2 specific. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-20control: Support HSv3 interface for ADD_ONIONDavid Goulet
At this commit, the key handling and generation is supported for a v3 service (ED25519-V3). However, the service creation is not yet implemented. This only adds the interface and code to deal with the new ED25519-V3 key type. Tests have been updated for RSA key type but nothing yet for ED25519-v3. Part of #20699 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-10-18Add __OwningControllerFD to allow controllers without controlportsNick Mathewson
This feature should help programs that want to launch and manage a Tor process, as well as programs that want to launch and manage a Tor instance in a separate thread. Right now, they have to open a controlport, and then connect to it, with attendant authentication issues. This feature allows them to just start with an authenticated connection. Bug 23900.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-14Refactor control_event_bootstrap_problemTaylor Yu
Change the contract of control_event_bootstrap_problem() to be more general and to take a connection_t. New function control_event_bootstrap_prob_or() has the specific or_connection_t funcionality previously used.
2017-08-24Remove the AUTHDIR_NEWDESCS feature: nobody is using it any moreNick Mathewson
If somebody asks for it, log a warning. Closes ticket 22377.
2017-04-24Add regression test for #22304Taylor Yu
2017-03-15Run the copyright update script.Nick Mathewson
2017-01-28Ticket #21329: GETINFO onions/current returns empty listmeejah
If there are no ephemeral or detached onion services, then "GETINFO onions/current" or "GETINFO onions/detached" should return an empty list instead of an error
2016-06-29Expose GETINFO download status statics for test suite and make things mockableAndrea Shepard
2016-05-09Merge branch 'feature15588_squashed'Nick Mathewson
2016-05-09Add client auth for ADD_ONION servicesJohn Brooks
2016-02-27Update the copyright year.Nick Mathewson
2016-02-17Add onion address to the HS_DESC UPLOADED eventDavid Goulet
Fixes #16023 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-09-08Add replica number to HS_DESC CREATED eventDonncha O'Cearbhaill
Including the replica number in the HS_DESC CREATED event provides more context to a control port client. The replica allows clients to more easily identify each replicated descriptor from the independantly output control events.
2015-08-25Add a HS_DESC CREATED control eventDonncha O'Cearbhaill
The HS_DESC CREATED event should be emmited when a new service descriptor is generated for a local rendevous service. This event is documented in the control spec. This commit resolves ticket #16291.
2015-08-20Rename EVENT_SIGNAL -> EVENT_GOT_SIGNALNick Mathewson
This avoids a conflict with a macro decl from libevent 1.x. Fixes bug 16867; bug not in any released Tor.
2015-08-18Refactor initialization logic for control-event-queueNick Mathewson
This puts the init logic in a separate function, which we will need once we have locking.
2015-08-18Remove obsolete event_format_tNick Mathewson
We used to use this when we had some controllers that would accept long names and some that wouldn't. But it's been obsolete for a while, and it's time to strip it out of the code.
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-05-18Merge remote-tracking branch 'andrea/ticket15358_squashed_2'Nick Mathewson
2015-05-17Implement EVENT_NETWORK_LIVENESSAndrea Shepard
2015-05-14Add missing descriptor ID to HS_DESC control eventDavid Goulet
For FAILED and RECEIVED action of the HS_DESC event, we now sends back the descriptor ID at the end like specified in the control-spec section 4.1.25. Fixes #15881 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-05-04Add "+HSPOST" and related "HS_DESC" event flags to the controller.Donncha O'Cearbhaill
"+HSPOST" and the related event changes allow the uploading of HS descriptors via the control port, and more comprehensive event monitoring of HS descriptor upload status.
2015-04-28Add "ADD_ONION"/"DEL_ONION" and "GETINFO onions/*" to the controller.Yawning Angel
These commands allow for the creation and management of ephemeral Onion ("Hidden") services that are either bound to the lifetime of the originating control connection, or optionally the lifetime of the tor instance. Implements #6411.
2015-04-21Control: unbolt rend_data from HS desc eventDavid Goulet
The HS_DESC event was using rend_data_t from the dir connection to reply the onion address and authentication type. With the new HSFETCH command, it's now possible to fetch a descriptor only using the descriptor id thus resulting in not having an onion address in any HS_DESC event. This patch removes rend_query from the hs desc control functions and replace it by an onion address string and an auth type. On a successful fetch, the service id is taken from the fetched descriptor. For that, an extra parameter is added to "store as a client" function that contains the cache entry stored. This will make the control event functions scale more easily over time if other values not present in rend_data_t are needed since the rend_data from the dir connection might not contained everything we need. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Control: add HS_DESC_CONTENT eventDavid Goulet
As defined in section 4.1.26 in the control-spec.txt, this new event replies the content of a successfully fetched HS descriptor. This also adds a unit test for the controller event. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-03-22Compile-time check that control_event_t.event_mask is big enoughteor
Add a compile-time check that the number of events doesn't exceed the capacity of control_event_t.event_mask.
2015-03-22Add unit tests for control_event_is_interesting()teor
Part of ticket 15431, checks for bugs similar to 13085.
2015-02-23Avoid logging natural-language reports that are redundant with bootstrappingNick Mathewson
2015-01-07GETINFO bw-event-cache to get information on recent BW eventsNick Mathewson
Closes 14128; useful to regain functionality lost because of 13988.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-16Adding REASON field to HS_DESC FAILED controller event.rl1987
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-08Expand the event_mask field in controller conns to 64 bitsNick Mathewson
Back in 078d6bcd, we added an event number 0x20, but we didn't make the event_mask field big enough to compensate. Patch by "teor". Fixes 13085; bugfix on 0.2.5.1-alpha.
2014-05-22sandbox: allow access to cookie files, approved-routersNick Mathewson
fixes part of 12064
2014-03-27Report only the first bootstrap failure from an orconnNick Mathewson
Otherwise, when we report "identity mismatch", we then later report DONE when the connection gets closed. Fixes bug 10431; bugfix on 0.2.1.1-alpha.