const esp_partition_t *part;
uint32_t erased_size;
uint32_t wrote_size;
-#ifdef CONFIG_FLASH_ENCRYPTION_ENABLED
uint8_t partial_bytes;
uint8_t partial_data[16];
-#endif
LIST_ENTRY(ota_ops_entry_) entries;
} ota_ops_entry_t;
return ESP_ERR_OTA_VALIDATE_FAILED;
}
-#ifdef CONFIG_FLASH_ENCRYPTION_ENABLED
if (esp_flash_encryption_enabled()) {
/* Can only write 16 byte blocks to flash, so need to cache anything else */
size_t copy_len;
return ESP_OK; /* nothing to write yet, just filling buffer */
}
/* write 16 byte to partition */
- ret = esp_partition_write(&it->part, it->wrote_size, it->partial_data, 16);
+ ret = esp_partition_write(it->part, it->wrote_size, it->partial_data, 16);
if (ret != ESP_OK) {
return ret;
}
memcpy(it->partial_data, data_bytes + size, it->partial_bytes);
}
}
-#endif
ret = esp_partition_write(it->part, it->wrote_size, data_bytes, size);
if(ret == ESP_OK){
goto cleanup;
}
-#ifdef CONFIG_FLASH_ENCRYPTION_ENABLED
- if (it->partial_bytes > 0 && esp_flash_encryption_enabled()) {
+ if (it->partial_bytes > 0) {
/* Write out last 16 bytes, if necessary */
- ret = esp_partition_write(&it->part, it->wrote_size, it->partial_data, 16);
+ ret = esp_partition_write(it->part, it->wrote_size, it->partial_data, 16);
if (ret != ESP_OK) {
ret = ESP_ERR_INVALID_STATE;
goto cleanup;
it->wrote_size += 16;
it->partial_bytes = 0;
}
-#endif
if (esp_image_basic_verify(it->part->address, true, &image_size) != ESP_OK) {
ret = ESP_ERR_OTA_VALIDATE_FAILED;