e2ee: require quorum to enable encryption

Previously, standard Autocrypt rule was used to determine whether
encryption is enabled: if at least one recipient does not prefer
encryption, encryption is disabled.

This rule has been problematic in large groups, because the larger
is the group, the higher is the chance that one of the users does not
prefer encryption.

New rule requires a majority of users to prefer encryption. Note that it
does not affect 1:1 chats, because it is required that *strictly* more
than a half users in a chat prefer encryption.
This commit is contained in:
Alexander Krotov
2020-09-26 02:15:42 +03:00
committed by link2xt
parent 0344bc387c
commit 60a8b47ad0
2 changed files with 31 additions and 10 deletions

View File

@@ -1017,7 +1017,6 @@ class TestOnlineAccount:
assert msg_in.text == text2
assert ac1.get_config("addr") in [x.addr for x in msg_in.chat.get_contacts()]
@pytest.mark.xfail(reason="Quorum rule is not used yet")
def test_prefer_encrypt(self, acfactory, lp):
"""Test quorum rule for encryption preference in 1:1 and group chat."""
ac1, ac2, ac3 = acfactory.get_many_online_accounts(3)