mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +03:00
test: test that changing default private key breaks backward verification
This commit is contained in:
@@ -4,7 +4,7 @@ import pytest
|
|||||||
from deltachat_rpc_client import Chat, SpecialContactId
|
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)
|
alice, bob = acfactory.get_online_accounts(2)
|
||||||
|
|
||||||
qr_code, _svg = alice.get_qr_code()
|
qr_code, _svg = alice.get_qr_code()
|
||||||
@@ -24,6 +24,18 @@ def test_qr_setup_contact(acfactory) -> None:
|
|||||||
bob_contact_alice_snapshot = bob_contact_alice.get_snapshot()
|
bob_contact_alice_snapshot = bob_contact_alice.get_snapshot()
|
||||||
assert bob_contact_alice_snapshot.is_verified
|
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
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("protect", [True, False])
|
@pytest.mark.parametrize("protect", [True, False])
|
||||||
def test_qr_securejoin(acfactory, protect):
|
def test_qr_securejoin(acfactory, protect):
|
||||||
|
|||||||
Reference in New Issue
Block a user