Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ name: Firmware
|
||||
# "patrol-a|<tag>|<sha256>"). This is what `ota install`
|
||||
# on the controller pulls.
|
||||
#
|
||||
# Signing key: repo secret FIRMWARE_SIGNING_KEY (PEM, EC P-256). Its public
|
||||
# Signing key: repo secret BMW_NISSAN_FIRMWARE_SIGNING_KEY (PEM, EC P-256). Its public
|
||||
# half is compiled into the firmware (include/config/ota_config.h) and kept in
|
||||
# tools/ota/firmware_signing_pub.pem, which this job uses to self-check the
|
||||
# signature before publishing. See wiki/pages/ota-updates.md.
|
||||
@@ -74,15 +74,15 @@ jobs:
|
||||
- name: Sign + manifest (tags only)
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
FIRMWARE_SIGNING_KEY: ${{ secrets.FIRMWARE_SIGNING_KEY }}
|
||||
BMW_NISSAN_FIRMWARE_SIGNING_KEY: ${{ secrets.BMW_NISSAN_FIRMWARE_SIGNING_KEY }}
|
||||
run: |
|
||||
set -e
|
||||
[ -n "$FIRMWARE_SIGNING_KEY" ] || { echo "::error::secret FIRMWARE_SIGNING_KEY is not set"; exit 1; }
|
||||
[ -n "$BMW_NISSAN_FIRMWARE_SIGNING_KEY" ] || { echo "::error::secret BMW_NISSAN_FIRMWARE_SIGNING_KEY is not set"; exit 1; }
|
||||
SHA=$(sha256sum dist/firmware.bin | cut -d' ' -f1)
|
||||
SIZE=$(stat -c%s dist/firmware.bin)
|
||||
printf '%s' "patrol-a|${VERSION}|${SHA}" > stmt.txt
|
||||
umask 077
|
||||
printf '%s\n' "$FIRMWARE_SIGNING_KEY" > key.pem
|
||||
printf '%s\n' "$BMW_NISSAN_FIRMWARE_SIGNING_KEY" > key.pem
|
||||
openssl dgst -sha256 -sign key.pem -out sig.der stmt.txt
|
||||
rm -f key.pem
|
||||
# Self-check against the public key the firmware carries.
|
||||
|
||||
Reference in New Issue
Block a user