heyaim 46f84b61f0 Validate relay directories with iOS's rules
#914 aligned the file both platforms read and how rows are keyed and
ordered; the acceptance rules still differed. iOS rejects a whole
directory on one malformed or conflicting row, validates the header,
caps size and rows, and screens every host. This client skipped bad
rows and accepted almost any host. The bitchat repo validates the file
before it lands; this port bounds what the client accepts as well.

parseCsv and canonicalHost are replaced by a port of
GeoRelayDirectory.validatedEntries and validatedDirectoryAddress. A
rejected download keeps the current list; one that keeps less than
half of the known entries is rejected. Five details follow iOS's
compiled validator rather than a plain reading of the Swift, each with
a test. The cache refetches at startup when its source URL changed.

Cross-checked against the Swift validator on 84 fixture runs and
100,000 fuzzed inputs. Full suite, lint and build pass.
2026-09-07 20:56:21 -05:00
..
2025-09-14 03:32:10 +02:00
2026-07-28 20:58:17 +02:00