From 2daeed2fe7257ab79cc6430d7fd55619c30254a3 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 4 Jul 2025 21:21:27 -0400 Subject: [PATCH] Fix checksum validation in stats --- src/password_manager/manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/password_manager/manager.py b/src/password_manager/manager.py index 3ca8fb5..65776e8 100644 --- a/src/password_manager/manager.py +++ b/src/password_manager/manager.py @@ -14,6 +14,7 @@ import json import logging import getpass import os +import hashlib from typing import Optional import shutil import time @@ -2267,7 +2268,8 @@ class PasswordManager: # Schema version and checksum status 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 if chk_path.exists(): stored = chk_path.read_text().strip()