-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add unencrypted payloads #8454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Add unencrypted payloads #8454
Conversation
|
Wouldn't it suffice to just have a magic channel hash for unencrypted payloads? Or combine it with the magic number in If the magic channel hash doesn't match, we don't even need to bother trying to decode the protobuf. |
I did check that first, and the channel hash is already fully spoken for - the hash method used returns any number between 0 and 255, with no reserved values. Are you suggesting that I hijack a value that might also be in use by a channel? |
You have to assign a channel hash anyway, so it would be good to not use 0x00 (used for PKI) and any of the hashes resulting from the default preset names (LongFast, MediumFast, etc.). |
Is this a case where one of the other supported single byte PSK might be used? |
To what end? An attempted PSK decryption plus protobuf decode is more expensive than just the protobuf decode on its own. Given that these packets are explicitly intended to be public, I'm not sure what purpose encrypting them would actually serve. |
I'm just suggesting it as an alternative to the introduction of unencrypted payloads 😃 |
Do you have a mechanic in mind? This needs to work without requiring the user to configure a channel (which is currently mandatory for meshtastic PSK, so implementing this as encrypted would also require modifying the crypto logic). |
This PR adds unencrypted payload handling alongside normal operation. The purpose of this feature is to support replay advertisements between nodes that do not share a common channel.
The mechanism is to simply attempt decoding of a Data protobuf prior to decryption, and if it is successful, then treat the packet as unencrypted. In order to minimise the possibility of encrypted data accidentally happening to decode as something valid, a magic number is also checked, and the decode is rejected if this does not match.
This PR depends on meshtastic/protobufs#798.
🤝 Attestations