[OTR-dev] Sending encrypted messages

Ian Goldberg ian at cypherpunks.ca
Sun Jun 28 17:41:54 EDT 2015


On Sun, Jun 28, 2015 at 10:30:31PM +0200, Pierre Lebreton wrote:
> Hello again,
> 
> 
> So I have been doing some digging, and I can see:
> 
> when gone_secure is called, I have context->msgstate equal to
> OTRL_MSGSTATE_ENCRYPTED
> 
> 
> Just before, "otrl_message_sending", msgstate is still equal to
> OTRL_MSGSTATE_ENCRYPTED for the appropriate contact.
> 
> However, during the call, I have a message event triggered, and I can see
> the message "OTRL_MSGEVENT_ENCRYPTION_REQUIRED".
> And the value of context->msgstate changed to OTRL_MSGSTATE_PLAINTEXT
> 
> After the end of the call of "otrl_message_sending" the msgstate is equal
> to OTRL_MSGSTATE_PLAINTEXT.
> 
> Maybe that would help to identify my mistake?
> 
> Thanks

Is the context pointer the same when context->msgstate is ENCRYPTED and
when it's PLAINTEXT?  OTRL_MSGEVENT_ENCRYPTION_REQUIRED will only be
called when the msgstate is already PLAINTEXT, so the question is why
either (a) the context is switching to PLAINTEXT, or (b) a new context
is being created.  If you were using OTRv3, I would suspect it has to do
with instance tags and child contexts, but it appears you're just using
OTRv2?

   - Ian


More information about the OTR-dev mailing list