fix(esp_security): Add more validation checks

This commit is contained in:
harshal.patil
2026-02-28 11:02:13 +05:30
committed by Mahavir Jain
parent 0db717b9ec
commit 398d9ea9cd
3 changed files with 10 additions and 0 deletions

View File

@@ -561,6 +561,11 @@ esp_err_t esp_key_mgr_activate_key(esp_key_mgr_key_recovery_info_t *key_recovery
return ESP_ERR_INVALID_ARG;
}
if (key_recovery_info->magic != KEY_HUK_SECTOR_MAGIC) {
ESP_LOGE(TAG, "Invalid key recovery info magic");
return ESP_ERR_INVALID_ARG;
}
esp_key_mgr_key_type_t key_type = key_recovery_info->key_type;
ESP_LOGD(TAG, "Activating key of type %d", key_type);