Repository navigation
Conversation
This commit introduces WOLFBOOT_PAGE_SIZE as the smallest possible erase unit. Together with FLASHBUFFER_SIZE, this lowers the amount of ram needed for key/trailer manipulation This is more a conversation starter than anything else. I don't know if sector/page size is a universal concept. I imagine page size could also be smaller than key size, so that would be problematic
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The changes can write before ENCRYPT_CACHE when trailer data does not fit and lose encryption keys on write-once flash because page-based placement conflicts with sector-based key selection and readers.
3 open issues
What changed in this PR
This PR introduces page-sized flash operations for encryption-key and trailer-magic updates, as a step toward reducing wolfBoot’s staging RAM requirements.
Changes:
- Adds
WOLFBOOT_PAGE_SIZE, defaulting toWOLFBOOT_SECTOR_SIZE. - Uses page-sized alignment, copying, erasing, and writing in
hal_set_key(). - Changes write-once redundant-copy offsets to use page size.
| File | Description |
|---|---|
src/libwolfboot.c |
Adds the page-size fallback and applies page sizing to encryption-key updates. |
Review effort: Balanced
Comment on lines
+2751
to
+2752
| addr_align = addr & (~(WOLFBOOT_PAGE_SIZE - 1)); | ||
| addr_off = addr & (WOLFBOOT_PAGE_SIZE - 1); |
Comment on lines
+2765
to
+2766
| addr_align = addr & (~(WOLFBOOT_PAGE_SIZE - 1)); | ||
| addr_align -= (!sel_sec * WOLFBOOT_PAGE_SIZE); |
Comment on lines
+168
to
+170
| #ifndef WOLFBOOT_PAGE_SIZE | ||
| #define WOLFBOOT_PAGE_SIZE WOLFBOOT_SECTOR_SIZE | ||
| #endif |
Member
|
Hi @vhdirk thanks for this pull request. I do not see you on our contributor agreement list. To get setup please send an email to support at wolfssl dot com and reference this pull request and include details about your project and location. Are you planning any additional contributions? Thanks, David Garske, wolfSSL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


This commit introduces
WOLFBOOT_PAGE_SIZEas the smallest possible erase unit.Together with
FLASHBUFFER_SIZE, this lowers the amount of ram needed for key/trailer manipulationThis is more a conversation starter than anything else. I don't know if sector/page size is a universal concept. I imagine page size could also be smaller than key size, so that would be problematic