From b9caa324bc691b2a12b0c88c3b1ad205e41087ce Mon Sep 17 00:00:00 2001 From: Harshit Malpani Date: Tue, 6 Jun 2023 16:23:33 +0530 Subject: [PATCH] examples: pre_encrypted_ota: update to newer API from esp_encrypted_img component The members of the esp_decrypt_cfg_t configuration structure have been updated to correctly reflect that we are using RSA private key member for the decryption purpose. Earlier their names were incorrect. This old names have been marked as deprecated for IDF 5.2 release. This change can be viewed at https://github.com/espressif/idf-extra-components/pull/187 and its part of esp_encrypted_img component version 2.0.4 This commit updated to newer API usage from esp_encrypted_img component v2.0.4 for pre_encrypted_ota example. --- .../system/ota/pre_encrypted_ota/main/pre_encrypted_ota.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/system/ota/pre_encrypted_ota/main/pre_encrypted_ota.c b/examples/system/ota/pre_encrypted_ota/main/pre_encrypted_ota.c index 20f8f153aa..caa9335f7f 100644 --- a/examples/system/ota/pre_encrypted_ota/main/pre_encrypted_ota.c +++ b/examples/system/ota/pre_encrypted_ota/main/pre_encrypted_ota.c @@ -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");