-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Psi indicates outcoming OMEMO-encrypted messages as unencrypted #616
Comments
As I see OMEMO button on toolbar is enabled. Have you tried to disable and then to enable OMEMO encryption from your side? Does it change anything? |
Tried it, didn't really work. The messages that were sent out with OMEMO disabled were unencrypted. Once I turned it back on, the problem started reoccuring. Messages were still getting encrypted and they were still being indicated as if they were not encrypted. |
Maybe misinterpretation of the chatlog when when incoming unencrypted message also triggers "encryption disabled". |
@Ri0n @yessiest |
So i have tested this with the latest build by @tehnick (v1.5.1524) under approximately the same conditions as before (Windows 10 x86_64, Psi+ as recipient, Profanity v0.10.0 as sender, OMEMO enabled and fingerprints were exchanged). This issue seems to have been fixed as far as I can tell - both incoming and outcoming OMEMO messages are marked as encrypted and "Encryption is disabled" messages no longer pop up. |
It is possible to test with another accounts? |
I have tested this on a different machine (Windows 7 x86_64) with two builds - one that I have mentioned in the head post and the v1.5.1524 one, both running portable. The issue has resurfaced on the v.1.5.1524 build - once again the outgoing messages are being marked as unencrypted, while Profanity receives them as OMEMO encrypted messages. I have tested this again on the original hardware (Windows 10 x86_64), and the issue resurfaced there, too. |
@kssytsrk: Can you look this ticket? |
Can't reproduce on Psi+ 1.5.1551 (2021-08-16) / FreeBSD 13.0 and Profanity as sender. Might this be Windows-only? |
@kssytsrk: Thanks for your reply. Can you test with 2 new test accounts without OMEMO used before? Please use Psi+ and Psi+. You will find the problem... |
Isn't this ticket specifically about
? |
No. |
@yessiest: Do you confirm that the bug is always here with new Psi+ builds? |
I have tested the newest version available on sourceforge.net, that is, version 1.5.1552, on a Windows 7 machine. I can confirm that the bug still persists. Worth noting is the fact that this time I have been using Psi+ on both ends, so it's not specifically "Psi+ as recipient and Profanity v0.10.0 as sender" issue. I have managed to reproduce both the state where the issue didn't show up and the state where it reappeared. The issue becomes apparent only if the receiving device uses Psi+ and the sending device has multiple OMEMO keys for the receiver's account. Then this issue appears on the receiver's Psi+ client. |
This bug seems very strange. I had come across it a lot when my server was running Prosody; far less often when using Ejabberd, and now it has come back again. |
@Ri0n: You can confirm this bug, you have seen few days ago |
Found where OMEMO fails. Tested with OTR, in iris/src/xmpp/xmpp-im/xmpp_tasks.cpp, there's this bit of code void JT_Message::onGo()
{
Stanza s = m.toStanza(&(client()->stream()));
QDomElement e = s.element(); // oldStyleNS(s.element());
if (auto encryptionHandler = client()->encryptionHandler()) {
Q_UNUSED(encryptionHandler->encryptMessageElement(e));
}
// See: XEP-0380: Explicit Message Encryption
const bool wasEncrypted = !e.firstChildElement("encryption").isNull();
m.setWasEncrypted(wasEncrypted);
m.setEncryptionProtocol(encryptionProtocol(e));
// if the element is null, then the encryption is happening asynchronously
if (!e.isNull()) {
send(e);
}
setSuccess();
} This code sets the flag that tells whether the message was encrypted. It works fine with OTR because "e" is actually set and is not null. However, for OMEMO, e.isNull() returns true, and so wasEncrypted is probably also not present as an element of e. So the gist of it is that if encryption is happening "asynchronously", there is no way to actually check that the message was encrypted and so it defaults to saying that message was never encrypted. Currently researching into potential ways of fixing this without being too intrusive, hopefully there is a solution. |
Now I have. @yessiest You are right that the OTR and the OMEMO encryptions are handled differently. It's not consistently broken, though, you've said it yourself:
The only thing left is to investigate what's happening differently between the working and the broken states. For my use-cases the messages are always indicated properly. |
@Neustradamus yes I have. Unfortunately I have been unable to reproduce the issue lately, things kind of just work for the most part. I'm not quite sure whether anything has changed, and disappointingly enough, my initial judgement on this issue being tied to having multiple contact fingerprints seems to be invalid - i have just tested this, sent messages to various resources, with different keys, everything worked as expected. |
I discovered for myself that at least on my end, the issue is caused by untrusted OMEMO keys from other devices logged in. If I send a message from Psi+ to these other devices on my account, it'll build and add the device key to my trusted contacts list, which will no longer display the warning at all. |
@yessiest and others: Have you tested with latest Psi+ build? |
When an outcoming message is sent, Psi seems to be showing that it isn't encrypted, even if encryption is enabled.
Despite this, the message is received as if it was a proper OMEMO message, and xml dump shows that the message body contains
<encrypted>
tag,<payload>
tag and<encryption>
tag.I'm using Psi+ 1.5.2021.01.02 on Windows 10.
XML log of the message (to/from stripped)
The text was updated successfully, but these errors were encountered: