Added compiler switch to disable firmware validation

This commit is contained in:
Mark Qvist 2024-03-10 19:39:10 +01:00
parent 262518efef
commit 854b345e3d

View File

@ -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