Commit Graph

90 Commits (51fe05cf9c41f18ec6be46ca664d17b45aacaba3)

Author SHA1 Message Date
Daniele Lacamera 421bd83913 Update wolfBoot version to 2.2.0 2024-07-22 16:29:12 +02:00
John Bland 6c3940fafc refactor final step of powerfail safe update and add
emergency fallback test
2024-07-10 16:58:23 -04:00
Daniele Lacamera 9b61f8923b Fixed update + write to the right bank 2024-07-09 10:22:42 -07:00
Daniele Lacamera 75cd725c9d Fix linker warnings when building with otp 2024-05-24 16:37:25 +02:00
Daniele Lacamera 02bfe8a6a1 Added OTP support for STM32H5 2024-05-15 10:55:47 +02:00
Daniele Lacamera 572e1157bc Added "otp-keystore-primer" tool 2024-05-15 10:55:46 +02:00
David Garske a553dc9943
Merge pull request #436 from danielinux/prepare-release-2.1.0
Release 2.1.0: Updated ChangeLog and version.h
2024-04-16 11:29:03 -07:00
Daniele Lacamera 0581d9920d Updated ChangeLog and version.h 2024-04-16 19:42:54 +02:00
Daniele Lacamera fce6149cf8 Update license GPL2 -> GPL3 2024-04-16 16:46:15 +02:00
David Garske 5ecd2f749d Cleaned up TLV example and simulator output. Moved `wolfBoot_find_header` to the public header. 2024-03-08 12:15:23 -08:00
Daniele Lacamera a314875c79 Added support for SIGN=ECC521 2024-03-01 15:32:33 +01:00
Daniele Lacamera 4564588b69 Preparing release v2.0.2 2023-12-29 11:31:48 +01:00
Daniele Lacamera 10b2b290d3 wolfBoot_get_blob_type: fix return type 2023-11-16 09:21:56 +01:00
Daniele Lacamera da96e4610c Updated version 2023-11-07 16:48:27 +01:00
jordan 79aadb5cc1 XMSS wolfBoot support. 2023-11-06 14:31:05 +01:00
David Garske cd385df8a0
Merge pull request #378 from danielinux/fix_bigendian_constant
Fix prefix typo in Bigendian constant define
2023-10-13 08:08:04 -07:00
John Bland 6c2a37bdea remove complicated key saving process and instead
leave the encryption key for wolfBoot_success to erase.
FINAL_SWAP was also stopping the case where the partition was put into testing before the update sector status flags could be erased. now, don't erase the update sector flags. instead put the update partition in IMG_STATE_FINAL_FLAGS state before putting the boot partition in IMG_STATE_TESTING. Then only erase the update sector flags on wolfBoot_update_trigger. under this scheme, the sector flags are intact if the power failed before we could set IMG_STATE_TESTING but are wiped if we do need to swap over after after wolfBoot_success fails to be called
2023-10-13 14:30:04 +02:00
John Bland 00a9572b94 change the final steps of wolfBoot_update into
repeatable steps so that power failure wont erase the encryption key and wont cause skipping the testing phase of boot. this is done by marking the update partition as final swap when erasing the final sector and backing up the key in boot sector 0 after swaping the real boot sector 0 to swap. then when a power failure occurs the encryption key will be available in either boot sector 0 or the normal location. the intermediate phase also prevents skipping the testing phase since the last sector, which holds the boot state, is erased and then set repeatably, since the final swap state is set on the update partition
2023-10-13 14:30:04 +02:00
Daniele Lacamera 1216835219 Fix prefix typo in Bigendian constant define 2023-10-12 17:41:11 +02:00
Daniele Lacamera 0636e7d882 Added option WOLFBOOT_UNIVERSAL_KEYSTORE
- Allows keys with different algorithms and sizes to be imported/generated
- Skips check for keys matching type/length in keystore
2023-09-28 17:28:32 +02:00
Daniele Lacamera f7d6c17685 TZ: PKCS11 wrappers via wolfPKCS11 in S world 2023-09-21 07:57:18 +02:00
Daniele Lacamera 9d62a7d13d Added ECC PK_CALLBACKS + CRYPTO_CB APIs 2023-09-21 07:57:18 +02:00
Daniele Lacamera 0cc1eea05d Added raw file read from NS-domain
+ fix linker script with the correct NSC address
+ fix ecc key import
2023-09-21 07:57:18 +02:00
Daniele Lacamera 0971d47436 New keyvault slots structure in Secure SRAM
- Example with slots allocated at compile time
- Defining/allocating slots, provisioned as well as empty
- Checks for memory usage
- No free function for slots
2023-09-21 07:57:18 +02:00
Daniele Lacamera 399ee6b594 WCS: Front-end wrappers for ECC sign/verify calls 2023-09-21 07:57:18 +02:00
Daniele Lacamera e2ab9a5553 Unified TZ support for STM32L5/U5
- added file with common code
- added support for TRNG on U5
- added support for wolfcrypt NSC on U5
2023-09-21 07:57:18 +02:00
Daniele Lacamera 426d0346ad Use generic C types for NSC calls
+ cosmetic changes
2023-09-21 07:57:18 +02:00
Daniele Lacamera c7c90cd2cc Back-end calls for ecc sign/verify/getpublic 2023-09-21 07:57:18 +02:00
Daniele Lacamera 9bf80ab8cd Initial draft: wolfcrypt secure mode 2023-09-21 07:57:18 +02:00
David Garske 490286be7d Support for sealing/unseal a secret based on an externally signed PCR policy.
* Added new `WOLFBOOT_TPM_SEAL` and `WOLFBOOT_TPM_SEAL_NV_BASE` config options.
* Added new `tools/tpm/policy_create` tool for assisting with creation of a policy digest. The sign keytool `--policy=file` signs the policy.
* Added new `WOLFBOOT_TPM_VERIFY` option to enable offloading of the asymmetric verification to the TPM. By default wolfCrypt will be used.
* Added example seal/unseal to update_flash for ARCH_SIM.
* Renamed `WOLFBOOT_TPM_KEYSTORE_NV_INDEX` to `WOLFBOOT_TPM_KEYSTORE_NV_BASE` to support multiple public keys.
* Refactored most TPM code into tpm.c.
* Refactored the keystore ROT to use new `wolfBoot_check_rot` API.
* Refactored the sign keytool to have a sign_digest function to allow signing firmware and policy for sealing/unsealing.
* Fix for make distclean && make using the wrong key tools.
2023-09-12 12:26:48 +02:00
jordan e23d450e45 LMS wolfBoot support. 2023-09-06 07:57:10 +02:00
David Garske 9ca58248e4 Adding GitHub Action for testing TPM features. 2023-08-17 13:43:58 +02:00
David Garske b05c7ab980 Measure wolfBoot, not application. Added TPM docs. 2023-08-17 13:43:58 +02:00
David Garske 69adb25496 wolfBoot TPM improvements:
* Added TPM SPI wait state support and debug logging.
* Added platform auth ownership (change platform password to random value before boot). Can be disabled using `WOLFBOOT_TPM_NO_CHG_PLAT_AUTH`.
* Added parameter encryption support.
* Added TPM based root of trust based on https://github.com/wolfSSL/wolfTPM/pull/276
* Removed the TPM hashing feature (not practical).
* Fixed RSA with wolfTPM build.
* Fixed cleanup wolfTPM objects on make clean.
2023-08-17 13:43:58 +02:00
Daniele Lacamera 2600df9a21 Updated bootloader version 2023-07-06 14:17:52 +02:00
David Garske db15f9b0f1 Further NXP P1021 fixes and improvements:
* Added ELF32 and ELF64 loader support (config `ELF=1` or build option `WOLFBOOT_ELF`).
* Add ELF support to `update_ram.c` loader.
* Add support for loading entire flash image to RAM when `EXT_FLASH=1` and `NO_XIP=1` (or `WOLFBOOT_USE_RAMBOOT`).
* Added QUICC Engine support to load microcode and enable.
* Add multiple core support for NXP P1021.
* Fixes to resolve first stage boot ROM relocation.
  - Implemented temporary workaround to resolve stack traps.
* Added PPC GOT relocation support.
* Fix for the PPC `isr_empty` handler address.
* Fix to allow stack to use DDR by having assembly setup DDR TLB. After relocating wolfBoot use stack on DDR.
* Cleanup wolfBoot output.
  - Only remove extra .bin/.elf created unless `make distclean` is used.
  - Don't output the key grep test (only check result).
  - Adjust build order (first stage, wolfboot, test app, key, sign test app and factory).
  - Fix to make sure linker script is rebuilt before objects.

Sample NXP P1021 Output:

```
Relocating BOOT ROM to DDR
Loading wolfBoot to DDR
Jumping to full wolfBoot
wolfBoot HAL Init
Flash Init: Ret 0, ID 0x76207620
QE: Length 63732, Count 1
QE: uploading 'Microcode for P1021 r1.0' version 0.0.1
QE: Traps 0
MP: Starting core 2 (spin table 0xFFFFF240)
Versions: Boot 1, Update 0
Trying Boot partition at 0x200000
Loading header 512 bytes to 0x1DFFFE00
Loading image 3170724 bytes to 0x1E000000
Image size 3170724
Firmware Valid
Loading elf at 0x1E000000
Found valid elf32 (big endian)
Booting at 0x6000
```
2023-07-05 17:03:57 +02:00
Hideki Miyazaki 170bb9a585 Support Renesas RA6M4 with SCE use 2023-05-17 14:15:18 +02:00
David Garske fb20f2d41f Fix the eLBC NAND flash driver issues with page/col selection. Allow override of the `WOLFBOOT_SHA_BLOCK_SIZE`.
```
wolfBoot HAL Init
Flash Init: Ret 0, ID 0x76207620
Part: Active 0, Address 0
Boot partition: 200000
Image size 3964
Firmware Valid
Loading 3964 bytes to RAM at 1E000000
Booting at 1E000000
```
2023-05-05 12:18:16 -07:00
David Garske ef35f473c9
Merge pull request #296 from jpbland1/tpm-root-trust
wolfTPM pubkey storage with policy based access restriction
2023-05-04 15:09:06 -07:00
Daniele Lacamera 65635b3940 Updated version & README.md 2023-04-13 17:34:26 +02:00
John Bland 3fbc99d36e wolfTPM pubkey storage with policy based access restriction
this update uses the tpm to retreive the public key used to validate the image that will boot and restricts access to that key by tpm policy. when the image is updated it's signature is used to extend the PCR and when the image is loaded it's signature must match what was sealed in order to get the public key from the tpm. enabling this option is done by setting WOLFBOOT_TPM_KEYSTORE in .config
2023-04-11 11:46:21 -04:00
Daniele Lacamera 2f2a6d416d Support encrypted images in MMU targets 2023-03-09 16:31:29 +01:00
Daniele Lacamera 3d517cfe8c NVM_FLASH_WRITEONCE refactoring
- Using two sectors to keep partition/sector flags
- Keep two redundant set of flags, update one at a time
- Erase is done when the sector is old
- Flags update is faster because Erase is done in advance
- Accessing trailer information (including encryption keys) is done by
  selecting the newest information

Tested via renode, using nrf52 with NVM_FLASH_WRITEONCE flag on.
2023-01-26 09:22:48 +01:00
Daniele Lacamera f250a5b5d4 Update wolfBoot version 2022-12-30 10:57:05 +01:00
Lealem Amedie 18bfcecd6b wolfBoot cmake support 2022-12-07 13:00:10 -08:00
David Garske 2fc899254f Cleanups for NXP T2080 DEOS support:
* Expanded the NXP QorIQ T2080 documentation in `docs/Targets.md`.
* T2080 fixes for boot code placement and generation of .bin.
* T2080 UART driver cleanup.
* Improve bin-assemble fill speed and report items added.
* Make portability fixes to enable building in `mingw32-make`.
* Cleanup the `docs/Targets.md` sections and links.
* Cleanup execute bits on code files.
2022-12-06 06:20:48 +01:00
Daniele Lacamera f6eeb8dd5d Preparing release v1.12 2022-07-26 09:57:32 +02:00
Daniele Lacamera 93dd53ac0f Fixed support for raspberry-pi 2022-07-21 20:18:34 +02:00
Daniele Lacamera 9605dd283f Fixes for test cases using keystore 2022-07-19 15:33:29 +02:00
Daniele Lacamera 1e11f3081b keygen.c : exporting keystore also in binary format 2022-07-19 15:32:28 +02:00