Skip to content

Disambiguate IPv6 host:port pairs with universal bracketing - #1870

Open
spencer-michaels-1pw wants to merge 3 commits into
simplex-chat:stablefrom
spencer-michaels-1pw:ipv6-universal-bracketing
Open

Disambiguate IPv6 host:port pairs with universal bracketing#1870
spencer-michaels-1pw wants to merge 3 commits into
simplex-chat:stablefrom
spencer-michaels-1pw:ipv6-universal-bracketing

Conversation

@spencer-michaels-1pw

Copy link
Copy Markdown

Summary

PR #1807 added support for reading bracketed IPv6 addresses, but left behind several cases in which simplexmq itself still generates bracket-less addresses that parse ambiguously when passed back into simplexmq if they explicitly specify a port. As a result, reading a saved IPv6 address or opening an invitation or web link to an IPv6 host can result in simplexmq erroneously reading the port as part of the address.

This PR adds brackets around IPv6 addresses generated as part of server addresses, remote-control invitations, connection links, and XFTP web links. Brackets are added even when no explicit port is written, keeping the address unambiguous.

For backwards compatibility, I erred on the side of still parsing older bracketless saved/linked IPv6 addresses as before, rather than refusing to parse them outright since they are inherently ambiguous.

Tests added/updated

  • Saving and reading server addresses preserves the IPv6 host and port, including lists of hosts and addresses with affixed passwords
  • Generated invitations read back as the same host:port pair, and their signatures validate
  • Connection and file links include IPv6 brackets and preserve the rest of the link
  • The web client reads the correct host and port from generated addresses
  • IPv4, domain, and onion addresses keep their existing format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant