aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
AgeCommit message (Collapse)Author
2017-05-03control: Fix NULL pointer access in HS desc eventDavid Goulet
This was introduced 90562fc23a7ce61f3660b507d9991a27af2eae37 adding a code path where we pass a NULL pointer for the HSDir fingerprint to the control event subsystem. The HS desc failed function wasn't handling properly that pointer for a NULL value. Two unit tests are also added in this commit to make sure we handle properly the case of a NULL hsdir fingerprint and a NULL content as well. Fixes #22138 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-01control: Fix comment of control_event_hs_descriptor_contentDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-01hs: Trigger control event when client can't pick HSDirDavid Goulet
Inform the control port with an HS_DESC failed event when the client is unable to pick an HSDir. It's followed by an empty HS_DESC_CONTENT event. In order to achieve that, some control port code had to be modified to accept a NULL HSDir identity digest. This commit also adds a trigger of a failed event when we are unable to base64-decode the descriptor cookie. Fixes #22042 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-24Add regression test for #22304Taylor Yu
2017-04-24Merge branch 'maint-0.3.0'Nick Mathewson
2017-04-24Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-04-24control: Wrong check on base16_decode return valueDavid Goulet
The GETINFO extra-info/digest/<digest> broke in commit 568dc27a19 that refactored the base16_decode() API to return the decoded length. Unfortunately, that if() condition should have checked for the correct length instead of an error which broke the command in tor-0.2.9.1-alpha. Fixes #22034 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-03-15Run the copyright update script.Nick Mathewson
2017-03-10Mark GETINFO network-status as deprecated with a warningNick Mathewson
control-spec has marked it deprecated for a long time. Closes ticket 21703.
2017-02-16Merge remote-tracking branch 'meejah/ticket-21329-onions-current'Nick Mathewson
2017-02-03Prevention: never die from extend_info_from_node() failure.Nick Mathewson
Bug 21242 occurred because we asserted that extend_info_from_node() had succeeded...even though we already had the code to handle such a failure. We fixed that in 93b39c51629ed0ded2bf807cb6. But there were four other cases in our code where we called extend_info_from_node() and either tor_assert()ed that it returned non-NULL, or [in one case] silently assumed that it returned non-NULL. That's not such a great idea. This patch makes those cases check for a bug of this kind instead. Fixes bug 21372; bugfix on 0.2.3.1-alpha when extend_info_from_node() was introduced.
2017-01-30GUARD_WAIT is now specified tooNick 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
2017-01-24Repair the (deprecated, ugly) DROPGUARDS controller function.Nick Mathewson
This actually is much easier to write now that guard_selection_t is first-class.
2017-01-11repair whitespace.Nick Mathewson
2017-01-09control: Add GETINFO command for the shared random valuesDavid Goulet
Add the "sr/current" and "sr/previous" keys for the GETINFO command in order to get through the control port the shared random values from the consensus. Closes #19925 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-12-16Merge branch 'prop271_030_v1_squashed'Nick Mathewson
2016-12-16Wrap all of the legacy guard code, and its users, in #ifdefsNick Mathewson
This will make it easier to see what we remove down the line.
2016-12-16Note a couple of XXX-prop271s as spec deviations.Nick Mathewson
2016-11-30Add a new GUARD_WAIT state for circuitsNick Mathewson
This state corresponds to the WAITING_FOR_BETTER_GUARD state; it's for circuits that are 100% constructed, but which we won't use until we are sure that we wouldn't use circuits with a better guard.
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-30Stop discarding consensus flavors and descriptors we wanted to fetchteor
Instead, fetch and store consensus flavors and descriptors we wanted to fetch. And serve them if we are a directory cache (or authority).
2016-11-21Merge branch 'maint-0.2.9'Nick Mathewson
2016-11-16refactor router_pick_published_address to have another argRoger Dingledine
no change in behavior except fewer log entries in the case where we use a cached result.
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-04hs: Refactor rend_data_t for multi version supportDavid Goulet
In order to implement proposal 224, we need the data structure rend_data_t to be able to accomodate versionning that is the current version of hidden service (2) and the new version (3) and future version. For that, we implement a series of accessors and a downcast function to get the v2 data structure. rend_data_t becomes a top level generic place holder. The entire rend_data_t API has been moved to hs_common.{c|h} in order to seperate code that is shared from between HS versions and unshared code (in rendcommon.c). Closes #19024 Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-10-27Automated change to use smartlist_add_strdupovercaffeinated
Use the following coccinelle script to change uses of smartlist_add(sl, tor_strdup(str)) to smartlist_add_strdup(sl, string) (coccinelle script from nickm via bug 20048): @@ expression a; expression b; @@ - smartlist_add + smartlist_add_strdup (a, - tor_strdup( b - ) )
2016-10-19Say 'Invalid argument' instead of unclear 'Unrecognized'Ivan Markin
2016-10-17Write a bunch of module documentation.Nick Mathewson
This commit adds or improves the module-level documenation for: buffers.c circuitstats.c command.c connection_edge.c control.c cpuworker.c crypto_curve25519.c crypto_curve25519.h crypto_ed25519.c crypto_format.c dircollate.c dirserv.c dns.c dns_structs.h fp_pair.c geoip.c hibernate.c keypin.c ntmain.c onion.c onion_fast.c onion_ntor.c onion_tap.c periodic.c protover.c protover.h reasons.c rephist.c replaycache.c routerlist.c routerparse.c routerset.c statefile.c status.c tor_main.c workqueue.c In particular, I've tried to explain (for each documented module) what each module does, what's in it, what the big idea is, why it belongs in Tor, and who calls it. In a few cases, I've added TODO notes about refactoring opportunities. I've also renamed an argument, and fixed a few DOCDOC comments.
2016-09-13Refactor Single Onion code to improve consistencyteor
* Check consistency between the two single onion torrc options * Use the more relevant option each time we check for single onion mode * Clarify log messages * Clarify comments * Otherwise, no behaviour change
2016-09-13Ephemeral Single Onion Services must have the NonAnonymous ADD_ONION flagteor
Tor checks that the flag matches the configured onion service anonymity. Tor refuses to create unflagged onion service using ADD_ONION, if they would be non-anonymous. The error is: 512 Tor is in non-anonymous onion mode Similarly, if the NonAnonymous flag is present, and Tor has the default anonymous onion config: 512 Tor is in anonymous onion mode
2016-08-19Merge remote-tracking branch 'public/deprecation_v2'Nick Mathewson
2016-08-12Merge remote-tracking branch 'public/Fix_19450'Nick Mathewson
2016-08-03Add new warn_deprecated option to config_assign*().Nick Mathewson
Also, collapse all the config_assign*() options into a flags argument, since having two boolean arguments was already confusing.
2016-08-02Remove/fix remaining evbuffer referencesNick Mathewson
2016-08-02Bufferevent removal: remove HAS_BUFFEREVENT macros and usageNick Mathewson
This is another way that we had bufferevents-only code marked.
2016-07-29Keep make check-spaces happyAndrea Shepard
2016-07-28Fix a huge pile of -Wshadow warnings.Nick Mathewson
These appeared on some of the Jenkins platforms. Apparently some GCCs care when you shadow globals, and some don't.
2016-07-28Merge branch 'bug18902_squashed'Nick Mathewson
2016-07-28Fix all -Wshadow warnings on LinuxNick Mathewson
This is a partial fix for 18902.
2016-07-08Merge remote-tracking branch 'sebastian/libevent2'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-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-30A little more specificity in documentation for getinfo download/ stuffNick Mathewson
Also, a const.
2016-06-29Expose GETINFO download status statics for test suite and make things mockableAndrea Shepard
2016-06-29Add bridge descriptor download status queries to GETINFOAndrea Shepard
2016-06-29Add router descriptor download status queries to GETINFOAndrea Shepard
2016-06-29Expose authority certificate download statuses on the control portAndrea Shepard
2016-06-27Expose consensus download statuses on the control portAndrea Shepard
2016-06-20Patch from dgoulet: fix a base16 problem that manifested w stemNick Mathewson