Skip to content
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

Avoid assert on receiving undecryptable packet #4059

Merged
merged 3 commits into from
Jun 9, 2024

Conversation

GUVWAF
Copy link
Member

@GUVWAF GUVWAF commented Jun 9, 2024

Fixes #3959.

It actually was an assert, as I captured it also on an ESP32:

assert failed: CryptoKey Channels::getKey(ChannelIndex) Channels.cpp:108 (ch.has_settings)

Problem was that it tried to send a NAK when decrypting failed. In that case, the channel index is still the hash, so it couldn’t get the channel settings when trying to encrypt the NAK. So now we’ll send the NAK on its primary channel in that case. It’s the best we can do, in the hope the other side understands that.

However, it tried to send the NAK because it thought mp.decoded.want_response was set and no module responded, but decoded is not valid if it’s not decrypted, so I also added additional checks for that.

@thebentern thebentern merged commit 237944a into meshtastic:master Jun 9, 2024
84 checks passed
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.

[Bug]: PicoW Hardware Firmware Crash On Bad Packet
3 participants