Remove unused encryption mode setting

This commit is contained in:
thePR0M3TH3AN
2025-07-02 19:00:49 -04:00
parent c8db87d3d2
commit 57adf0bf01
6 changed files with 28 additions and 89 deletions

View File

@@ -12,10 +12,7 @@ import bcrypt
from password_manager.vault import Vault
from nostr.client import DEFAULT_RELAYS as DEFAULT_NOSTR_RELAYS
from utils.key_derivation import (
EncryptionMode,
DEFAULT_ENCRYPTION_MODE,
)
from constants import INACTIVITY_TIMEOUT
logger = logging.getLogger(__name__)
@@ -46,7 +43,6 @@ class ConfigManager:
"relays": list(DEFAULT_NOSTR_RELAYS),
"pin_hash": "",
"password_hash": "",
"encryption_mode": DEFAULT_ENCRYPTION_MODE.value,
"inactivity_timeout": INACTIVITY_TIMEOUT,
}
try:
@@ -57,7 +53,6 @@ class ConfigManager:
data.setdefault("relays", list(DEFAULT_NOSTR_RELAYS))
data.setdefault("pin_hash", "")
data.setdefault("password_hash", "")
data.setdefault("encryption_mode", DEFAULT_ENCRYPTION_MODE.value)
data.setdefault("inactivity_timeout", INACTIVITY_TIMEOUT)
# Migrate legacy hashed_password.enc if present and password_hash is missing
@@ -123,12 +118,6 @@ class ConfigManager:
config["password_hash"] = password_hash
self.save_config(config)
def set_encryption_mode(self, mode: EncryptionMode) -> None:
"""Persist the selected encryption mode in the config."""
config = self.load_config(require_pin=False)
config["encryption_mode"] = mode.value
self.save_config(config)
def set_inactivity_timeout(self, timeout_seconds: float) -> None:
"""Persist the inactivity timeout in seconds."""
if timeout_seconds <= 0:

View File

@@ -696,7 +696,6 @@ class PasswordManager:
)
self.store_hashed_password(password)
self.config_manager.set_encryption_mode(self.encryption_mode)
logging.info("User password hashed and stored successfully.")
seed_mgr.encrypt_parent_seed(seed)
@@ -1463,7 +1462,6 @@ class PasswordManager:
self.vault.set_encryption_manager(new_mgr)
self.vault.save_index(index_data)
self.config_manager.vault = self.vault
config_data["encryption_mode"] = new_mode.value
self.config_manager.save_config(config_data)
self.encryption_manager = new_mgr