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/encrypted_partitions.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,36 @@ To compile wolfBoot with encryption support, use the option `ENCRYPT=1`.
73
73
By default, this also selects `ENCRYPT_WITH_CHACHA=1`. To use AES encryption instead,
74
74
select `ENCRYPT_WITH_AES128=1` or `ENCRYPT_WITH_AES256=1`.
75
75
76
+
### PKCS#11 backend
77
+
78
+
On ARM TrustZone configurations with `WOLFCRYPT_TZ_PKCS11` enabled, it is
79
+
possible to use the keyvault provided by wolfBoot to store the encryption key.
80
+
To enable this, use the configuration option `ENCRYPT_PKCS11=1` alongside
81
+
`WOLFCRYPT_TZ=1`, `WOLFCRYPT_TZ_PKCS11=1` and `ENCRYPT=1`, and set
82
+
`ENCRYPT_PKCS11_PIN` to the user PIN for the PKCS#11 vault. This should be set
83
+
in the form of a C string literal, for example
84
+
`ENCRYPT_PKCS11_PIN="\x01\x02\x03\x04"`, and the ending null byte will be
85
+
ignored.
86
+
87
+
When this is enabled, instead of providing the key to wolfBoot via
88
+
`wolfBoot_set_encrypt_key`, the application should use the PKCS#11 API to store
89
+
it in the keyvault with an appropriate ID (via the `CKA_ID` attribute). This ID
90
+
should then be used as the `key` parameter (in place of the key) when calling
91
+
`wolfBoot_set_encrypt_key`.
92
+
93
+
The following configuration options are also available:
94
+
95
+
-`ENCRYPT_PKCS11_KEY_ID_SIZE` (default `4`): this is the size, in bytes, of
96
+
the key ID.
97
+
-`ENCRYPT_PKCS11_MECHANISM` (default `0x00001086UL`, i.e. AES-CTR): this is
98
+
the numeric ID of the PKCS#11 mechanism to be used for encryption. Currently
99
+
only AES-CTR is supported. The list of IDs can be found in the [appendix of
100
+
the PKCS#11 mechanism specification](https://docs.oasis-open.org/pkcs11/pkcs11-curr/v2.40/cs01/pkcs11-curr-v2.40-cs01.html#_Toc228894920),
101
+
while the list of IDs supported by wolfPKCS11 is set in the [pkcs11.h](https://github.com/wolfSSL/wolfPKCS11/blob/master/wolfpkcs11/pkcs11.h)
102
+
header file.
103
+
-`ENCRYPT_PKCS11_BLOCK_SIZE` (default `16`, for AES-CTR) and
104
+
`ENCRYPT_PKCS11_NONCE_SIZE` (default `16`, for AES-CTR) should be set in case
105
+
you set `ENCRYPT_PKCS11_MECHANISM` to something other than the default.
76
106
77
107
### Signing and encrypting the update bundle with ChaCha20-256
0 commit comments