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

manage fcnt #1003

Merged
merged 10 commits into from
Oct 9, 2023
Merged

manage fcnt #1003

merged 10 commits into from
Oct 9, 2023

Conversation

michaeldjeffrey
Copy link
Contributor

No description provided.

That would refuse all future copies of this packet because they exceeded
the multi-buy. We want the rest of the already purchased packets to come
through okay.
don't re-check here, the packet was bought, let's use it
This already happens deeper in this call graph when the packet is
accepted and used
the max 32bit frame count is somewhere in the 4billions.
the highest frame count for a device in use here is ~1,800,000.
136 years has about 4billion seconds.
The device_worker will be provided with the verified fcnt rather than
the expected fcnt when handling a packet.
@@ -1185,80 +1182,66 @@ get_and_sort_devices(DevAddr, PubKeyBin) ->
get_device_by_mic(_MIC, _Payload, []) ->
undefined;
get_device_by_mic(ExpectedMIC, Payload, [Device | Devices]) ->
ExpectedFCnt = expected_fcnt(Device, Payload),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't guess at what the fcnt should be.
Iterate through the higher frame bits and determine for certain what the frame count is.
Then we can pass that fcnt through to the device worker and know it's verified.

A verified frame count is being provided here rather than a speculative
frame count.
@macpie macpie merged commit 9b2baeb into master Oct 9, 2023
34 checks passed
@macpie macpie deleted the mj/manage-fcnt branch October 9, 2023 18:49
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.

2 participants