Some additional checks related to secure version of the application in
anti-rollback case have been added to avoid any attempts to boot lower
security version but valid application (e.g., passive partition image).
- Read secure_version under sha256 protection
- First check has been added in the bootloader to ensure correct secure
version after application verification and loading stage. This check
happens before setting up the flash cache mapping and handling over
the final control to application. This check ensures that application
was not swapped (e.g., to lower security version but valid image) just
before the load stage in bootloader.
- Second check has been added in the application startup code to ensure
that currently booting app has higher security version than the one
programmed in the eFuse for anti-rollback scenario. This will ensure
that only the legit application boots-up on the device for
anti-rollback case.
By doing so, the application will be able to define its own esp_app_desc generated at their discretion, with help of whatever build process they use, and removes the necessity to rebuild esp-idf every time only to have the esp_app_desc updated.
Removes the patch necessary for https://github.com/esp-rs/esp-idf-sys/pull/136, where we are building esp-idf and basically linking it as a static library. The process building the library doesn't have access to the real application version or the build time, since we are only rebuilding esp-idf if the sdkconfig changes.