bitbox-base
bitbox-base copied to clipboard
hsm: add possibility to update HSM firmware from middleware
This commit:
- Adds the
AvailableHSMVersionRedis key:hsm:firmware:version - Adds the
HSMUpdateAvailable()method to the middleware which compares the version of the running HSM firmware and the AvailableHSMVersion Redis key - If a new version is available, the
main()function executes the update via the hsm immediately after the middleware is started - The signed firmware file is assumed to be in
/opt/shift/hsm/firmware-bitboxbase.signed.binwhich is the default value of thehsmFirmwareFileflag - Together with the
updateHSMFirmware, this can be used to force flash firmware from a custom location - If an update is successful, reboot back into the firmware via the
middleware so that the middleware has access to the new
hsmFirmware
@Stadicus We will also need to set the AvailableHSMVersion Redis key on build. I'll leave that to you?
@benma Could you please take another quick look over my changes which address your review?