[OTR-dev] Using libotr

Alex Burzyński alex.burzynski at gmail.com
Wed Mar 12 06:53:13 EDT 2014


Hi Martin,

On 12 March 2014 10:43, Martin Milata <b42-ml at srck.net> wrote:

> On Tue, Mar 11, 2014 at 23:33:37 +0000, Alex Burzyński wrote:
> > Hi Martin,
> >
> > Thanks for answering, but that triggers more questions!
> >
> > I'm trying to draw some use-cases for those different policies and decide
> > if they even should be exposed to the end-user.
>
> I can't think of a situation where you'd want to expose them to a chat
> application user. I'd even say that you should use
> OTRL_FRAGMENT_SEND_ALL unless you have a reason not to.
>

That's exactly what I was thinking, but was wondering why on earth
pidgin-otr is using ALL_BUT_LAST


>
> > So as I understand the fragmentation, the plain text is encrypted and
> then
> > split into fragments.
> >
> > And in my mind the app's inject_message callback merely sends the message
> > fragments to the other end, there shouldn't be any extra logic in there.
> > convert_msg looks like a place for that extra logic.
> >
> > So in case of ALL_BUT_LAST what else could the app do with the last
> > fragment other then send it? I'd imagine that without the last fragment
> the
> > message wouldn't be readable at all on Bob's end.
> >
> > Could you explain what that hook you've mentioned might want to do with
> > that last fragment?
>
> What I meant is that ALL_BUT_LAST is useful when writing plugin for
> existing application. Common pattern is that the plugin registers a
> callback/hook that the application calls whenever a message is sent:
>
> string on_message_send(string message_to_be_sent) {
>     ...
>     otrl_message_sending(..., &lastfragment, OTRL_FRAGMENT_SEND_ALL, ...);
>     ...
>     return lastfragment; // application expects the callback to return
>                          // modified message
> }
>
> Here's a real-world example where this might be useful:
> http://lists.cypherpunks.ca/pipermail/otr-users/2007-September/001124.html
>

Brilliant! That's exactly what I was after.

I was playing with setting max_message_size to rather low value and trying
to work out what the user might want to do with those fragments.


>
> Hope that makes some sense:)
> Martin
>
>
Thanks a lot!
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cypherpunks.ca/pipermail/otr-dev/attachments/20140312/33ad9b9e/attachment.html>


More information about the OTR-dev mailing list