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

Fix failsafe extension when we have a device attestation delegate. #25787

Conversation

bzbarsky-apple
Copy link
Contributor

The boolean test in ExtendArmFailSafeForDeviceAttestation was backwards, so there were two failure cases:

  1. If we had a delegate but FailSafeExpiryTimeoutSecs() returned NullOptional, we would skip extending the fail-safe (expected), but set failSafeSkipped to false, and so not actually make our "continue commissioning" callback.

  2. If we had a delegate and FailSafeExpiryTimeoutSecs() returned a too-small value, we would also skip resetting the fail-safe, but end up setting failSafeSkipped to false, and hence again failing to make our "continue commissioning" callback.

The fix is to reverse the sense of the "do we need to call back immediately" boolean, to make it a little clearer what the logic flow is here, and then check it appropriately.

The boolean test in ExtendArmFailSafeForDeviceAttestation was backwards, so
there were two failure cases:

1. If we had a delegate but FailSafeExpiryTimeoutSecs() returned NullOptional,
we would skip extending the fail-safe (expected), but set failSafeSkipped to
_false_, and so not actually make our "continue commissioning" callback.

2. If we had a delegate and FailSafeExpiryTimeoutSecs() returned a too-small
value, we would also skip resetting the fail-safe, but end up setting
failSafeSkipped to false, and hence again failing to make our "continue
commissioning" callback.

The fix is to reverse the sense of the "do we need to call back immediately"
boolean, to make it a little clearer what the logic flow is here, and then check
it appropriately.
@bzbarsky-apple bzbarsky-apple force-pushed the fix-device-attestation-failsafe-handling branch from 5754370 to 7596377 Compare March 22, 2023 17:20
@github-actions
Copy link

PR #25787: Size comparison from 6be032d to 7596377

Increases (1 build for cc32xx)
platform target config section 6be032d 7596377 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20251230 20251231 1 0.0
Full report (1 build for cc32xx)
platform target config section 6be032d 7596377 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 645825 645825 0 0.0
(read/write) 203848 203848 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197248 197248 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 930286 930286 0 0.0
.debug_aranges 87400 87400 0 0.0
.debug_frame 300336 300336 0 0.0
.debug_info 20251230 20251231 1 0.0
.debug_line 2661959 2661959 0 0.0
.debug_loc 2806733 2806733 0 0.0
.debug_ranges 283424 283424 0 0.0
.debug_str 3027534 3027534 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105993 105993 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 380469 380469 0 0.0
.symtab 257408 257408 0 0.0
.text 537712 537712 0 0.0

@jmartinez-silabs jmartinez-silabs merged commit b388c36 into project-chip:master Mar 22, 2023
@bzbarsky-apple bzbarsky-apple deleted the fix-device-attestation-failsafe-handling branch March 22, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants