Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gzip+signed OTA error #7577

Merged
merged 3 commits into from
Sep 4, 2020
Merged

Conversation

earlephilhower
Copy link
Collaborator

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

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
@earlephilhower
Copy link
Collaborator Author

Looks like the release version of Platform.IO is busted. It crashes building the first file in the repo (unrelated to this change) on GitHub and on TravisCI.

@earlephilhower earlephilhower merged commit 2171a2e into esp8266:master Sep 4, 2020
@earlephilhower earlephilhower deleted the gzsign branch September 4, 2020 15:57
Jason2866 added a commit to Jason2866/Arduino that referenced this pull request Sep 4, 2020
davisonja added a commit to davisonja/Arduino that referenced this pull request Sep 10, 2020
* master: (299 commits)
  Fix error message typo (esp8266#7581)
  Update certs-from-mozilla.py (esp8266#7578)
  Update DigestAuthorization.ino (Simple example update) (esp8266#7579)
  Fix gzip+signed OTA error (esp8266#7577)
  Properly replace toolchain in PlatformIO CI script (esp8266#7580)
  Update certs-from-mozilla.py (esp8266#7573)
  Fixup weird combination of oneline/multi line comments (esp8266#7566)
  Reduce codesize of setOutputPower (esp8266#7572)
  Fix typos in tests
  Force gcc inlining, use same style for getCycleCount as for getCpuFreqMHz.
  Even more concise #if form.
  Inline, fewer LOC, remove redundant definition in cpp.
  Netump Initial commit (esp8266#7527)
  Delete owner field (esp8266#7563)
  Avoid float-double-conversion (esp8266#7559)
  Use direct member initialization instead of ctr initialisation (esp8266#7556)
  Add CI test for eboot build (esp8266#7546)
  getCpuFreqMHz(): fix when F_CPU is not defined (esp8266#7554)
  emulation-on-host makefile update, allowing to pass more options (esp8266#7552)
  add sdk options to "generic esp8285 module" (esp8266#7550)
  ...
Jason2866 added a commit to Jason2866/Arduino that referenced this pull request Sep 17, 2020
krc-soft added a commit to krc-soft/Esp8266Arduino that referenced this pull request Mar 7, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

httpUpdateSigned don't work if used gzipped firmware
1 participant