Skip to content
This repository was archived by the owner on Jul 6, 2024. It is now read-only.

Commit 9a3e293

Browse files
committed
Check hash of firmware
1 parent ce8b5d4 commit 9a3e293

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/AsyncElegantOTA.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ class AsyncElegantOtaClass{
9191
}
9292

9393
if (!index) {
94+
if(request->hasParam("MD5", true)) {
95+
return request->send(400, "text/plain", "MD5 parameter missing");
96+
}
97+
98+
const String sentMd5 = request->getParam("MD5", true)->value();
99+
if(!Update.setMD5(sentMd5.c_str())) {
100+
return request->send(400, "text/plain", "MD5 parameter invalid");
101+
}
102+
94103
#if defined(ESP8266)
95104
int cmd = (filename == "filesystem") ? U_FS : U_FLASH;
96105
Update.runAsync(true);

src/elegantWebpage.h

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)