mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-17 12:02:15 +03:00
Fix gzip+signed OTA error (#7577)
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 #7570
This commit is contained in:
committed by
GitHub
parent
22a197eea1
commit
2171a2e852
@ -282,6 +282,8 @@ bool UpdaterClass::end(bool evenIfRemaining){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
free(sig);
|
free(sig);
|
||||||
|
_size = binSize; // Adjust size to remove signature, not part of bin payload
|
||||||
|
|
||||||
#ifdef DEBUG_UPDATER
|
#ifdef DEBUG_UPDATER
|
||||||
DEBUG_UPDATER.printf_P(PSTR("[Updater] Signature matches\n"));
|
DEBUG_UPDATER.printf_P(PSTR("[Updater] Signature matches\n"));
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user