resolve: consistently parse IP addresses in square brackets

When parsing addreses via Tor's internal DNS lookup API:
* reject IPv4 addresses in square brackets (with or without a port),
* accept IPv6 addresses in square brackets (with or without a port), and
* accept IPv6 addresses without square brackets, as long as they have no port.

This change completes the work started in 23082, making address parsing
consistent between tor's internal DNS lookup and address parsing APIs.

Fixes bug 30721; bugfix on 0.2.1.5-alpha.
This commit is contained in:
teor
2019-06-02 17:46:58 +10:00
committed by Nick Mathewson
parent 180048e013
commit cd1de99468
3 changed files with 70 additions and 42 deletions
+6
View File
@@ -0,0 +1,6 @@
o Minor bugfixes (networking):
- When parsing addreses via Tor's internal DNS lookup API, reject IPv4
addresses in square brackets, and accept IPv6 addresses in square
brackets. This change completes the work started in 23082, making
address parsing consistent between tor's internal DNS lookup and address
parsing APIs. Fixes bug 30721; bugfix on 0.2.1.5-alpha.