Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable checks for encrypted flash in OTA #453

Closed
wants to merge 1 commit into from

Conversation

rojer
Copy link
Contributor

@rojer rojer commented Mar 24, 2017

Even if firmware is compiled without CONFIG_FLASH_ENCRYPTION_ENABLED
Rayionale: CONFIG_FLASH_ENCRYPTION_ENABLED controls whether boot loader
generates keys for encryption or not, but flash encryption can be
configured externally. With this change, it's possible to have boot
loader not generate keys but still have encryption working.

Even if firmware is compiled without CONFIG_FLASH_ENCRYPTION_ENABLED
Rayionale: CONFIG_FLASH_ENCRYPTION_ENABLED controls whether boot loader
generates keys for encryption or not, but flash encryption can be
configured externally. With this change, it's possible to have boot
loader not generate keys but still have encryption working.

Also fix use of it->part
@@ -166,7 +163,7 @@ esp_err_t esp_ota_write(esp_ota_handle_t handle, const void *data, size_t size)
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&it->part changed to it->part. Judging from the signature of esp_partition_write this wasn't compiling properly..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep. a drive-by fix. it generated a compilation warning that must've been overlooked. it could not have possibly worked.

@igrr igrr added the Status: Pending blocked by some other factor label Apr 11, 2017
igrr added a commit that referenced this pull request Apr 13, 2017
Enable checks for encrypted flash in OTA

Even if firmware is compiled without CONFIG_FLASH_ENCRYPTION_ENABLED.

Rationale: CONFIG_FLASH_ENCRYPTION_ENABLED controls whether boot loader generates keys for encryption or not, but flash encryption can be configured externally. With this change, it's possible to have boot loader not generate keys but still have encryption working.

Also fix use of it->part

Ref. #453

See merge request !647
@igrr
Copy link
Member

igrr commented Apr 18, 2017

Rebased and merged in a845f21, thanks!

@igrr igrr closed this Apr 18, 2017
@igrr igrr removed the Status: Pending blocked by some other factor label Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants