Merge branch 'fix_pre_encrypted_ota_with_updated_component' into 'master'

examples: pre_encrypted_ota: update to newer API from esp_encrypted_img component

See merge request espressif/esp-idf!24083
This commit is contained in:
Mahavir Jain 2023-06-24 01:11:20 +08:00
commit 1fc1f7a582

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
@ -109,8 +109,8 @@ void pre_encrypted_ota_task(void *pvParameter)
.keep_alive_enable = true,
};
esp_decrypt_cfg_t cfg = {};
cfg.rsa_pub_key = rsa_private_pem_start;
cfg.rsa_pub_key_len = rsa_private_pem_end - rsa_private_pem_start;
cfg.rsa_priv_key = rsa_private_pem_start;
cfg.rsa_priv_key_len = rsa_private_pem_end - rsa_private_pem_start;
esp_decrypt_handle_t decrypt_handle = esp_encrypted_img_decrypt_start(&cfg);
if (!decrypt_handle) {
ESP_LOGE(TAG, "OTA upgrade failed");