<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2015-06-05 20:18 GMT+02:00 Matt Caswell <span dir="ltr"><<a href="mailto:matt@openssl.org" target="_blank">matt@openssl.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I see you got it working! Just some comments below<br>
<span class=""><br>
On 05/06/15 12:34, Lorenzo Miniero wrote:<br>
> I've started looking into filters and I have some doubts, though, also<br>
> taking into account what you suggested, and I apologize again if this<br>
> turns out to be silly. As far as I've understood, what I should do is<br>
> changing the current pattern I use for outgoing packets:<br>
><br>
>       application < memBIO < ssl<br>
><br>
> to something like this:<br>
><br>
>       application < memBIO < filter < ssl<br>
><br>
> or this:<br>
><br>
>       application < filter < memBIO < ssl<br>
><br>
> that is, a new BIO filter that enforces the fragmentation I talked<br>
> about. Not exactly sure about which one should be the way to go, but<br>
> I've given this some thought.<br>
<br>
</span>I took a very brief look at your code and I see you went with the first<br>
option. That's fine, although I would have done it slightly differently:<br>
<br>
application <--   -- ssl<br>
              |   |<br>
              |   V<br>
              filter<br>
              ^   V<br>
              memBIO<br>
<br>
i.e. the filter does all the reading and writing to the memBIO. libssl<br>
calls BIO_write(), the filter takes note of the packet sizes, and then<br>
writes to the membBIO. When the application wants to read data it calls<br>
BIO_read on the filter, and the filter figures out how big the packet<br>
needs to be and reads that amount out of the memBIO. Your way works too<br>
though.<br>
<div class="HOEnZb"><div class="h5"><br>
Matt<br></div></div></blockquote><div><br></div><div><br></div><div>Ah I didn't know that was an option: I'm quite unfamiliar with how BIO filters worked, and so I just went with what made sense to me while experimenting with them. I'll try doing something along the lines you suggested as soon as I have some time, thanks!</div><div><br></div><div>Lorenzo</div><div> </div></div></div></div>