Scrub addresses before logging them
MAC, IP and onion addresses should be scrubbed before logging to ensure we don't leave any sensitive information in plaintext on the device or send it in crash reports or feedback.
We need to keep enough information for the addresses to be useful for debugging, without harming user privacy. Perhaps something like the following:
- MAC addresses (including Bluetooth): keep the first and last octets, replace the rest with XX
- Link-local and site-local IPv4 addresses: keep the full address
- Other IPv4 addresses: keep the first and last octets, replace the rest with XX
- IPv6 addresses: not intentionally used by Briar, replace the whole thing with XX
- Onion addresses: keep the first three characters, replace the rest with XX