Use the node's admin password for the migration bridge AP

The Wi-Fi, LoRa first-stage and Partition Expander bridges serve an
unauthenticated /update behind an AP whose password was fixed and published,
so anyone in range during a migration could upload firmware while the private
key is staged. Use the old node's saved admin password as the WPA2
passphrase, read from /com_prefs or /node_prefs at offset 56 as the firmware
loads it. The operator already used that password to start the old updater.

Fall back to the published password, with a serial warning, when the saved
admin password is missing, unreadable, shorter than 8 characters or not
printable ASCII, so no node becomes unreachable. The legacy filesystem is
mounted without formatting and the password is never printed. Migration
admission, flash sequencing, /update gating and the USB bridge are unchanged.
Update both guides and the package README.

Add a sanitizer-backed host test that compiles the bridge's actual Wi-Fi
block against fake SPIFFS and WiFi: both boots, file precedence, WPA2 length
and terminator bounds, printable characters, stock 1.10/1.11 file sizes,
truncated fields, and mount, seek and partial-read failures. It fails 8 of 8
on the previous code and catches 27 of 27 code mutations. Verified 13 related
host test files and the esp32_s3_4mb_partition_migrator build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nullrouten0andClaude Opus 5.5 committed 2026-10-18 03:57:09 +00:00
1 parent 0e72474f41
commit 09435b049d
6 files changed
+444 -10

No files matched your search

+13 -2
View File
@@ -284,11 +284,22 @@ Use `--board xiao-s3-wio` with the recipe above. Its Wi-Fi bridge is a
legacy-slot application image; its Full image keeps the old repeater's exact
LoRa OTA target ID. Upload `wifi-bridge.bin` from the ZIP through the legacy
node's existing Wi-Fi browser updater.
Then join `MeshCore-Migrate` (password `meshcore-migrate`) and wait for
**Expanded layout ready**. Upload `full-application.bin` at `/update`.
Then join `MeshCore-Migrate` and wait for **Expanded layout ready**. Its Wi-Fi
password is the admin password saved on the old node, so only someone who can
already administer the node can join and upload firmware. Upload
`full-application.bin` at `/update`.
Do not upload an `-merged.bin`: merged images include
bootloader and table offsets for cable flashing, not browser OTA.
WPA2 needs a password of at least 8 printable ASCII characters. If the saved
admin password is shorter, uses other characters, or was never saved (the node
still runs on its built-in default), the bridge falls back to
`meshcore-migrate`. That password is published here, so anyone nearby could
then join and upload firmware. Before uploading the bridge, set an admin
password of 8 to 15 characters with `password <new password>`. A LoRa
first-stage bridge does not carry saved settings into the expanded layout, so
its Wi-Fi recovery page after the table change normally uses the fallback.
`xiao_s3_partition_legacy_seed` is a disposable-hardware test image only. It
models the legacy table and an identity file; it is not a deployable repeater.
+4 -3
View File
@@ -19,9 +19,10 @@ python3 -B scripts/build_esp32_partition_migration.py \
The ZIP contains the Wi-Fi bridge, LoRa bridge, and exact-target Full image.
Upload its `wifi-bridge.bin` through the
legacy browser Wi-Fi updater. Rejoin `MeshCore-Migrate` with password
`meshcore-migrate`; when it reports **Expanded layout ready**, upload the
ZIP's `full-application.bin` at `/update`.
legacy browser Wi-Fi updater. Rejoin `MeshCore-Migrate` using the node's saved
admin password as the Wi-Fi password (see the shared guide for the published
fallback); when it reports **Expanded layout ready**, upload the ZIP's
`full-application.bin` at `/update`.
Do not use an `-merged.bin` in either browser uploader. Merged images contain
bootloader and table offsets for cable flashing. The bridge preserves the