[tor-bugs] #6124 [Flashproxy]: Flash proxy facilitator should not give IPv6 addresses to IPv4 proxies

Tor Bug Tracker & Wiki blackhole at torproject.org
Sun Dec 2 03:07:00 UTC 2012


#6124: Flash proxy facilitator should not give IPv6 addresses to IPv4 proxies
------------------------+---------------------------------------------------
 Reporter:  dcf         |          Owner:  dcf           
     Type:  defect      |         Status:  needs_revision
 Priority:  normal      |      Milestone:                
Component:  Flashproxy  |        Version:                
 Keywords:              |         Parent:                
   Points:              |   Actualpoints:                
------------------------+---------------------------------------------------
Changes (by dcf):

  * status:  new => needs_revision


Comment:

 Replying to [comment:2 jct]:
 > The attached patch is doing the following:
 >
 >  * Guessing the IP version of the Proxy
 >  * Guessing the IP version of the Client:
 >     * The Client's address in the list of registered clients
 ('''RegSet''') has a different encoding that the Proxy's address
 >  * Giving to the Proxy a Client from '''RegSet''' with the same IP
 version:
 >     * It is easy to change it in order to give IPv4 clients to IPv6
 Proxies
 >
 > The patch contains an automatic test: '''ticket-6124-test.py'''

 Use two `RegSet`s for IPv4 and IPv6, instead of searching the set for a
 reg of the appropriate family. `fetch` should remain a constant-time
 operation.

 Functions like `ip_ver` that don't depend on a class instance (that don't
 use the `self` variable) should be ordinary functions, not part of a
 class. Put them in `fac.py`.

 It looks like you want to factor out the address family-detection code
 from `fac.parse_addr_spec` into a new function (and have
 `fac.parse_addr_spec` call that function). That, or create a new function
 that can be run on the first element of an addr tuple (i.e., a numeric
 address string, not including brackets for IPv6), and returns the address
 family.

 In general, use `socket.AF_INET` and `socket.AF_INET6`, not the numbers 4
 and 6.

 In the test code, change comments like "# IPv6 client and IPv4 proxy" into
 docstrings so they appear in the unittest output. Thank you for making new
 tests!

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6124#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list