mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2024-07-02 14:34:13 +02:00
Added compiler switch to disable firmware validation
This commit is contained in:
parent
262518efef
commit
854b345e3d
3
Device.h
3
Device.h
@ -22,6 +22,7 @@
|
|||||||
#include "esp_partition.h"
|
#include "esp_partition.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define VALIDATE_FIRMWARE true
|
||||||
|
|
||||||
// Forward declaration from Utilities.h
|
// Forward declaration from Utilities.h
|
||||||
void eeprom_update(int mapped_addr, uint8_t byte);
|
void eeprom_update(int mapped_addr, uint8_t byte);
|
||||||
@ -129,12 +130,14 @@ void device_validate_partitions() {
|
|||||||
partition.type = ESP_PARTITION_TYPE_APP;
|
partition.type = ESP_PARTITION_TYPE_APP;
|
||||||
esp_partition_get_sha256(&partition, dev_bootloader_hash);
|
esp_partition_get_sha256(&partition, dev_bootloader_hash);
|
||||||
esp_partition_get_sha256(esp_ota_get_running_partition(), dev_firmware_hash);
|
esp_partition_get_sha256(esp_ota_get_running_partition(), dev_firmware_hash);
|
||||||
|
#if VALIDATE_FIRMWARE
|
||||||
for (uint8_t i = 0; i < DEV_HASH_LEN; i++) {
|
for (uint8_t i = 0; i < DEV_HASH_LEN; i++) {
|
||||||
if (dev_firmware_hash_target[i] != dev_firmware_hash[i]) {
|
if (dev_firmware_hash_target[i] != dev_firmware_hash[i]) {
|
||||||
fw_signature_validated = false;
|
fw_signature_validated = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user