Skip to content

Commit 7242b34

Browse files
committed
docs: secure-boot: Describe the HSM wrapper API
Describe the HSM wrapper instead of the OpenSSL replacement option.
1 parent 6c283ed commit 7242b34

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

docs/secure-boot.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,24 @@ to the path of the public key file in PEM format.
157157

158158

159159
#### Hardware security modules
160-
`rpi-eeprom-digest` is a shell script that wraps a call to `openssl dgst -sign`.
161-
If the private key is stored within a hardware security module instead of
162-
a .PEM file the `openssl` command will need to be replaced with the appropriate call to the HSM.
160+
`rpi-eeprom-digest` supports delegating the RSA signing operation to an external **HSM wrapper** script via the `-H` argument, instead of reading a private key from a `.PEM` file with `-k`.
161+
The wrapper script is responsible for performing an `rsa2048-sha256` PKCS#1 v1.5 signature using a key that is internal to the HSM (or otherwise not stored on disk) and printing the raw signature bytes as a hex string on stdout.
162+
The wrapper is invoked as:
163163

164-
`rpi-eeprom-digest` is called by `update-pieeprom.sh` to sign the EEPROM config file.
164+
```bash
165+
rpi-eeprom-digest -H hsm-wrapper -i bootconf.txt -o bootconf.sig
166+
```
167+
168+
where `hsm-wrapper` is a program that implements the interface:
169+
170+
```bash
171+
hsm-wrapper -a rsa2048-sha256 INPUT_FILE
172+
```
173+
174+
and writes the signature in hexadecimal format to stdout.
175+
This encapsulates the private key handling inside the HSM wrapper while keeping the `rpi-eeprom-digest` and `rpi-sign-bootcode` command-line interfaces unchanged.
176+
177+
`rpi-eeprom-digest` is called by `update-pieeprom.sh` to sign the EEPROM config file, and the same HSM wrapper mechanism can be used there to keep the private key entirely within the HSM or wrapper.
165178

166179
The RSA public key must be stored within the EEPROM so that it can be used by the bootloader.
167180
By default, the RSA public key is automatically extracted from the private key PEM file. Alternatively,

0 commit comments

Comments
 (0)