Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes our handling of
RekeyInd
a bit smarter by discardingRekeyInd
commands which are unexpected (specifically, if the LNS did not set theOptNeg
bit during the Join Request handling).This has showed up during some accidental fuzz testing - random bytes on FPort 0 are sent by the end device, and the LNS parses them as legitimate commands. A possible such command is
RekeyInd
, which switches the LoRaWAN version of the MAC state. If a 1.0.x end device sends this command, we must always discard it, otherwise we risk failing to match the packet (because the requested minor may be higher than 1, and thus enable the 1.1+ extra MIC checks).Changes
RekeyInd
commands.Unimplemented
errors are reported to Sentry and are logged with error level, as they generally signal some deep version mismatch, but the unimplemented state here is intentional.Testing
Local testing. This feature does not require explicit testing.
Regressions
The
RekeyInd
commands will now be rejected if the end device version is < 1.1+, which is the correct behavior anyway.Checklist
README.md
for the chosen target branch.CHANGELOG.md
.CONTRIBUTING.md
, there are no fixup commits left.