Fix checksum validation in stats

This commit is contained in:
thePR0M3TH3AN
2025-07-04 21:21:27 -04:00
parent 4f649885d8
commit 2daeed2fe7

View File

@@ -14,6 +14,7 @@ import json
import logging import logging
import getpass import getpass
import os import os
import hashlib
from typing import Optional from typing import Optional
import shutil import shutil
import time import time
@@ -2267,7 +2268,8 @@ class PasswordManager:
# Schema version and checksum status # Schema version and checksum status
stats["schema_version"] = data.get("schema_version") stats["schema_version"] = data.get("schema_version")
current_checksum = json_checksum(data) json_content = json.dumps(data, indent=4)
current_checksum = hashlib.sha256(json_content.encode("utf-8")).hexdigest()
chk_path = self.entry_manager.checksum_file chk_path = self.entry_manager.checksum_file
if chk_path.exists(): if chk_path.exists():
stored = chk_path.read_text().strip() stored = chk_path.read_text().strip()