Skip to content

Commit 1f40aee

Browse files
authored
revert logic to disable
1 parent f92abd1 commit 1f40aee

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Diff for: libraries/Update/src/Update.h

+14-14
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class UpdateClass {
6363
*/
6464
bool begin(size_t size = UPDATE_SIZE_UNKNOWN, int command = U_FLASH, int ledPin = -1, uint8_t ledOn = LOW, const char *label = NULL);
6565

66-
#ifdef UPDATE_CRYPT
66+
#ifndef UPDATE_NOCRYPT
6767
/*
6868
Setup decryption configuration
6969
Crypt Key is 32bytes(256bits) block of data, use the same key as used to encrypt image file
@@ -72,7 +72,7 @@ class UpdateClass {
7272
Crypt Mode, used to select if image files should be decrypted or not
7373
*/
7474
bool setupCrypt(const uint8_t *cryptKey = 0, size_t cryptAddress = 0, uint8_t cryptConfig = 0xf, int cryptMode = U_AES_DECRYPT_AUTO);
75-
#endif /* UPDATE_CRYPT */
75+
#endif /* UPDATE_NOCRYPT */
7676

7777
/*
7878
Writes a buffer to the flash and increments the address
@@ -101,7 +101,7 @@ class UpdateClass {
101101
*/
102102
bool end(bool evenIfRemaining = false);
103103

104-
#ifdef UPDATE_CRYPT
104+
#ifndef UPDATE_NOCRYPT
105105
/*
106106
sets AES256 key(32 bytes) used for decrypting image file
107107
*/
@@ -125,7 +125,7 @@ class UpdateClass {
125125
void setCryptConfig(const uint8_t cryptConfig) {
126126
_cryptCfg = cryptConfig & 0x0f;
127127
}
128-
#endif /* UPDATE_CRYPT */
128+
#endif /* UPDATE_NOCRYPT */
129129

130130
/*
131131
Aborts the running update
@@ -144,9 +144,9 @@ class UpdateClass {
144144
If calc_post_decryption is true, the update library will calculate the MD5 after the decryption, if false the calculation occurs before the decryption
145145
*/
146146
bool setMD5(const char *expected_md5
147-
#ifdef UPDATE_CRYPT
147+
#ifndef UPDATE_NOCRYPT
148148
, bool calc_post_decryption = true
149-
#endif /* #ifdef UPDATE_CRYPT */
149+
#endif /* #ifdef UPDATE_NOCRYPT */
150150
);
151151

152152
/*
@@ -244,21 +244,21 @@ class UpdateClass {
244244
private:
245245
void _reset();
246246
void _abort(uint8_t err);
247-
#ifdef UPDATE_CRYPT
247+
#ifndef UPDATE_NOCRYPT
248248
void _cryptKeyTweak(size_t cryptAddress, uint8_t *tweaked_key);
249249
bool _decryptBuffer();
250-
#endif /* UPDATE_CRYPT */
250+
#endif /* UPDATE_NOCRYPT */
251251
bool _writeBuffer();
252252
bool _verifyHeader(uint8_t data);
253253
bool _verifyEnd();
254254
bool _enablePartition(const esp_partition_t *partition);
255255
bool _chkDataInBlock(const uint8_t *data, size_t len) const; // check if block contains any data or is empty
256256

257257
uint8_t _error;
258-
#ifdef UPDATE_CRYPT
258+
#ifndef UPDATE_NOCRYPT
259259
uint8_t *_cryptKey;
260260
uint8_t *_cryptBuffer;
261-
#endif /* UPDATE_CRYPT */
261+
#endif /* UPDATE_NOCRYPT */
262262
uint8_t *_buffer;
263263
uint8_t *_skipBuffer;
264264
size_t _bufferLen;
@@ -270,19 +270,19 @@ class UpdateClass {
270270
const esp_partition_t *_partition;
271271

272272
String _target_md5;
273-
#ifdef UPDATE_CRYPT
273+
#ifndef UPDATE_NOCRYPT
274274
bool _target_md5_decrypted = true;
275-
#endif /* UPDATE_CRYPT */
275+
#endif /* UPDATE_NOCRYPT */
276276
MD5Builder _md5;
277277

278278
int _ledPin;
279279
uint8_t _ledOn;
280280

281-
#ifdef UPDATE_CRYPT
281+
#ifndef UPDATE_NOCRYPT
282282
uint8_t _cryptMode;
283283
size_t _cryptAddress;
284284
uint8_t _cryptCfg;
285-
#endif /* UPDATE_CRYPT */
285+
#endif /* UPDATE_NOCRYPT */
286286
};
287287

288288
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_UPDATE)

0 commit comments

Comments
 (0)