The tor_addr_port_lookup() function uses the DNS resolver if it receives a hostname. We don't want to support hostnames in bridge addresses, do we? Nothing in our spec says we do, does it?
Alternatively, if we do want to support hostnames, we should drop the test in test_config.c that does:
bad_bridge_line_test("a.b.c.d");
Since being on a DNS-hijacking cafe wifi seems to make the test fail, when a.b.c.d does resolve to something.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
I'm also not sure whether this is a feature or a bug.
For example, I know that Kevin Dyer is using DNS names in his FTE bundles so that he can dynamically support multiple IP addresses, or seamlessly change between IP addresses. Bridge domain names might provide a bit of censorship circumvention qualities against adversaries who can only do IP block. Of course, if the adversary can block DNS queries, it doesn't make any difference.
Hm, not sure what to do. I will think about it some more.
when I'm testing things; I would have to memorize my bridge's IP address, but that's no big deal.
Resolving the names at the time of parsing is indeed strange. I would be less surprised if the names were resolved at the time of the SOCKS connection, but that's fairly minor. If you assume that the name has to be resolved one way or another, it doesn't matter much when you resolve it, but some transports may not want the name to be resolved (or may want to resolve it in their own way).
For me, it would be nice if Tor would pass unresolved host names to pluggable transports, and allow the pluggable transport to resolve it (or not). One use case is the mnemonic one above. Another is the new [[doc/meek|meek]] transport, which doesn't use a bridge IP address, but rather a URL:
You can in fact write it this way now, but it won't work because Tor will pre-resolve the name, and the transport will receive only an IP address and will not know what to put in the Host header of its HTTP requests. I admit this case is not so compelling, because I wouldn't actually write it that way. A separate url argument allows you to include a path, which the hostname:port syntax doesn't. But for what it's worth, Tor passing host names to transports is what I assumed would happen when I started coding things, and I was surprised that it was resolving the names.
It might be nice from a UX point of view if there was a way to indicate that the address field is going to be ignored, like with meek and flash proxy. A special invalid domain name could work for that (but is maybe not the best way).
For the record the obfsproxy SOCKSv5 code merged as part of #9221 (closed) will happly handle requests with DOMAINNAME ATYP, so when this behaviour is changed, we should decide if this is a good thing to do or not.
IMO the right thing to do is to make bridge addresses be IP-only for now (in 0.2.5), and to later (0.2.6 or later) support accepting hostnames and passing them to the pluggable transports. I don't think resolving hostnames at configure time makes sense.
Maybe you want to add the following trivial unit test too:
+ /* Make sure that the default port has lower priority than the real+ one */+ r= tor_addr_port_parse(LOG_DEBUG,+ "192.0.2.2:666",+ &addr, &port, 200);+ test_assert(r == 0);+ tt_int_op(port,==,666);
It makes sure that the default port has lower priority than the port in the addr:port string.
I think that's what the code wants to do, but the behavior is not documented.
Recommendation: strongly consider backport if 0.2.5.4 proves stable. Launching DNS requests based on bad bridge lines seems like a poor failure mode indeed.
I always thought this was a feature, not a bug. Your local network sees you using a bridge after all, and if you want to demand a certain fingerprint for it you still can, so what's one extra dns resolve give or take.
So I'd argue against backport, especially since apparently we're planning to put the feature back in in 0.2.6.