Commit Graph

1087 Commits (0fd34f23c744a5944e22f816f04158c1d851d4be)

Author SHA1 Message Date
Daniele Lacamera 46ea4923d1 Build tests: change ubuntu repository 2023-05-15 14:57:27 +02:00
Daniele Lacamera 048af83858 New partition sizes in tests 2023-05-15 13:38:57 +02:00
Daniele Lacamera 39d8eedc61 Added sim-encrypt tests to github workflow 2023-05-15 11:54:37 +02:00
Daniele Lacamera bc5831747c Added extra clean round at the end of the powerfail test 2023-05-15 11:42:22 +02:00
Daniele Lacamera 588b3192d2 New simulator tests
- internal flash now mapped at 0xC0000000 (using `ARCH_FLASH_OFFSET`)
- wolfBoot binary included in internal flash (wolfboot partition is also
  now writeable to test self-updates and encryption)
- sim test app supports encryption (sets the key for test)
- added new target to store the update in the external flash
- external flash mapped to 0xD0000000
2023-05-15 11:13:38 +02:00
billphipps 106b78086a
Merge pull request #302 from dgarske/nxp_tpm
Support for NXP P1021 eSPI and TPM (and fixes for eLBC NAND)
2023-05-10 20:17:27 -04:00
David Garske 08e6a37ad7 Fix to use correct boot ROM entry in stage1 linker script. 2023-05-10 17:01:31 -07:00
David Garske 4e93027cb9 Fix execute bit 2023-05-10 16:55:01 -07:00
David Garske a5bb56599c Fix PIC for PowerPC. Must put `got2` into the flash region. 2023-05-10 16:52:24 -07:00
David Garske 28ee143a1b Update the new `spi_xfer` to include a "continue" flag to allow leaving the CS asserted. 2023-05-10 15:26:57 -07:00
David Garske 6f24981f03 Improvements to the clock calculation code (dynamic based on ratio). Remove execute bits on files. Make stage1 PIC. Disable L1/L2 for first stage. Add PLT/GOT to .data region. 2023-05-10 15:11:09 -07:00
David Garske 89b2303b87 Fix NXP T2080 build. 2023-05-09 09:49:51 -07:00
David Garske c2fbcecda1 Reduce first stage init code (don't relocate CCSRBAR or invalidate all TLB's). Improve udelay to use timebase. Fix L1 cache line sizes. Fix L2ADDR to enable all 256KB. Use `do_boot` not the jump to function pointer. Switch PPC test app linker script to use `WOLFBOOT_LOAD_ADDRESS`. 2023-05-08 17:42:14 -07:00
David Garske bd8d45e40f
Merge pull request #304 from jpbland1/preseal-compiled
add ability to compile preseal with no filesystem
2023-05-08 15:07:40 -07:00
John Bland f4cca4a367 add ability to compile preseal with no filesystem
fix a key not being unloaded, normaly doesn't crop up since in normal circumstances wolfBoot and the TPM both turn on fresh but on the simulator not freeing the key caseus a leak
2023-05-08 12:45:42 -04:00
David Garske 0b7603f7bf
Merge pull request #303 from jpbland1/preseal
add script for preseal a public key to tpm
2023-05-05 15:02:55 -07:00
John Bland bf3ebee8bb use correct digest when getting unsealing the pubkey
add deinit call when wolfboot exits so the TPM doesn't have a hanging session
2023-05-05 16:27:22 -04:00
David Garske 790a63809f Update P1021 test-app to use shared HAL for UART. 2023-05-05 12:49:06 -07: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 c8a28005ac Disable XIP support. This enables `PART_BOOT_EXT` to correctly load the boot partition from external flash. 2023-05-05 10:43:10 -07:00
David Garske 23061c041c Add TPM test (`RX: 0x1141105`). 2023-05-05 09:50:40 -07:00
John Bland a654eb057e fix hex formating and clarify where to run preseal command 2023-05-04 23:12:49 -04:00
John Bland fa071065f6 update preseal based on pr comments 2023-05-04 22:58:20 -04:00
John Bland cbf3cffa96 add script for preseal a public key to tpm
add more detailed instructions on how to prepare a TPM keystore build and how to use the preseal script
2023-05-04 20:49:02 -04:00
David Garske 0f110e4cd9 Progress on eSPI support for NXP P1021 TPM. 2023-05-04 15:23:45 -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
John Bland fe2b797b01 get wolfboot simulator working with the tpm simulator
move pcr reset and extend outside of session

the tpm uses policy checking for modifying PCR's so we need to reset and extend the PCR's with the image hash before the session begins, currently tested unseal, having trouble getting the simulator to run update in order to test reseal
2023-05-03 11:39:25 -04:00
John Bland eb30566bba add encryption key unsealing from the tpm
make the config/examples/stm32f4-tpm-keystore.config config use ecc256
2023-04-24 13:23:09 -04:00
John Bland b94249f8f7 correctly identify a forward powerfail vs a revert
powerfail and add an exception to wolfBoot_delta_update when a revert gets
interrupted since the version will change in the middle of the update process
2023-04-22 06:13:53 +02:00
John Bland 14ec346e1c before calling wolfBoot_delta_update, check if the
0th sector has been changed with the update partition still being in
IMG_STATE_UPDATING state. the state still being IMG_STATE_UPDATING means that a
delta update started and that the version may have been switched over, in which
case wolfBoot_current_firmware_version() >= wolfBoot_update_firmware_version()
no longer tells us if we need to perform an inverse operation on it's own.

also removes part of the update powerfail test that does checks for the
previous version without triggering a rollback
2023-04-21 20:31:58 +02:00
David Garske 3b90e32356 Switch to small page size by default. Capture read_id return code. Add SPMATHALL to config.mk. 2023-04-21 16:41:00 +02:00
David Garske 69ca95eb94 Adds `factory_wstage1.bin` option to include first stage loader. Fix test-app verbose issue. 2023-04-21 16:41:00 +02:00
David Garske 553ec760fd NXP QorIQ refactor for shared PPC (e500 / e6500) registers
* Fixes for e500 L1/L2 cache.
* Fixes for eLBC and DDR3 drivers on P1021.
* Fixes for LAW and TLB for P1021.
* Fix for the e500v2 core peripheral issues with data barrier / coherency safety.
* Support for SP math all (`SPMATHALL=1`).
* Support for stage 1 loader (`make stage1`).
2023-04-21 16:41:00 +02:00
John Bland 371ff3bb9e add documentation for using --policy-signed 2023-04-18 17:29:27 -04:00
John Bland 9648f527a2 update tpm seal and unseal code to use new seal
arguments and reset out the PCR values so they're not impacted by previous calls
2023-04-17 18:15:40 -04:00
John Bland 79e2f43b68 add TPM pubkey sealing doc and update code based on pr comments 2023-04-14 01:55:14 -04:00
David Garske 5e9e33d136
Merge pull request #298 from danielinux/fix-duplicate-test
Removed duplicate test entry in test.mk
2023-04-13 12:24:25 -07:00
Daniele Lacamera 27df34264c Removed duplicate test entry in test.mk 2023-04-13 21:01:21 +02:00
David Garske d7711a42b6
Merge pull request #297 from danielinux/fix_get_trailer_nvm
Fix bug in get_trailer_at()
2023-04-13 11:00:29 -07:00
Daniele Lacamera 48496c3568 Fix bug in get_trailer_at() 2023-04-13 19:17:21 +02:00
David Garske f008ebf606
Merge pull request #293 from danielinux/update-submodules-5.6.0
Prepare release 1.15
2023-04-13 09:05:36 -07:00
Daniele Lacamera 65635b3940 Updated version & README.md 2023-04-13 17:34:26 +02:00
Daniele Lacamera 769cbb8b1e Updated submodule to wolfSSL latest tag 2023-04-13 17:14:44 +02:00
Daniele Lacamera 3ecf85efec Updated submodules to latest version 2023-04-13 17:13:14 +02:00
John Bland f71108442c switch wolftpmPcrArray to uint8_t and return negative versions of tpm errors 2023-04-12 23:49:58 -04:00
John Bland 1e93b3d042 add policy signed header to sign.c 2023-04-12 13:36:03 -04:00
John Bland 7dd97be63c update policy sealing logic based on pr comments 2023-04-12 11:20:46 -04:00
Hideki Miyazaki 6b79068c6b initial created for RA6M4 2023-04-12 07:02:16 +02:00
John Bland 76fb8feac2 add missing error check unseal call 2023-04-11 12:26:42 -04: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