tor/src/core
liberat 4e4c4e72d7 Handle binary IPv6 addresses and bracketed strings in RESOLVE_PTR.
When a SOCKS5 client sends a RESOLVE_PTR request, it must include
either an IPv4 or IPv6 address.  In the past this was required to be a
binary address (address types 1 or 4), but since the refactoring of
SOCKS5 support in Tor 0.3.5.1-alpha, strings (address type 3) are also
allowed if they represent an IPv4 or IPv6 literal.

However, when a binary IPv6 address is provided,
parse_socks5_client_request converts it into a string enclosed in
brackets.  This doesn't match what string_is_valid_ipv6_address
expects, so this would fail with the error "socks5 received
RESOLVE_PTR command with hostname type. Rejecting."

By replacing string_is_valid_ipv4_address/string_is_valid_ipv6_address
with tor_addr_parse, we accept strings both with and without brackets.
This fixes the handling of binary addresses, and also improves
symmetry with CONNECT and RESOLVE requests.

Fixes bug 32315.
2019-11-11 15:34:38 +00:00
..
crypto Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
mainloop Merge remote-tracking branch 'tor-github/pr/1056' into maint-0.3.5 2019-08-12 09:51:35 +10:00
or Merge branch 'maint-0.2.9' into maint-0.3.5 2019-11-06 11:19:30 +10:00
proto Handle binary IPv6 addresses and bracketed strings in RESOLVE_PTR. 2019-11-11 15:34:38 +00:00
include.am Extract addr-policy parsing code. 2018-10-01 11:17:19 -05:00