Commit Graph

5143 Commits

Author SHA1 Message Date
Hocuri
8d89dcc65f Add golden test that only one member-added message is shown for Bob 2025-09-03 17:56:12 +02:00
Hocuri
a858709301 Use translatable message for broadcast-joining 2025-09-03 17:56:12 +02:00
Hocuri
3d5e97eced No clippy warnings anymore! 2025-09-03 17:56:12 +02:00
Hocuri
5da6ca1ec4 test: Improve test_send_avatar_in_securejoin() 2025-09-03 17:56:12 +02:00
Hocuri
58d0fd39b5 clippy 2025-09-03 17:56:12 +02:00
Hocuri
40e3c34f59 refactor: It's not actually necessary for Alice to remember how the message was encrypted 2025-09-03 17:56:12 +02:00
Hocuri
1377a77ea8 refactor: Use the same decode_name() function for the contact name, remove redundant check for grpid.is_some()
If grpid is none, the group/brodacast name isn't used, anyways
2025-09-03 17:56:11 +02:00
Hocuri
db32f1142c Don't include the broadcast's shared secret in the QR code 2025-09-03 17:56:11 +02:00
Hocuri
738f6c1799 feat: Transfer the broadcast secret in an encrypted message rather than directly in the QR code 2025-09-03 17:56:11 +02:00
Hocuri
e1abaebeb5 WIP, untested: Receiving side of passing broadcast secret in a message 2025-09-03 17:56:11 +02:00
Hocuri
0978a46ab6 WIP, untested: Sending side of transferring the secret in member-added message 2025-09-03 17:56:11 +02:00
Hocuri
410048a9e1 Improve TODOs 2025-09-03 17:56:11 +02:00
Hocuri
72336ebb8a Add benchmark for message decryption 2025-09-03 17:56:11 +02:00
Hocuri
fca8948e4c Speed up message decryption by not iterating in the s2k algorithm
The passphrase has as much entropy as the session key, so, there is no
point in making the computation slow by iterating.
2025-09-03 17:56:11 +02:00
Hocuri
d431f2ebd3 Add benchmark for message decryption 2025-09-03 17:56:10 +02:00
Hocuri
ad0e3179dd Remove unused and problematic ensure!
`secret_keys.is_empty()` only checked whether any secret keys were
passed. This is not helpful, and made decrypting fail in the benchmark.
2025-09-03 17:56:10 +02:00
Hocuri
494ad63a73 feat: Increase secret size to 256 bits of entropy
This is for quantumn computers. When trying to break AES, quantumn
computers give a square-root speedup, i.e. the 144 bits of entropy would
take as many queries as breaking 72 bits of entropy on a normal computer. This neglects
e.g. the costs of quantumn circuits and quantumn error correction [1], so,
144 bits entropy would actually have been fine, but in order to be on
the very safe side and so that noone can complain, let's increase it to
256 bits.

[1]: https://csrc.nist.gov/csrc/media/Events/2024/fifth-pqc-standardization-conference/documents/papers/on-practical-cost-of-grover.pdf
2025-09-03 17:56:10 +02:00
Hocuri
13bbcbeb0e Add some print statements for debugging 2025-09-03 17:56:10 +02:00
Hocuri
a14b53e3ca fix: Don't show a weird 'vb-request-with-auth' message when a subscriber joins 2025-09-03 17:56:10 +02:00
Hocuri
9474fbff56 fix: Correct member-added info messages 2025-09-03 17:56:10 +02:00
Hocuri
c4001cc3ff fix: Let Alice send vb-member-added so that the chat is immediately shown on Bob's device 2025-09-03 17:56:08 +02:00
Hocuri
548f5a454c Add TODO 2025-09-03 17:55:40 +02:00
Hocuri
91110147c3 fix: Actually send broadcast message to recipients, ALL TESTS PASS NOW - fix test_broadcasts_name_and_avatar(). 2025-09-03 17:55:40 +02:00
Hocuri
6012595f1a test: fix test_encrypt_decrypt_broadcast() 2025-09-03 17:55:40 +02:00
Hocuri
504b2d691d test: fix test_leave_broadcast 2025-09-03 17:55:40 +02:00
Hocuri
7e191f6cf9 fix: Make joining a channel work with multi-device, fix test_leave_broadcast_multidevice 2025-09-03 17:55:40 +02:00
Hocuri
37f6da1cc9 test: Fix one panic in test_broadcasts_name_and_avatar, but there is another one where I couldn't find the problem 2025-09-03 17:55:39 +02:00
Hocuri
df2693f307 test: Fix test_broadcast_multidev 2025-09-03 17:55:39 +02:00
Hocuri
cdd280a2d3 make test_block_broadcast pass 2025-09-03 17:55:39 +02:00
Hocuri
6bb714a6e5 fix: Make syncing of QR tokens work, make test_sync_broadcast pass 2025-09-03 17:55:39 +02:00
Hocuri
b276eda1a2 Make basic multi-device work on joiner side, fix test_only_minimal_data_are_forwarded 2025-09-03 17:55:39 +02:00
Hocuri
9c747b4cb0 fix: make test_broadcast work, return an error when trying to add manually add a contact to a broadcast list, don't have unpromoted broadcast lists, make basic multi-device, inviter side, work 2025-09-03 17:55:39 +02:00
Hocuri
326deab025 Broadcast-securejoin is working!! 2025-09-03 17:55:39 +02:00
Hocuri
24561cd256 test: Add test_send_avatar_in_securejoin 2025-09-03 17:55:39 +02:00
Hocuri
5da7e45b2b Adapt the rest of the code to the new QR code type 2025-09-03 17:55:39 +02:00
Hocuri
3389e93820 feat: Add broadcast QR type (todo: documentation) 2025-09-03 17:55:39 +02:00
Hocuri
789b923bb8 feat: Store symmetric key non-redundantly in the database 2025-09-03 17:55:39 +02:00
Hocuri
547f750073 Make it compile 2025-09-03 17:55:39 +02:00
Hocuri
382023de11 sync broadcast secret for multidevice 2025-09-03 17:55:39 +02:00
Hocuri
3781a35989 feat: Add create_broadcast_shared_secret() 2025-09-03 17:55:39 +02:00
Hocuri
8653fdbd8e feat: Save the secret to encrypt and decrypt messages. Next: Send it in a 'member added' message. 2025-09-03 17:55:38 +02:00
Hocuri
47bf4da1fe WIP: Start with decryption, and a test for it. Next TODO: SQL table migartion. 2025-09-03 17:55:38 +02:00
Hocuri
ec2056f5e2 feat: Symmetric encryption. No decryption, no sharing of the secret, not tested. 2025-09-03 17:55:35 +02:00
link2xt
7ea6ca35d7 feat: do not replace messages with an error on verification failure 2025-09-02 18:29:53 +00:00
link2xt
a9aad497fc api!: remove deprecated is_protection_broken 2025-09-02 18:29:53 +00:00
link2xt
7da8489635 api!: remove is_profile_verified APIs
UIs now display green checkmark in a profile
if the contact is verified.
Chats with key-contacts cannot become unprotected,
so there is no need to check 1:1 chat.
2025-09-02 18:29:53 +00:00
link2xt
683561374d test: add TestContext.create_chat_id 2025-09-02 18:29:53 +00:00
link2xt
66c9982822 fix: add "Messages are end-to-end encrypted." to non-protected groups
The messages are end-to-end encrypted
in encrypted group regardless
of whether the group is protected or not.
2025-09-02 18:29:53 +00:00
link2xt
1b6450b210 feat: do not set "unknown sender for this chat" error 2025-09-02 18:29:53 +00:00
Nico de Haen
143ba6d5e7 fix: Mark message as failed if it can't be send (#7143)
resolves #6849
2025-09-02 14:32:25 +02:00