Closed DrWhax closed 5 years ago
Hey!
What do you mean by stops? Is it when the private conversation is ended?
Hey!
Let's say i'm Alice and I start an OTR conversation with Bob. I speak a line and Bob then cancels the OTR conversation with me and subsequently, I stop the otr conversation as well, nothing happens, if I redo the stop operation, Pidgin crashes with the above crash.
Is this more clear?
Yes! Thanks @DrWhax
Need to investigate.
Hey!
Ok, I have checked this and it happens this way:
'Attempting to start a private conversation
Unverified conversation started. Your client is not logging this conversation.
On Bob screen, it shows up:
Unverified conversation started. Your client is not logging this conversation.
OTR debug says this when the crash happens:
Assertion failed: (protocol != NULL), function protocol_and_account_to_client_id, file pidgin-helpers.c, line 37.
Another crash, that I found out is this:
Hey!
Ok, I have checked this and it happens this way:
'Attempting to start a private conversation
Unverified conversation started. Your client is not logging this conversation.
Unverified conversation started. Your client is not logging this conversation.
Hey!
Ok, I have checked this and it happens this way:
* Alice logs in to pidgin * Bob logs in to pidgin * Alice starts an OTR conversation with Bob. These messages show up:
'Attempting to start a private conversation Unverified conversation started. Your client is not logging this conversation.
On Bob screen, it shows up:
Unverified conversation started. Your client is not logging this conversation.
* Alice types 'Hey, Bob'. Bob receives it successfully. * Bob types 'Hey, Alice'. Alice receives it successfully. * Alice ends the conversation by clicking on 'End private conversation' button. This message is show in both Alice and Bob screens 'Private conversation lost.' * On Bob's menu, there is still the possibility of clicking on 'End private conversation', if you do, nothing happens. On the second time you click it, pidgin crashes.
Hey,
I guess the "End private conversation" on Alice, must be disabled, when Bob press "End private conversation", in that way Alice will not be able to press "End private conversation" (neither Bob of course).
I found the condition which control this behavior:
gtk_widget_set_sensitive(GTK_WIDGET(end), !insecure || finished);
on gtk-dialog.c/otr_set_menu_labels
As the enable/disable condition is handled by gtk_widget_set_sensitive (* widget , TRUE -> enabled , FALSE -> disabled), the option "End private conversation" is keep enabled because the condition: !insecure || finished (is evaluated as TRUE)
if we change the condition to:
gtk_widget_set_sensitive(GTK_WIDGET(end), !insecure || !finished);
Then Alice end is disabled, but Bob end is enabled.
The solution could be find a condition which evaluates every end and set the parameter 0 (false) to get the element disabled.
Hi, @MauroVelasco !
Very interesting. I see that the finished
bool is set up by the 'TRUST_FINISHED' constant. This latter const is set up here: https://github.com/otrv4/pidgin-otrng/blob/master/plugin-all.c#L1195. That code calls this function otrng_conversation_is_finished
, which is defined in the libotr-ng library here:
https://github.com/otrv4/libotr-ng/blob/master/src/client.c#L180
. In the case of OTRv4, that function returns a true boolean if the state is OTRNG_STATE_FINISHED
, which is the case, as per the protocol, you receive a TLV type 1 ("If you receive a TLV record of this type, you should transition to 'FINISHED' state (see below), and inform the participant that its correspondent has closed its end of the private connection, and the participant should do the same."). For some reason, though, it does not seem to be working. I will check more; but you can also look into it ;)
Hey @claucece, attached the functions involved:
I'll look more in detail about state transition.
Hi @claucece,
Looks like this condition do the trick:
gtk_widget_set_sensitive(GTK_WIDGET(end), !(insecure || finished) );
In this way both ends are disabled once the conversation is finished.
Hi @claucece, related to the other issue, looks like the session can't be validated:
Hi, @MauroVelasco
Thanks for the diagram! It looks very nice. But that seems to be mostly for when an user asks to disconnect; not when the user receives a disconnect request. So let's look together at that case later.
Looks like this condition do the trick: gtk_widget_set_sensitive(GTK_WIDGET(end), !(insecure || finished) );
Yeah.. but I don't think we should change it as it should be !insecure but finished.. let's look together at this ;)
So, around the other issue.. mmm.. it is interesting.. it looks like the session is getting expired for some reason..
So, around the other issue.. mmm.. it is interesting.. it looks like the session is getting expired for some reason..
Yes, exactly, I believe some value in the conversation parameter is NULL then the validation fails and explode. But I'll verify.