Skip to content

Commit

Permalink
test: test that changing default private key breaks backward verifica…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
link2xt committed Dec 11, 2023
1 parent c69f584 commit 2cb0335
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion deltachat-rpc-client/tests/test_securejoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from deltachat_rpc_client import Chat, SpecialContactId


def test_qr_setup_contact(acfactory) -> None:
def test_qr_setup_contact(acfactory, tmp_path) -> None:
alice, bob = acfactory.get_online_accounts(2)

qr_code, _svg = alice.get_qr_code()
Expand All @@ -23,6 +23,18 @@ def test_qr_setup_contact(acfactory) -> None:
bob_contact_alice_snapshot = bob_contact_alice.get_snapshot()
assert bob_contact_alice_snapshot.is_verified

# Test that if Bob changes the key, backwards verification is lost.
logging.info("Bob 2 is created")
bob2 = acfactory.new_configured_account()
bob2.export_self_keys(tmp_path)

logging.info("Bob imports a key")
bob.import_self_keys(tmp_path / "private-key-default.asc")

assert bob.get_config("key_id") == "2"
bob_contact_alice_snapshot = bob_contact_alice.get_snapshot()
assert not bob_contact_alice_snapshot.is_verified


def test_qr_securejoin(acfactory):
alice, bob = acfactory.get_online_accounts(2)
Expand Down

0 comments on commit 2cb0335

Please sign in to comment.