wolfBoot icon indicating copy to clipboard operation
wolfBoot copied to clipboard

Refactoring of pkcs11_store.c module

Open danielinux opened this issue 1 year ago • 1 comments

  • [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.

danielinux avatar Jul 31 '24 14:07 danielinux

Awaiting feedback (zd18366)

danielinux avatar Jul 31 '24 15:07 danielinux

Ready to review

danielinux avatar Sep 05 '24 15:09 danielinux