aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
Commit message (Collapse)AuthorAge
* Merge remote branch 'public/bug1859_021' into maint-0.2.1Nick Mathewson2011-02-22
|\
| * Issues with router_get_by_nickname()Robert Hogan2010-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://trac.torproject.org/projects/tor/ticket/1859 Use router_get_by_digest() instead of router_get_by_hexdigest() in circuit_discard_optional_exit_enclaves() and rend_client_get_random_intro(), per Nick's comments. Using router_get_by_digest() in rend_client_get_random_intro() will break hidden services published by Tor versions pre 0.1.2.18 and 0.2.07-alpha as they only publish by nickname. This is acceptable however as these versions only publish to authority tor26 and don't work for versions in the 0.2.2.x series anyway.
| * Issues with router_get_by_nickname()Robert Hogan2010-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://trac.torproject.org/projects/tor/ticket/1859 There are two problems in this bug: 1. When an OP makes a .exit request specifying itself as the exit, and the exit is not yet listed, Tor gets all the routerinfos needed for the circuit but discovers in circuit_is_acceptable() that its own routerinfo is not in the routerdigest list and cannot be used. Tor then gets locked in a cycle of repeating these two steps. When gathering the routerinfos for a circuit, specifically when the exit has been chosen by .exit notation, Tor needs to apply the same rules it uses later on when deciding if it can build a circuit with those routerinfos. 2. A different bug arises in the above situation when the Tor instance's routerinfo *is* listed in the routerlist, it shares its nickname with a number of other Tor nodes, and it does not have 'Named' rights to its nickname. So for example, if (i) there are five nodes named Bob in the network, (ii) I am running one of them but am flagged as 'Unnamed' because someone else claimed the 'Bob' nickname first, and (iii) I run my Tor as both client and exit the following can happen to me: - I go to www.evil.com - I click on a link www.evil.com.bob.exit - My request will exit through my own Tor node rather than the 'Named' node Bob or any of the others. - www.evil.com now knows I am actually browsing from the same computer that is running my 'Bob' node So to solve both issues we need to ensure: - When fulfilling a .exit request we only choose a routerinfo if it exists in the routerlist, even when that routerinfo is ours. - When getting a router by nickname we only return our own router information if it is not going to be used for building a circuit. We ensure this by removing the special treatment afforded our own router in router_get_by_nickname(). This means the function will only return the routerinfo of our own router if it is in the routerlist built from authority info and has a unique nickname or is bound to a non-unique nickname. There are some uses of router_get_by_nickname() where we are looking for the router by name because of a configuration directive, specifically local declaration of NodeFamilies and EntryNodes and other routers' declaration of MyFamily. In these cases it is not at first clear if we need to continue returning our own routerinfo even if our router is not listed and/or has a non-unique nickname with the Unnamed flag. The patch treats each of these cases as follows: Other Routers' Declaration of MyFamily This happens in routerlist_add_family(). If another router declares our router in its family and our router has the Unnamed flag or is not in the routerlist yet, should we take advantage of the fact that we know our own routerinfo to add us in anyway? This patch says 'no, treat our own router just like any other'. This is a safe choice because it ensures our client has the same view of the network as other clients. We also have no good way of knowing if our router is Named or not independently of the authorities, so we have to rely on them in this. Local declaration of NodeFamilies Again, we have no way of knowing if the declaration 'NodeFamilies Bob,Alice,Ringo' refers to our router Bob or the Named router Bob, so we have to defer to the authorities and treat our own router like any other. Local declaration of NodeFamilies Again, same as above. There's also no good reason we would want our client to choose it's own router as an entry guard if it does not meet the requirements expected of any other router on the network. In order to reduce the possibility of error, the patch also replaces two instances where we were using router_get_by_nickname() with calls to router_get_by_hexdigest() where the identity digest of the router is available.
* | Remove a loud info log messageNick Mathewson2011-01-07
| |
* | Correctly detect and exclude addresses outside of our virtual address rangeNick Mathewson2011-01-07
| | | | | | | | | | Found by cypherpunks; fixes more of 2328. Bug was introduced in 3623a122; first appeared in 0.2.0.5-alpha.
* | Merge branch 'bug2328_021' into maint-0.2.1Nick Mathewson2011-01-06
|\ \
| * | Notice a little faster if we're running out of virtual addressesNick Mathewson2011-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were not decrementing "available" every time we did ++next_virtual_addr in addressmap_get_virtual_address: we left out the --available when we skipped .00 and .255 addresses. This didn't actually cause a bug in most cases, since the failure mode was to keep looping around the virtual addresses until we found one, or until available hit zero. It could have given you an infinite loop rather than a useful message, however, if you said "VirtualAddrNetwork 127.0.0.255/32" or something broken like that. Spotted by cypherpunks
| * | Handle a NULL return from addressmap_get_virtual_addressNick Mathewson2011-01-05
| | | | | | | | | | | | Fix for bug 2328; bugfix on 0.1.2.1-alpha; bug found by doorss.
| * | Fix a double-counting bug in addrmap_get_virtual_addressNick Mathewson2011-01-05
| | | | | | | | | | | | | | | | | | We were decrementing "available" twice for each in-use address we ran across. This would make us declare that we ran out of virtual addresses when the address space was only half full.
* | | Bump copyright statements to 2011Nick Mathewson2011-01-03
|/ /
* / Make payloads into uint8_t.Nick Mathewson2010-12-15
|/ | | | This will avoid some signed/unsigned assignment-related bugs.
* Update Tor Project copyright yearsNick Mathewson2010-02-27
|
* Revert "Teach connection_ap_can_use_exit about Exclude*Nodes"Roger Dingledine2009-09-20
| | | | | | | This reverts commit dc3229313b6d2aaff437c6fc7fa55ead4409e93d. We're going to do this more thoroughly in 0.2.2.x, and not in maint-0.2.1.
* Teach connection_ap_can_use_exit about Exclude*NodesSebastian Hahn2009-09-16
| | | | | | To further attempt to fix bug 1090, make sure connection_ap_can_use_exit always returns 0 when the chosen exit router is excluded. This should fix bug1090.
* Make "Invalid onion hostname" msg respect SafeLogging.Nick Mathewson2009-07-07
| | | | Patch by Roger; fixes bug 1027.
* Better fix for 997.Karsten Loesing2009-06-19
|
* Revert "Backport fix for bug 997."Karsten Loesing2009-06-19
| | | | This reverts commit 3847f54945933a11d14053b80427f268ffcfd8ad.
* Backport fix for bug 997.Karsten Loesing2009-06-16
| | | | Backporting 6a32beb and ca8708a.
* Spell-check Tor.Nick Mathewson2009-05-27
|
* Fix misreporting of stream bandwidths.Mike Perry2009-05-14
|
* Update copyright to 2009.Karsten Loesing2009-05-04
|
* make it compile tooRoger Dingledine2009-04-11
| | | | svn:r19295
* play make-believe that addr isn't a uint32_tRoger Dingledine2009-04-11
| | | | svn:r19293
* fix the same bug in two more locations (thanks to lark for proddingRoger Dingledine2009-04-11
| | | | | | | me further) svn:r19292
* Finally fix the bug where dynamic-IP relays disappear when theirRoger Dingledine2009-04-11
| | | | | | | | | | | IP address changes: directory mirrors were mistakenly telling them their old address if they asked via begin_dir, so they never got an accurate answer about their new address, so they just vanished after a day. Should fix bugs 827, 883, and 900 -- but alas, only after every directory mirror has upgraded. svn:r19291
* If the controller claimed responsibility for a stream, but thatRoger Dingledine2009-02-13
| | | | | | | | | stream never finished making its connection, it would live forever in circuit_wait state. Now we close it after SocksTimeout seconds. Bugfix on 0.1.2.7-alpha; reported by Mike Perry. svn:r18516
* As an exit node, scrub the IP address to which we are exiting in the logs. ↵Karsten Loesing2009-02-10
| | | | | | Bugfix on 0.2.1.8-alpha. svn:r18477
* decide that mikeperry's bug should be fixed in 0.2.1.xRoger Dingledine2009-02-09
| | | | | | | (but not in 0.2.1.12-alpha, sorry) svn:r18417
* make a note about a clause in connection_edge.c that is probablyRoger Dingledine2009-02-04
| | | | | | | | redundant, and is definitely confusing. we should take it out in 0.2.2.x and see who squeaks. svn:r18383
* Forward-port: Fix bug 893: check AP connections for markedness before ↵Nick Mathewson2009-01-28
| | | | | | expiring them. svn:r18299
* make an assert tighter and replace another with an if.Nick Mathewson2009-01-14
| | | | svn:r18102
* Preserve reporting of stream end reasons to the local controlMike Perry2009-01-05
| | | | | | | | port. They were lost in the changes for Proposal 148. svn:r17911
* Another round of downgrading removing or postponing XXXX021 issues. Some ↵Nick Mathewson2009-01-04
| | | | | | remain, though. svn:r17888
* Remove svn $Id$s from our source, and remove tor --version --version.Nick Mathewson2009-01-04
| | | | | | | | The subversion $Id$ fields made every commit force a rebuild of whatever file got committed. They were not actually useful for telling the version of Tor files in the wild. svn:r17867
* Use the literal parse of an address in dns_resolve_impl if parsing the ↵Nick Mathewson2008-12-24
| | | | | | address as an ipv4 or ipv6 address _succeeded_. Not if it failed. Bug introduced in r17707 (post 0.2.1.8-alpha), and found by xiando. svn:r17758
* Move in-addr.arpa parsing and generation into address.c, and simplify the ↵Nick Mathewson2008-12-19
| | | | | | code that does it elsewhere. Incidentally, this lets exit servers answer requests for ip6.arpa addresses. svn:r17707
* Replace calls to time(NULL) that occur on the order of once per read, one ↵Nick Mathewson2008-12-18
| | | | | | per write, or once per cell with calls to a function that looks at a cached value of time. This is tricksy to benchmark, since it will only help on systems where time() is a syscall and syscalls are relatively slow. svn:r17690
* Fix a memory leak of one address string per DNSPort request.Nick Mathewson2008-12-18
| | | | svn:r17681
* Remove RedirectExit feature; it has been deprecated since 0.2.0.3-alphaNick Mathewson2008-12-17
| | | | svn:r17663
* Resolve many DOCDOCs.Nick Mathewson2008-12-17
| | | | svn:r17662
* Use ctags and a python script to find identifiers that are never used ↵Nick Mathewson2008-12-17
| | | | | | anywhere, and remove the ones that we really want gone. svn:r17651
* Move edge-only flags from connection_t to edge_connection_t.Nick Mathewson2008-12-17
| | | | svn:r17643
* Implement proposal 148: Make client stream end reasons uniform.Nick Mathewson2008-12-12
| | | | | | This patch makes every RELAY_COMMAND_END cell that we send pass through one of two functions: connection_edge_end and relay_send_end_cell_from_edge. Both of these functions check the circuit purpose, and change the reason to MISC if the circuit purpose means that it's for client use. svn:r17612
* clarify that 'resolve' relay cells nul-terminate the hostname, justRoger Dingledine2008-12-02
| | | | | | | like 'begin' relay cells. svn:r17442
* Fix a possible segfault when establishing an exit connection. Bugfix on ↵Karsten Loesing2008-11-16
| | | | | | 0.2.1.5-alpha. svn:r17275
* Patch from rovv: send back END cell in response to connect attempts to ↵Nick Mathewson2008-10-21
| | | | | | nonexistent hidden service port. svn:r17137
* Patch from mwenge: update TrackHostExits mapping expiry times when the ↵Nick Mathewson2008-09-29
| | | | | | mappings are used, so that they expire a while after their last use, not a while after their creation. svn:r17004
* Commit fix for bug 807 from mwenge: send CLOSED controller event for reverse ↵Nick Mathewson2008-09-26
| | | | | | dns resolve, not FAILED. svn:r16985
* Proposal 152 implementation from Josh Albrecht, with tweaks.Nick Mathewson2008-09-26
| | | | svn:r16983
* Add patch 4 from Karsten for proposal 121, slightly modified. Karsten ↵Nick Mathewson2008-09-24
| | | | | | should definitely re-review the bits I changed. svn:r16955