Switch encryption to AES-GCM

This commit is contained in:
thePR0M3TH3AN
2025-07-12 14:05:06 -04:00
parent 7b09bb0fdb
commit d27e3708c5
3 changed files with 32 additions and 29 deletions

View File

@@ -43,13 +43,15 @@ def test_round_trip(monkeypatch):
path = export_backup(vault, backup, parent_seed=SEED)
assert path.exists()
wrapper = json.loads(path.read_text())
assert wrapper.get("cipher") == "aes-gcm"
vault.save_index({"pw": 0})
import_backup(vault, backup, path, parent_seed=SEED)
assert vault.load_index()["pw"] == data["pw"]
from cryptography.fernet import InvalidToken
from cryptography.exceptions import InvalidTag
def test_corruption_detection(monkeypatch):
@@ -66,7 +68,7 @@ def test_corruption_detection(monkeypatch):
content["payload"] = base64.b64encode(payload).decode()
path.write_text(json.dumps(content))
with pytest.raises(InvalidToken):
with pytest.raises(InvalidTag):
import_backup(vault, backup, path, parent_seed=SEED)