Skip to content

Address two issues#461

Merged
ivmarkov merged 2 commits into
project-chip:mainfrom
sysgrok:fix-cert-validation-issue
May 25, 2026
Merged

Address two issues#461
ivmarkov merged 2 commits into
project-chip:mainfrom
sysgrok:fix-cert-validation-issue

Conversation

@ivmarkov
Copy link
Copy Markdown
Contributor

This PR is containing two commits, each addressing a separate bug:

Commit 1 (f5f7a0d)

The recently-introduced "expired" Session state is currently treated too "drastically".
What I mean by that is that if we receive a message on an already active exchange (say, an innocent ACK), if that's for an expired session we'll claim that this session does not exist.

That's too drastic because e.g. - when the "remove fabric" command on the NOC cluster is invoked by a peer - our own command response to that command cannot complete, because - according to the above logic - we never receive the ACK reply ffrom the peer for our command response and therefore we keep re-trying the sending!

The fix is to only not allow expired sessions for new exchanges on that session, which are about to be created. For on-going exchanges, the fact that the session is expired is not considered a show-stopper anymore.

Commit 2 (3e7c20d)

This is addressing #459 .
The bug here is that if we don't have a reliable wall clock UTC timestamp, but only a "last known good UTC timestamp" - like the one we automatically get during rs-matter build-time - we cannot use the lkgut value to check the validity start of a certificate because the certificate might actually be generated AFTER the build of rs-matter had happened.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a UtcTime enum to distinguish between reliable and unreliable (Last-Known-Good) clock states, updating certificate verification logic to skip NotBefore checks when the clock is unreliable. It also refines session expiration handling to allow ongoing exchanges to complete before a session is fully reclaimed, specifically addressing scenarios like the RemoveFabric command. Additionally, the SessionNotFound status code is updated to not require the reliability flag in secure channel communications, and various components are updated to utilize the new time-tracking API. I have no feedback to provide.

@github-actions
Copy link
Copy Markdown

PR #461: Size comparison from b23a6ab to 3e7c20d

Full report (8 builds for (core), dimmable-light, onoff-light, onoff-light-bt, speaker)
platform target config section b23a6ab 3e7c20d change % change
(core) riscv32imac-unknown-none-elf infodefmt-optz-ltofat FLASH 446972 447244 272 0.1
RAM 71056 71056 0 0.0
thumbv6m-none-eabi infodefmt-optz-ltofat FLASH 361528 361672 144 0.0
RAM 66628 66628 0 0.0
thumbv7em-none-eabi infodefmt-optz-ltofat FLASH 339296 339564 268 0.1
RAM 66404 66404 0 0.0
x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 875171 875459 288 0.0
RAM 71386 71386 0 0.0
dimmable-light x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 2054256 2054208 -48 -0.0
RAM 60368 60368 0 0.0
onoff-light x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 1981256 1981656 400 0.0
RAM 59536 59536 0 0.0
onoff-light-bt x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 3364912 3365320 408 0.0
RAM 5776 5776 0 0.0
speaker x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 2016808 2016704 -104 -0.0
RAM 5472 5472 0 0.0

@ivmarkov ivmarkov force-pushed the fix-cert-validation-issue branch from 3e7c20d to b4c53f8 Compare May 25, 2026 11:33
@ivmarkov ivmarkov force-pushed the fix-cert-validation-issue branch from b4c53f8 to 2fc1e65 Compare May 25, 2026 11:36
@ivmarkov ivmarkov merged commit 7848981 into project-chip:main May 25, 2026
14 checks passed
@github-actions
Copy link
Copy Markdown

PR #461: Size comparison from b23a6ab to 2fc1e65

Full report (8 builds for (core), dimmable-light, onoff-light, onoff-light-bt, speaker)
platform target config section b23a6ab 2fc1e65 change % change
(core) riscv32imac-unknown-none-elf infodefmt-optz-ltofat FLASH 446972 447244 272 0.1
RAM 71056 71056 0 0.0
thumbv6m-none-eabi infodefmt-optz-ltofat FLASH 361528 361672 144 0.0
RAM 66628 66628 0 0.0
thumbv7em-none-eabi infodefmt-optz-ltofat FLASH 339296 339564 268 0.1
RAM 66404 66404 0 0.0
x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 875171 875459 288 0.0
RAM 71386 71386 0 0.0
dimmable-light x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 2054256 2054208 -48 -0.0
RAM 60368 60368 0 0.0
onoff-light x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 1981256 1981656 400 0.0
RAM 59536 59536 0 0.0
onoff-light-bt x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 3364912 3365320 408 0.0
RAM 5776 5776 0 0.0
speaker x86_64-unknown-linux-gnu infologs-optz-ltofat FLASH 2016808 2016704 -104 -0.0
RAM 5472 5472 0 0.0

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.

1 participant