Skip to content

Commit b102cb6

Browse files
committed
fix(ota): Magic byte check fails with encrypted firmware
1 parent 1d895e5 commit b102cb6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: libraries/Update/src/Updater.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,11 @@ size_t UpdateClass::writeStream(Stream &data) {
524524
return 0;
525525
}
526526

527-
if (!_verifyHeader(data.peek())) {
528-
_reset();
529-
return 0;
527+
if (_command == U_FLASH && !_cryptMode) {
528+
if (!_verifyHeader(data.peek())) {
529+
_reset();
530+
return 0;
531+
}
530532
}
531533

532534
if (_ledPin != -1) {

0 commit comments

Comments
 (0)