wolfBoot
wolfBoot copied to clipboard
Refactoring of pkcs11_store.c module
- [x] add unit tests for
pkcs11_store.c - [x] defects detected by unit tests are fixed
- [x] refactoring with a new powerfail-safe design
This new design uses two sectors at the beginning of the keyvault partition. The first sector contains the allocation tables for the nodes in flash, including a bitmap to keep track of the free slots. The second sector is a pre-commit 'backup' sector, used to update the content of the vault in two steps. This guarantees powerfail protection.
All hal_flash_erase / hal_flash_write operations are now on entire sectors. Sector content is cached to memory, then written to the backup sector, then committed to the actual destination sector.
Awaiting feedback (zd18366)
Ready to review