From 08b00589e1cdb442311cc196c309bf982c441b37 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Thu, 3 Sep 2020 17:10:14 -0700 Subject: [PATCH] Fix gzip+signed OTA error 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 --- cores/esp8266/Updater.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cores/esp8266/Updater.cpp b/cores/esp8266/Updater.cpp index e5224e3814..93149033c7 100644 --- a/cores/esp8266/Updater.cpp +++ b/cores/esp8266/Updater.cpp @@ -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