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: docs/Targets.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -884,7 +884,7 @@ The example configuration for this scenario is available in [/config/examples/st
884
884
885
885
For a full list of all the option bytes tested with this configuration, refer to [STM32-TZ.md](/docs/STM32-TZ.md).
886
886
887
-
### Scenario 2: Trustzone Enabled, wolfCrypt as secure engine for NS applications
887
+
### Scenario 2: TrustZone Enabled, wolfCrypt as secure engine for NS applications
888
888
889
889
This is similar to Scenario 1, but also includes wolfCrypt in secure mode, and
890
890
that can be accessed via PKCS11 interface by non-secure applications.
@@ -893,15 +893,17 @@ This option can be enabled with the `WOLFCRYPT_TZ=1` and `WOLFCRYPT_TZ_PKCS11=1`
893
893
options in your configuration. This enables a PKCS11 accessible from NS domain via
894
894
non-secure callables (NSC).
895
895
896
-
The example configuration for this scenario is available in [/config/examples/stm32h5-wolfcrypt-tz.config](/config/examples/stm32h5-wolfcrypt-tz.config).
896
+
The example configuration for this scenario is available in [/config/examples/stm32h5-tz.config](/config/examples/stm32h5-tz.config).
897
897
898
898
For more information, see [/docs/STM32-TZ.md](/docs/STM32-TZ.md).
Copy file name to clipboardExpand all lines: docs/flash-OTP.md
+137-7Lines changed: 137 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
##Using One-Time Programmable (OTP) flash area for keystore
1
+
# Using One-Time Programmable (OTP) flash area for keystore
2
2
3
3
Some microcontrollers provide a special area in flash memory that can
4
4
only be written once and cannot be erased.
@@ -9,7 +9,7 @@ key is a cryptographic key that can be freely distributed and is used to verify
9
9
of the firmware update image. By storing the public keys in the OTP area, you can ensure that
10
10
they are immutable and cannot be tampered with.
11
11
12
-
###Compiling wolfBoot to access OTP as keystore
12
+
## Compiling wolfBoot to access OTP as keystore
13
13
14
14
To use the OTP area as a keystore, you need to compile wolfBoot with the `FLASH_OTP_KEYSTORE`
15
15
option enabled. This option is disabled by default, which means that the keystore is incorporated into
@@ -24,26 +24,29 @@ must be provisioned to the OTP area in a separate step, as described in the next
24
24
25
25
Depending on the target device, you can either prepare a binary image of the OTP area content, or use `otp-keystore-primer` firmware to directly provision the keys on the target.
26
26
27
-
###Creating an image of the OTP area content
27
+
## Creating an image of the OTP area content
28
28
29
29
It is possible to create a binary image of the content for the OTP area. The resulting file (otp.bin) can be manually provisioned using any external tool that allows writing to the target OTP area.
30
30
31
31
To compile the otp-keystore-gen tool using the current keystore content:
32
32
33
-
```
33
+
```sh
34
34
make otpgen
35
35
```
36
36
37
37
And then, to create the image file `otp.bin`:
38
38
39
-
tools/keytools/otp/otp-keystore-gen
39
+
40
+
```sh
41
+
./tools/keytools/otp/otp-keystore-gen
42
+
```
40
43
41
44
42
-
###Directly provisioning the public keys to the OTP area (primer)
45
+
## Directly provisioning the public keys to the OTP area (primer)
43
46
44
47
After enabling the `FLASH_OTP_KEYSTORE` option in your `.config` file, when you compile wolfBoot by running "make",
45
48
an additional application called `otp-keystore-primer` is generated under `tools/keytools/otp`. This application is used to
46
-
provision the public keys to the OTP area. By flashing this application to the microcontroller, the public keys contained
49
+
provision the public keys to the OTP area. By flashing this application to the microcontroller, the public keys contained
47
50
in your keystore (previously generated by `keygen`) are written to the OTP area.
48
51
49
52
The `otp-keystore-primer` application is generated with the public keys embedded in it. The keys are retrieved from the `keystore.c` file,
@@ -59,3 +62,130 @@ After generating a new `keystore.c` with the `keygen` application, you can gener
59
62
> [!CAUTION]
60
63
> ** Be very careful when using the `otp-keystore-primer` application. Use it at your own risk. **
61
64
65
+
66
+
## Examples
67
+
68
+
### STM32H5 OTP KeyStore
69
+
70
+
Example for NULCLEO-STM32H563ZI with TrustZone (via PKCS11), DualBank and signing with PQ LMS:
0 commit comments