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

properly unlock flash on re-entry of wolfBoot_swap_and_final_erase #526

Merged
merged 8 commits into from
Dec 17, 2024

Conversation

jpbland1
Copy link
Contributor

@jpbland1 jpbland1 commented Dec 7, 2024

and move it out of the lock logic of update and delta update

and move it out of the lock logic of update and delta update
@jpbland1 jpbland1 force-pushed the reentrant-flash-lock branch from 1dfa519 to bbdf14e Compare December 7, 2024 01:26
add hal_flash_unlock after setting the key since setting the key locks flash
@jpbland1
Copy link
Contributor Author

jpbland1 commented Dec 9, 2024

added hal and ext flash locks to the simulator, fixed test failures caused by flash being accessed while locked. @danielinux any idea why the unit test is failing? is it because I added the locks to hal/sim.c and it's not aware of them?

@dgarske dgarske assigned jpbland1 and unassigned danielinux, dgarske and jpbland1 Dec 9, 2024
@dgarske dgarske removed their request for review December 9, 2024 20:57
@danielinux danielinux removed their request for review December 16, 2024 18:15
@danielinux
Copy link
Member

danielinux commented Dec 16, 2024

The hal_flash_lock/unlock functions are mocked and checked, it seems that the unit test is dectecting a double lock hal_flash_write() attempt and the flash has not been unlocked first.

@jpbland1
Copy link
Contributor Author

I figured out the issue, it was only unlocking flash when encryption was on, I think it was a copy and paste issue. should be good to go now

Copy link
Member

@danielinux danielinux left a comment

Choose a reason for hiding this comment

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

Looks good. Good idea adding checks for unlock/lock in the simulator as well.

Just a doubt about DISABLE_BACKUP calling wolfBoot_swap_and_final_erase()

src/update_flash.c Outdated Show resolved Hide resolved
@jpbland1 jpbland1 requested a review from danielinux December 17, 2024 13:22
@danielinux danielinux merged commit aa01f6e into wolfSSL:master Dec 17, 2024
103 checks passed
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.

3 participants