Skip to content

Commit

Permalink
Fix gzip+signed OTA error (esp8266#7577)
Browse files Browse the repository at this point in the history
The last 4 bytes of a GZIP file is the decompressed file length, and
are used in eboot to do sanity checks and know when decompression is
done.

Updater was incorrectly telling eboot to look at
"end-of-bin + sizeof(signing)", and when eboot did so it got an
incorrect value causing either the update to be skipped or for only a
portion of update to be completed.

Fix by adjusting the size back to the end of binary.
Fixes esp8266#7570
  • Loading branch information
earlephilhower committed Sep 4, 2020
1 parent 22a197e commit 2171a2e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cores/esp8266/Updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ bool UpdaterClass::end(bool evenIfRemaining){
return false;
}
free(sig);
_size = binSize; // Adjust size to remove signature, not part of bin payload

#ifdef DEBUG_UPDATER
DEBUG_UPDATER.printf_P(PSTR("[Updater] Signature matches\n"));
#endif
Expand Down

0 comments on commit 2171a2e

Please sign in to comment.