Don't use channel index for encrypted packet (#5509)
* Don't use channel index for encrypted packet * Remove assert in `getKey`, set invalid key length So encrypting will fail without reboot * Reset channel to 0 when unable to encrypt Such that the NAK doesn't use the failing channel hash
This commit is contained in:
@@ -271,6 +271,7 @@ ErrorCode Router::send(meshtastic_MeshPacket *p)
|
||||
auto encodeResult = perhapsEncode(p);
|
||||
if (encodeResult != meshtastic_Routing_Error_NONE) {
|
||||
packetPool.release(p_decoded);
|
||||
p->channel = 0; // Reset the channel to 0, so we don't use the failing hash again
|
||||
abortSendAndNak(encodeResult, p);
|
||||
return encodeResult; // FIXME - this isn't a valid ErrorCode
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user