mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-09 07:48:57 +00:00
Add configurable KDF iterations
This commit is contained in:
@@ -23,6 +23,7 @@ def test_config_defaults_and_round_trip():
|
||||
assert cfg["pin_hash"] == ""
|
||||
assert cfg["password_hash"] == ""
|
||||
assert cfg["additional_backup_path"] == ""
|
||||
assert cfg["kdf_iterations"] == 100_000
|
||||
|
||||
cfg_mgr.set_pin("1234")
|
||||
cfg_mgr.set_relays(["wss://example.com"], require_pin=False)
|
||||
@@ -146,3 +147,14 @@ def test_secret_mode_round_trip():
|
||||
cfg2 = cfg_mgr.load_config(require_pin=False)
|
||||
assert cfg2["secret_mode_enabled"] is True
|
||||
assert cfg2["clipboard_clear_delay"] == 99
|
||||
|
||||
|
||||
def test_kdf_iterations_round_trip():
|
||||
with TemporaryDirectory() as tmpdir:
|
||||
vault, _ = create_vault(Path(tmpdir), TEST_SEED, TEST_PASSWORD)
|
||||
cfg_mgr = ConfigManager(vault, Path(tmpdir))
|
||||
|
||||
assert cfg_mgr.get_kdf_iterations() == 100_000
|
||||
|
||||
cfg_mgr.set_kdf_iterations(200_000)
|
||||
assert cfg_mgr.get_kdf_iterations() == 200_000
|
||||
|
Reference in New Issue
Block a user