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/Signing.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,6 +119,14 @@ If none of the following is used, '--sha256' is assumed by default.
119
119
120
120
*`--sha3` Use sha3-384 for digest calculation on binary images and public keys.
121
121
122
+
#### Certificate Chain Options
123
+
124
+
wolfBoot also supports verifying firmware images using certificate chains instead of raw public keys. In this mode of operation, a certificate chain is included in the image manifest header, and the image is signed with the private key corresponding to the leaf certificate identity (signer cert). On boot, wolfBoot verifies the trust of the certificate chain (and therefore the signer cert) against a trusted root CA stored in the wolfHSM server, and if the chain is trusted, verifies the authenticity of the firmware image using the public key from the image signer certificate.
125
+
126
+
To generate an image for use with this mode, pass the `--cert-chain CERT_CHAIN.der` option to the sign tool, where `CERT_CHAIN.der` is a der encoded certificate chain containing one or more certificates in SSL order (leaf/signer cert last). Note that the sign tool still expects a signing private key to be provided as described above, and assumes that the public key of the signer cert in the chain corresponds to the signing private key.
127
+
128
+
Certificate chain verification of images is currently limited to use in conjuction with wolfHSM. See [wolfHSM.md](wolfHSM.md) for more details.
129
+
122
130
#### Target partition id (Multiple partition images, "self-update" feature)
123
131
124
132
If none of the following is used, "--id=1" is assumed by default. On systems
@@ -257,7 +265,7 @@ For a real-life example, see the section below.
Copy file name to clipboardExpand all lines: docs/firmware_update.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -221,3 +221,26 @@ Note: When using scattered ELF images, ensure that:
221
221
222
222
- The ELF file adheres to the ELF file specification and was generated by a toolchain supporting the target architecture
223
223
- All section addresses are within valid executable memory regions and **do not overlap with the wolfBoot image, nor the BOOT, UPDATE and SWAP partitions**.
224
+
225
+
## Certificate Verification
226
+
227
+
wolfBoot supports authenticating images using certificate chains instead of raw public keys. in this mode of operation, a certificate chain is included in the image manifest header, and the image is signed with the private key corresponding to the leaf certificate identity (signer cert). On boot, wolfBoot verifies the trust of the certificate chain (and therefore the signer cert) against a trusted root CA stored in the wolfHSM server, and if the chain is trusted, verifies the authenticity of the firmware image using the public key from the image signer certificate.
228
+
229
+
To use this feature:
230
+
231
+
1. Enable the feature in your wolfBoot configuration by defining `WOLFBOOT_CERT_CHAIN_VERIFY`
232
+
2. When signing firmware, include the certificate chain using the `--cert-chain` option:
1. Extract the certificate chain from the firmware header
241
+
2. Verify the chain using the pre-provisioned root certificate
242
+
3. Use the public key from the leaf certificate to verify the firmware signature
243
+
244
+
This feature is particularly useful in scenarios where you want to rotate signing keys without updating the bootloader, as you can simply resign the image with a new key, create a new certificate chain, then update the certificate chain in the firmware header.
245
+
246
+
Note: Currently, support for certificate verification is limited to use in conjuction with wolfHSM. Fore more information see [wolfHSM.md](wolfHSM.md).
Copy file name to clipboardExpand all lines: docs/wolfHSM.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,34 @@ wolfBoot supports using wolfHSM for the following algorithms:
31
31
32
32
Encrypted images with wolfHSM is not yet supported in wolfBoot. Note that every HAL target may not support all of these algorithms. Consult the platform-specific wolfBoot documentation for details.
33
33
34
+
## Additional Features
35
+
36
+
wolfBoot with wolfHSM also supports the following features:
37
+
38
+
### Certificate Verification
39
+
40
+
wolfBoot with wolfHSM supports certificate chain verification for firmware images. In this mode, instead of using raw public keys for signature verification, wolfBoot verifies firmware images using wolfHSM with a public key embedded in a certificate chain that is included in the image manifest header.
41
+
42
+
The certificate verification process with wolfHSM works as follows:
43
+
44
+
1. A root CA is created serving as the root of trust for the entire PKI system
45
+
2. A signing keypair and corresponding identity certificate is created for signing firmware images
46
+
3. The firmware image is signed with the signing private key
47
+
4. A certificate chain is created consisting of the signing identity certificate and an optional number of intermediate certificates, where trust is chained back to the root CA.
48
+
5. During the signing process, the image is signed with the signer private key and the certificate chain is embedded in the firmware image header.
49
+
6. During boot, wolfBoot extracts the certificate chain from the firmware header
50
+
7. wolfBoot uses the wolfHSM server to verify the certificate chain against a pre-provisioned root CA certificate stored on the HSM and caches the public key of the leaf certificate if the chain verifies as trusted
51
+
8. If the chain is trusted, wolfBoot uses the cached public key from the leaf certificate to verify the firmware signature on the wolfHSM server
52
+
53
+
To use certificate verification with wolfHSM:
54
+
55
+
1. Enable `WOLFBOOT_CERT_CHAIN_VERIFY` in your wolfBoot configuration
56
+
2. Ensure the wolfHSM server is configured with certificate manager support (`WOLFHSM_CFG_CERTIFICATE_MANAGER`)
57
+
3. Pre-provision the root CA certificate on the wolfHSM server at the NVM ID specified by the HAL `hsmClientNvmIdCertRootCA`
58
+
4. Sign firmware images with the `--cert-chain` option, providing a DER-encoded certificate chain
59
+
60
+
To build the simulator using wolfHSM for certificate verification, use [config/examples/sim-wolfHSM-certchain.config](config/examples/sim-wolfHSM-certchain.config).
61
+
34
62
## Configuration Options
35
63
36
64
This section describes the configuration options available for wolfHSM client integration. Note that these options should be configured automatically by the build system for each supported platform when wolfHSM support is enabled. Consult the platform-specific documentation for details on enabling wolfHSM support.
0 commit comments