summaryrefslogtreecommitdiff
path: root/src/or/control.c
AgeCommit message (Collapse)Author
2017-11-14Merge branch 'maint-0.3.2'Nick Mathewson
2017-11-10control: Fix wrong Action on failure to upload an HS descriptorDavid Goulet
On failure to upload, the HS_DESC event would report "UPLOAD_FAILED" as the Action but it should have reported "FAILED" according to the spec. Fixes #24230 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-01Merge remote-tracking branch 'public/owning_control_fd'Nick Mathewson
2017-10-20Return instead of exiting in options_init_from_torrc()Nick Mathewson
2017-10-19Comment-only change: annotate exit() calls.Nick Mathewson
Sometimes when we call exit(), it's because the process is completely hopeless: openssl has a broken AES-CTR implementation, or the clock is in the 1960s, or something like that. But sometimes, we should return cleanly from tor_main() instead, so that embedders can keep embedding us and start another Tor process. I've gone through all the exit() and _exit() calls to annotate them with "exit ok" or "XXXX bad exit" -- the next step will be to fix the bad exit()s. First step towards 23848.
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-15Replace accumulated C ;;s with ;sNick Mathewson
I don't know where these came from.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-15Merge remote-tracking branch 'dgoulet/ticket19254_032_01'Nick Mathewson
2017-09-15Make control port download status next attempts consistentteor
Make download status next attempts reported over the control port consistent with the time used by tor. This issue only occurs if a download status has not been reset before it is queried over the control port. Fixes 23525, not in any released version of tor.
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-09-08Merge branch 'ed25519_lookup'Nick Mathewson
2017-09-08Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-08Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-09-08Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-09-08Merge branch 'ticket22377'Nick Mathewson
2017-09-07Fix crashes on empty +HSPOST and +POSTDESCRIPTOR commandsNick Mathewson
Fixes bug 22644; bugfix on 0.2.7.1-alpha and 0.2.0.1-alpha respectively.
2017-09-05Repair buffer API so everything starts with buf_.Nick Mathewson
Our convention is that functions which manipulate a type T should be named T_foo. But the buffer functions were super old, and followed all kinds of conventions. Now they're uniform. Here's the perl I used to do this: \#!/usr/bin/perl -w -i -p s/read_to_buf\(/buf_read_from_socket\(/; s/flush_buf\(/buf_flush_to_socket\(/; s/read_to_buf_tls\(/buf_read_from_tls\(/; s/flush_buf_tls\(/buf_flush_to_tls\(/; s/write_to_buf\(/buf_add\(/; s/write_to_buf_compress\(/buf_add_compress\(/; s/move_buf_to_buf\(/buf_move_to_buf\(/; s/peek_from_buf\(/buf_peek\(/; s/fetch_from_buf\(/buf_get_bytes\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/buf_remove_from_front\(/buf_drain\(/; s/peek_buf_startswith\(/buf_peek_startswith\(/; s/assert_buf_ok\(/buf_assert_ok\(/;
2017-09-05Move protocol-specific functions out of buffers.cNick Mathewson
This commit does not change the implementation of any function: it only moves code and adds new includes as necessary. Part of #23149.
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-08-24Merge remote-tracking branch 'dgoulet/ticket17242_032_03-squashed'Nick Mathewson
2017-08-24Merge branch 'bug19281_025'Nick Mathewson
2017-08-22Refactor node lookup APIs to take flagsNick Mathewson
Right now there's a single warn_if_unnamed flag for router_get_consensus_status_by_nickname() and node_get_by_nickname(), that is nearly always 1. I've turned it into an 'unsigned' bitfield, and inverted its sense. I've added the flags argument to node_get_by_hex_id() too, though it does nothing there right now. I've removed the router_get_consensus_status_by_nickname() function, since it was only used in once place. This patch changes the warning behavior of GETINFO ns/name/<name>, since all other name lookups from the controller currently warn. Later I'm going to add more flags, for ed25519 support.
2017-08-19prop224: Refactor parse_extended_hostname() to parse v3 addrs.George Kadianakis
We need this func so that we recognize SOCKS conns to v3 addresses. - Also rename rend_valid_service_id() to rend_valid_v2_service_id() - Also move parse_extended_hostname() tests to their own unittest, and add a v3 address to the test as well. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-09Make write_escaped_data more robust to large inputs.Nick Mathewson
The old implementation would fail with super-long inputs. We never gave it any, but still, it's nicer to dtrt here. Reported by Guido Vranken. Fixes bug 19281.
2017-07-05Make the strings from #1667 static.Nick Mathewson
2017-07-05Add a timestamp field to the CIRC_BW and STREAM_BW eventsDonncha O'Cearbhaill
Closes ticket 19254.
2017-07-05Merge branch 'neena-fix-1667'Nick Mathewson
2017-07-05Extract "not an HTTP proxy" messages.Nick Mathewson
2017-07-01general formatting / whitespace / typo fixesRoger Dingledine
2017-06-29Merge branch 'ticket22684'Nick Mathewson
2017-06-26Merge branch 'maint-0.3.1'Nick Mathewson
2017-06-26Patch for 22720 from huyvq: exit(1) more oftenNick Mathewson
See changes file for full details.
2017-06-21Add GETINFO targets to determine whether md/desc fetching is enabledNick Mathewson
Closes ticket 22684.
2017-06-21Better error message for GETINFO desc/(id|name) whenever microdescriptors ↵Kevin Butler
are in use. Fixes #5847.
2017-06-21Fix compilation on 1667 code.Nick Mathewson
2017-06-21Respond meaningfully to HTTP requests on the control port. Fix #1667Ravi Chandra Padmala
(Squashed with bufferevents portions removed, by nickm)
2017-05-26Cleanup MOCK_IMPL (etc) to be findable with etagsNick Mathewson
A fair number of our mock_impl declarations were messed up so that even our special AM_ETAGSFLAGS couldn't find them. This should be a whitespace-only patch.
2017-05-18Add support for %include funcionality on torrc #1922Daniel Pinto
config_get_lines is now split into two functions: - config_get_lines which is the same as before we had %include - config_get_lines_include which actually processes %include
2017-05-09Merge branch 'dgoulet_ticket22060_031_01_squashed'Nick Mathewson
2017-05-09config: Remove AllowSingleHopCircuits optionDavid Goulet
Deprecated in 0.2.9.2-alpha, this commits changes it as OBSOLETE() and cleans up the code associated with it. Partially fixes #22060 Signed-off-by: David Goulet <dgoulet@torproject.org>
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.