Skip to content

Commit ed6dc56

Browse files
karalabetimg236
authored andcommitted
tools: verify HSM signature based on provided public key
If using an HSM, the public key is not derived, rather taken as an input parameter. In that case, however, it can happen that the user specifies a mismatching pubkey. This PR adds a check to make sure the pubkey belongs to the signature before embedding it further.
1 parent e896b5b commit ed6dc56

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/update-pieeprom.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ update_eeprom() {
9494
rpi-eeprom-digest \
9595
-i "${config}" -o "${TMP_CONFIG_SIG}" \
9696
-H "${HSM_WRAPPER}" || die "Failed to sign EEPROM config using HSM"
97+
rpi-eeprom-digest \
98+
-i "${config}" -v "${TMP_CONFIG_SIG}" \
99+
-k "$public_pem_file" || die "Failed to verify EEPROM config signed by HSM"
97100
else
98101
rpi-eeprom-digest \
99102
-i "${config}" -o "${TMP_CONFIG_SIG}" \

0 commit comments

Comments
 (0)