aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
AgeCommit message (Collapse)Author
2015-03-04Merge remote-tracking branch 'public/bug15064_025' into maint-0.2.6Nick Mathewson
2015-03-04Make TransProxyType ipfw work correctlyNick Mathewson
Fixes bug 15064; bugfix on 0.2.5.4-alpha.
2015-03-04only declare rv when it is used in destination_from_socket. Fixes 15151Nick Mathewson
2015-02-19Check ENABLE_TOR2WEB_MODE before any tor2webmode codeNick Mathewson
2015-02-04Use getsockname, not getsockopt, on TPROXY socketsNick Mathewson
2015-01-28Support connection_exit_connect() to AF_UNIX socketsAndrea Shepard
2015-01-20Merge branch 'bug14084'Nick Mathewson
2015-01-19Some days I just can't C.Nick Mathewson
2015-01-19Make check-spaces happier.Nick Mathewson
2015-01-19Replace a 4 with a 6; fix a bug that nobody noticed :/Nick Mathewson
Fixes 14280 bugfix on 1053af0b9c4127873034a935ce33 in 0.2.4.7-alpha.
2015-01-19Merge branch 'bug7555_v2_squashed'Nick Mathewson
Conflicts: src/or/connection_edge.c
2015-01-19Add a bunch of new comments to explain connection_ap_rewrite{,_and_attach}Nick Mathewson
Also, do a little light refactoring to move some variable declarations around and make a few things const Also fix an obnoxious bug on checking for the DONE stream end reason. It's not a flag; it's a possible value or a variable that needs to be masked.
2015-01-18Fix memory leak in connection_ap_handshake_rewrite_and_attach()Nick Mathewson
Spotted by asn. #14259. Bugfix on 368eb6a97 in 0.2.0.1-alpha.
2015-01-16Move entry_port_cfg_t fields in entry_connection_tNick Mathewson
Also rename some options for uniformity, and apply this script: @@ entry_connection_t *conn; @@ conn-> +entry_cfg. \( isolation_flags \| session_group \| socks_prefer_no_auth \| ipv4_traffic \| ipv6_traffic \| prefer_ipv6 \| cache_ipv4_answers \| cache_ipv6_answers \| use_cached_ipv4_answers \| use_cached_ipv6_answers \| prefer_ipv6_virtaddr \)
2015-01-13Allow MapAddress and Automap to work togetherNick Mathewson
The trick here is to apply mapaddress first, and only then apply automapping. Otherwise, the automap checks don't get done. Fix for bug 7555; bugfix on all versions of Tor supporting both MapAddress and AutoMap.
2015-01-12Begin writing unit tests for rewrite codeNick Mathewson
2015-01-10document rewrite_result_t and export for testingNick Mathewson
2015-01-10Move stream-closing out of rewrite codeNick Mathewson
2015-01-10Split the rewrite part of rewrite-and-attachNick Mathewson
I'd also like to split out the part that sends early socks responses.
2015-01-03New option "HiddenServiceAllowUnknownPorts"Nick Mathewson
This allows hidden services to disable the anti-scanning feature introduced in 0.2.6.2-alpha. With this option not set, a connection to an unlisted port closes the circuit. With this option set, only a RELAY_DONE cell is sent. Closes ticket #14084.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-12-30Merge remote-tracking branch 'dgoulet/bug13667_025_v4'Nick Mathewson
2014-12-29Fix: mitigate as much as we can HS port scanningDavid Goulet
Make hidden service port scanning harder by sending back REASON_DONE which does not disclose that it was in fact an exit policy issue. After that, kill the circuit immediately to avoid more bad requests on it. This means that everytime an hidden service exit policy does match, the user (malicious or not) needs to build a new circuit. Fixes #13667. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2014-12-23Fix compilation on platforms without IP6T_SO_ORIGINAL_DSTNick Mathewson
2014-12-23tweak whitespace; log bad socket family if bug occursNick Mathewson
2014-12-23Use the appropriate call to getsockopt for IPv6 socketsFrancisco Blas Izquierdo Riera (klondike)
The original call to getsockopt to know the original address on transparently proxyed sockets using REDIRECT in iptables failed with IPv6 addresses because it assumed all sockets used IPv4. This patch fixes this by using the appropriate options and adding the headers containing the needed definitions for these. This patch is released under the same license as the original file as long as the author iscredited. Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
2014-12-21Fix clang warning, IPv6 address comment, buffer size typoteor
The address of an array in the middle of a structure will always be non-NULL. clang recognises this and complains. Disable the tautologous and redundant check to silence this warning. Fixes bug 14001.
2014-12-07Use END_CIRC_REASON_TORPROTOCOL instead of magic number.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-21clients use optimistic data when reaching hidden servicesRoger Dingledine
Allow clients to use optimistic data when connecting to a hidden service, which should cut out the initial round-trip for client-side programs including Tor Browser. (Now that Tor 0.2.2.x is obsolete, all hidden services should support server-side optimistic data.) See proposal 181 for details. Implements ticket 13211.
2014-09-21get rid of trivial redundant commentRoger Dingledine
2014-06-03Squelch spurious LD_BUG message in connection_ap_handshake_socks_reply()Andrea Shepard
2014-04-16Fix OSX compilation.Nick Mathewson
2014-04-16Whitespace, doc fixesNick Mathewson
2014-04-16Educate tor on OpenBSD's use of divert-to rules with the pf firewall.dana koch
This means that tor can run without needing to communicate with ioctls to the firewall, and therefore doesn't need to run with privileges to open the /dev/pf device node. A new TransProxyType is added for this purpose, "pf-divert"; if the user specifies this TransProxyType in their torrc, then the pf device node is never opened and the connection destination is determined with getsockname (as per pf(4)). The default behaviour (ie., when TransProxyType is "default" when using the pf firewall) is still to assume that pf is configured with rdr-to rules.
2014-04-16tor_addr_from_sockaddr() is applicable in ipfw code, so use it.Nick Mathewson
2014-04-16ipfw TransPort support on FreeBSD (10267)Nick Mathewson
This isn't on by default; to get it, you need to set "TransProxyType ipfw". (The original patch had automatic detection for whether /dev/pf is present and openable, but that seems marginally fragile.)
2014-04-02Unit tests for connection_edge_process_resolved_cellNick Mathewson
Also rename a function to be more accurate (resolve->resolved)
2014-04-02Look at all of a RESOLVED cell; not just the first answer.Nick Mathewson
Also, stop accepting the old kind of RESOLVED cells with no TTL fields; they haven't been sent since 0.1.1.6-alpha. This patch won't work without the fix to #10468 -- it will break DNSPorts unless they set the proper ipv4/6 flags on entry_connection_t.
2014-02-21Merge remote-tracking branch 'public/bug10987_024'Nick Mathewson
2014-02-21Style tweaks on code, changes file for 10987Nick Mathewson
2014-02-21Fix: send back correct IPv6 SOCKS5 connect replyDavid Goulet
For a client using a SocksPort connection and IPv6, the connect reply from tor daemon did not handle AF_INET6 thus sending back the wrong payload to the client. A changes file is provided and this fixes #10987 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2014-01-17whitespace fixesNick Mathewson
2013-12-22Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-12-22Fix automapping to ipv6Nick Mathewson
Bugfix on 0.2.4.7-alpha; fixes bug 10465.
2013-10-31Add missing includes for circpathbias.hNick Mathewson
2013-07-10Completely refactor how FILENAME_PRIVATE worksNick Mathewson
We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
2013-06-10Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
2013-06-10Fix (Open?)BSD fast-connect bug with optimistic data.Nick Mathewson
There's an assertion failure that can occur if a connection has optimistic data waiting, and then the connect() call returns 0 on the first attempt (rather than -1 and EINPROGRESS). That latter behavior from connect() appears to be an (Open?)BSDism when dealing with remote addresses in some cases. (At least, I've only seen it reported with the BSDs under libevent, even when the address was 127.0.0.1. And we've only seen this problem in Tor with OpenBSD.) Fixes bug 9017; bugfix on 0.2.3.1-alpha, which first introduced optimistic data. (Although you could also argue that the commented-out connection_start_writing in 155c9b80 back in 2002 is the real source of the issue.)
2013-05-17Fix bug 8846: better log message on IP version confusionNick Mathewson