diff --git a/components/esp_https_ota/src/esp_https_ota.c b/components/esp_https_ota/src/esp_https_ota.c index 9a8a6e9df4..f3a827e773 100644 --- a/components/esp_https_ota/src/esp_https_ota.c +++ b/components/esp_https_ota/src/esp_https_ota.c @@ -452,10 +452,13 @@ esp_err_t esp_https_ota_get_img_desc(esp_https_ota_handle_t https_ota_handle, es const int app_desc_offset = sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t); esp_app_desc_t *app_info = (esp_app_desc_t *) &handle->ota_upgrade_buf[app_desc_offset]; + if(handle->update_partition->type == ESP_PARTITION_TYPE_APP) + { if (app_info->magic_word != ESP_APP_DESC_MAGIC_WORD) { ESP_LOGE(TAG, "Incorrect app descriptor magic"); return ESP_FAIL; } + } memcpy(new_app_info, app_info, sizeof(esp_app_desc_t)); return ESP_OK; @@ -528,10 +531,13 @@ esp_err_t esp_https_ota_perform(esp_https_ota_handle_t https_ota_handle) return ESP_FAIL; } #endif // CONFIG_ESP_HTTPS_OTA_DECRYPT_CB + if(handle->update_partition->type == ESP_PARTITION_TYPE_APP) + { err = esp_ota_verify_chip_id(data_buf); if (err != ESP_OK) { return err; } + } return _ota_write(handle, data_buf, binary_file_len); case ESP_HTTPS_OTA_IN_PROGRESS: data_read = esp_http_client_read(handle->http_client,