You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: wolfBoot/src/chapter02.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,7 +170,7 @@ For more details, see the section [Remote External flash memory support via UART
170
170
171
171
#### Encryption support for external partitions
172
172
173
-
When update and swap partitions are mapped to an external device using `EXT_FLASH=1`, either in combination with `SPI_FLASH`, `UART_FLASH`, or any custom external mapping, it is possible to enable ChaCha20 encryption when accessing those partition from the bootloader. The update images must be pre-encrypted at the source using the key tools, and wolfBoot should be instructed to use a temporary ChaCha20 symmetric key to access the content of the updates.
173
+
When update and swap partitions are mapped to an external device using `EXT_FLASH=1`, either in combination with `SPI_FLASH`, `UART_FLASH`, or any custom external mapping, it is possible to enable ChaCha20, Aes128 or Aes256 encryption when accessing those partition from the bootloader. The update images must be pre-encrypted at the source using the key tools, and wolfBoot should be instructed to use a temporary ChaCha20 symmetric key to access the content of the updates.
174
174
175
175
For more details about this optional feature, please refer to the [Encrypted external partitions](chapter06.md#encrypted-external-partitions) section.
176
176
@@ -221,3 +221,9 @@ LC_ALL=
221
221
222
222
Then run the normal `make` steps.
223
223
224
+
### Enabling mitigations against glitches and fault injections
225
+
226
+
One type of attacks against secure boot mechanisms consists in skipping the execution of authentication and validation steps by injecting faults into the CPU through forced voltage or clock anomalies, or electromagnetic interferences at close range.
227
+
228
+
Extra protection from specific attacks aimed to skip CPU instructions can be enabled using `ARMOR=1`. This feature is currently only available for ARM Cortex-M targets.
Copy file name to clipboardExpand all lines: wolfBoot/src/chapter03.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -869,22 +869,25 @@ the monitor command sequence below:
869
869
870
870
## NXP iMX-RT
871
871
872
-
NXP RT1060/1062 (RT1060-EVK)
872
+
NXP RT1060/1062 and RT1050
873
873
874
874
The NXP iMX-RT1060 is a Cortex-M7 with a DCP coprocessor for SHA256 acceleration.
875
875
Example configuration for this target is provided in `/config/examples/imx-rt1060.config`.
876
876
877
877
### Building wolfBoot
878
878
879
879
MCUXpresso SDK is required by wolfBoot to access device drivers on this platform.
880
-
A package can be obtained from the [MCUXpresso SDK Builder](https://mcuxpresso.nxp.com/en/welcome), by selecting `EVK-MIMXRT1060` as target, and keeping the default choice of components.
880
+
A package can be obtained from the [MCUXpresso SDK Builder](https://mcuxpresso.nxp.com/en/welcome), by selecting a target and keeping the default choice of components.
881
881
882
-
Set the `MCUXPRESSO` configuration variable to the path where the SDK package is extracted, then build wolfBoot normally by running `make`.
882
+
* For the RT1060 use `EVKB-IMXRT1060`. See configuration example in `config/examples/imx-rt1060.config`.
883
+
* For the RT1050 use `EVKB-IMXRT1050`. See configuration example in `config/examples/imx-rt1050.config`.
883
884
884
-
wolfBoot support for iMX-RT1060 has been tested using MCUXpresso SDK version 2.8.2.
885
+
Set the wolfBoot `MCUXPRESSO` configuration variable to the path where the SDK package is extracted, then build wolfBoot normally by running `make`.
886
+
887
+
wolfBoot support for iMX-RT1060/iMX-RT1050 has been tested using MCUXpresso SDK version 2.11.1.
885
888
886
889
DCP support (hardware acceleration for SHA256 operations) can be enabled by using PKA=1 in the configuration file.
887
-
Firmware can be directly uploaded to the target by copying `factory.bin` to the virtual USB drive associated to the device (RT1060-EVK).
890
+
Firmware can be directly uploaded to the target by copying `factory.bin` to the virtual USB drive associated to the device.
Copy file name to clipboardExpand all lines: wolfBoot/src/chapter06.md
+50-4Lines changed: 50 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -418,16 +418,24 @@ can be used to set a temporary encryption key for the external partition, or era
418
418
419
419
Moreover, using `libwolfboot` to access the external flash with wolfboot hal from the application will not use encryption. This way the received update, already encrypted at origin, can be stored in the external memory unchanged, and retrieved in its encrypted format, e.g. to verify that the transfer has been successful before reboot.
420
420
421
-
### Symmetric encryption algorithm
421
+
### Symmetric encryption algorithms
422
422
423
-
The algorithm currently used to encrypt and decrypt data in external partitions is Chacha20-256.
423
+
Encryption can be enabled in wolfBoot using `ENCRYPT=1`.
424
+
425
+
The default algorithm used to encrypt and decrypt data in external partitions is Chacha20-256.
426
+
AES-128 and AES-256 options are also available and can be selected using `ENCRYPT_WITH_AES128=1` or `ENCRYPT_WITH_AES256=1`
427
+
428
+
### Chacha20-256
429
+
430
+
431
+
When ChaCha20 is selected:
424
432
425
433
- The `key` provided to `wolfBoot_set_encrypt_key()` must be exactly 32 Bytes long.
426
434
- The `nonce` argument must be a 96-bit (12 Bytes) randomly generated buffer, to be used as IV for encryption and decryption.
427
435
428
-
### Example usage
429
436
430
-
#### Signing and encrypting the update bundle
437
+
#### Example usage with ChaCha20-256
438
+
431
439
432
440
The `sign.py` tool can sign and encrypt the image with a single command. The encryption secret is provided in a binary file that should contain a concatenation of a 32B ChaCha-256 key and a 12B nonce.
433
441
@@ -453,6 +461,44 @@ secret file:
453
461
454
462
which will produce as output the file `test-app/image_v24_signed_and_encrypted.bin`, that can be transferred to the target's external device.
455
463
464
+
### AES-CTR
465
+
466
+
467
+
AES is used in CTR mode. When AES is selected:
468
+
- The `key` provided to `wolfBoot_set_encrypt_key()` must be 16 Bytes (AES128) or 32 Bytes (AES256) long.
469
+
- The `nonce` argument is a 128-bit (16 Byyes) randomly generated buffer, used as initial counter for encryption and decryption.
470
+
471
+
472
+
#### Example usage with AES-256
473
+
474
+
475
+
In case of AES-256, the encryption secret is provided in a binary file that should contain a concatenation of
476
+
a 32B key and a 16B IV.
477
+
478
+
In the examples provided, the test application uses the following parameters:
479
+
480
+
```
481
+
key = "0123456789abcdef0123456789abcdef"
482
+
iv = "0123456789abcdef"
483
+
```
484
+
485
+
So it is easy to prepare the encryption secret in the test scripts or from the command line using:
0 commit comments