Merge branch 'bugfix/coverity_issues' into 'master'

Fix some coverity reported issues

Closes IDF-12188, IDF-12197, and IDF-12193

See merge request espressif/esp-idf!36719
This commit is contained in:
Mahavir Jain
2025-02-10 22:05:30 +08:00
3 changed files with 6 additions and 1 deletions
@@ -175,10 +175,12 @@ static esp_err_t check_and_generate_encryption_keys(void)
if (tmp_has_key) { // For ESP32: esp_efuse_find_purpose() always returns True, need to check whether the key block is used or not.
tmp_has_key &= !esp_efuse_key_block_unused(blocks[i]);
}
#if CONFIG_SECURE_FLASH_ENCRYPTION_AES256
if (i == 1 && tmp_has_key != has_key) {
ESP_LOGE(TAG, "Invalid efuse key blocks: Both AES-256 key blocks must be set.");
return ESP_ERR_INVALID_STATE;
}
#endif
has_key &= tmp_has_key;
}