Skip to content

Commit 7bfded6

Browse files
authored
User can choose if calc MD5 from decrypted file
At the present moment, if user want use OTA, the function calculate MD5 of the decrypted file, but if file is encrypted from source, could be more useful to know the MD5 of the encrypted file.
1 parent bcc357c commit 7bfded6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

libraries/Update/src/Update.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ class UpdateClass {
137137

138138
/*
139139
sets the expected MD5 for the firmware (hexString)
140+
calc_post_decryption if true che update library calc MD5 after decryption, if false the calc is before decryption
140141
*/
141-
bool setMD5(const char *expected_md5);
142+
bool setMD5(const char *expected_md5, bool calc_post_decryption);
142143

143144
/*
144145
returns the MD5 String of the successfully ended firmware
@@ -256,8 +257,9 @@ class UpdateClass {
256257
uint32_t _command;
257258
const esp_partition_t *_partition;
258259

259-
String _target_md5;
260-
MD5Builder _md5;
260+
String _target_md5;
261+
bool _target_md5_decrypted=true;
262+
MD5Builder _md5;
261263

262264
int _ledPin;
263265
uint8_t _ledOn;

0 commit comments

Comments
 (0)