mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 17:49:10 -04:00
fix(bootloader_support): Fix image_length calculation when secure boot v1 is enabled
Fixed the value of the image_length field of the image metadata populated by esp_image_verfiy() to include the size of the signature sector when Secure Boot V1 is enabled.
This commit is contained in:
parent
977a90b245
commit
4573271d2b
@ -932,9 +932,13 @@ static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_han
|
|||||||
return ESP_ERR_IMAGE_INVALID;
|
return ESP_ERR_IMAGE_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
|
|
||||||
// Adjust image length result to include the appended signature
|
// Adjust image length result to include the appended signature
|
||||||
|
#if CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
|
||||||
data->image_len = end - data->start_addr + sizeof(ets_secure_boot_signature_t);
|
data->image_len = end - data->start_addr + sizeof(ets_secure_boot_signature_t);
|
||||||
|
#elif defined(CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME)
|
||||||
|
if (data->start_addr != ESP_BOOTLOADER_OFFSET) {
|
||||||
|
data->image_len = end - data->start_addr + sizeof(esp_secure_boot_sig_block_t);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // SECURE_BOOT_CHECK_SIGNATURE
|
#endif // SECURE_BOOT_CHECK_SIGNATURE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user