@@ -63,7 +63,7 @@ class UpdateClass {
63
63
*/
64
64
bool begin (size_t size = UPDATE_SIZE_UNKNOWN, int command = U_FLASH, int ledPin = -1 , uint8_t ledOn = LOW, const char *label = NULL );
65
65
66
- #ifdef UPDATE_CRYPT
66
+ #ifndef UPDATE_NOCRYPT
67
67
/*
68
68
Setup decryption configuration
69
69
Crypt Key is 32bytes(256bits) block of data, use the same key as used to encrypt image file
@@ -72,7 +72,7 @@ class UpdateClass {
72
72
Crypt Mode, used to select if image files should be decrypted or not
73
73
*/
74
74
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 */
76
76
77
77
/*
78
78
Writes a buffer to the flash and increments the address
@@ -101,7 +101,7 @@ class UpdateClass {
101
101
*/
102
102
bool end (bool evenIfRemaining = false );
103
103
104
- #ifdef UPDATE_CRYPT
104
+ #ifndef UPDATE_NOCRYPT
105
105
/*
106
106
sets AES256 key(32 bytes) used for decrypting image file
107
107
*/
@@ -125,7 +125,7 @@ class UpdateClass {
125
125
void setCryptConfig (const uint8_t cryptConfig) {
126
126
_cryptCfg = cryptConfig & 0x0f ;
127
127
}
128
- #endif /* UPDATE_CRYPT */
128
+ #endif /* UPDATE_NOCRYPT */
129
129
130
130
/*
131
131
Aborts the running update
@@ -144,9 +144,9 @@ class UpdateClass {
144
144
If calc_post_decryption is true, the update library will calculate the MD5 after the decryption, if false the calculation occurs before the decryption
145
145
*/
146
146
bool setMD5 (const char *expected_md5
147
- #ifdef UPDATE_CRYPT
147
+ #ifndef UPDATE_NOCRYPT
148
148
, bool calc_post_decryption = true
149
- #endif /* #ifdef UPDATE_CRYPT */
149
+ #endif /* #ifdef UPDATE_NOCRYPT */
150
150
);
151
151
152
152
/*
@@ -244,21 +244,21 @@ class UpdateClass {
244
244
private:
245
245
void _reset ();
246
246
void _abort (uint8_t err);
247
- #ifdef UPDATE_CRYPT
247
+ #ifndef UPDATE_NOCRYPT
248
248
void _cryptKeyTweak (size_t cryptAddress, uint8_t *tweaked_key);
249
249
bool _decryptBuffer ();
250
- #endif /* UPDATE_CRYPT */
250
+ #endif /* UPDATE_NOCRYPT */
251
251
bool _writeBuffer ();
252
252
bool _verifyHeader (uint8_t data);
253
253
bool _verifyEnd ();
254
254
bool _enablePartition (const esp_partition_t *partition);
255
255
bool _chkDataInBlock (const uint8_t *data, size_t len) const ; // check if block contains any data or is empty
256
256
257
257
uint8_t _error;
258
- #ifdef UPDATE_CRYPT
258
+ #ifndef UPDATE_NOCRYPT
259
259
uint8_t *_cryptKey;
260
260
uint8_t *_cryptBuffer;
261
- #endif /* UPDATE_CRYPT */
261
+ #endif /* UPDATE_NOCRYPT */
262
262
uint8_t *_buffer;
263
263
uint8_t *_skipBuffer;
264
264
size_t _bufferLen;
@@ -270,19 +270,19 @@ class UpdateClass {
270
270
const esp_partition_t *_partition;
271
271
272
272
String _target_md5;
273
- #ifdef UPDATE_CRYPT
273
+ #ifndef UPDATE_NOCRYPT
274
274
bool _target_md5_decrypted = true ;
275
- #endif /* UPDATE_CRYPT */
275
+ #endif /* UPDATE_NOCRYPT */
276
276
MD5Builder _md5;
277
277
278
278
int _ledPin;
279
279
uint8_t _ledOn;
280
280
281
- #ifdef UPDATE_CRYPT
281
+ #ifndef UPDATE_NOCRYPT
282
282
uint8_t _cryptMode;
283
283
size_t _cryptAddress;
284
284
uint8_t _cryptCfg;
285
- #endif /* UPDATE_CRYPT */
285
+ #endif /* UPDATE_NOCRYPT */
286
286
};
287
287
288
288
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_UPDATE)
0 commit comments