Re: is there a good multiplexed I/O sample for BoringSSL?

173 views
Skip to first unread message

David Benjamin

unread,
Oct 29, 2015, 10:59:31 AM10/29/15
to james.j...@gmail.com, Security-dev
I haven't actually done much with the bssl tool's code, but it appears to be non-blocking at a glance.

The header file (alternatively the URL below) describes how things work, but it shouldn't be any different from OpenSSL. Various core operations may fail due to some input (transport, async callback, whatever) being unavailable. If they do, SSL_get_error tells you what to wait for before retrying.
https://commondatastorage.googleapis.com/chromium-boringssl-docs/ssl.h.html

On Thu, Oct 29, 2015 at 12:28 AM <james.j...@gmail.com> wrote:
I see there is a multiplexed I/O example for luvit at

https://github.com/luvit/openssl/blob/master/openssl/demos/easy_tls/easy-tls.c

Is there a good example like this for BoringSSL? The bssl tool is the only reference i've seen and it's not multiplexed. If no example, are there any possible incompatibilities to watch for?

I've also looked at Eric Rescorla's code:

https://github.com/smbutton/DataCommProject/blob/master/openssl-examples-20020110/openssl-examples-20020110/read_write.c

It seems to follow roughly the same logic to handle the SSL/network buffer impedance but it's circa 2002 so i'm leaning towards easy-tls.

thanks!

james.j...@gmail.com

unread,
Oct 29, 2015, 2:26:54 PM10/29/15
to Security-dev, james.j...@gmail.com
bssl is attractively simple, but i don't think it's multiplexing because of the way the client loops while reading from stdin:

do {
n = read(0, buffer, sizeof(buffer));
} while (n == -1 && errno == EINTR);

Probably not a problem for interactive input.

No worries.. the Rescorla/easy-tls code seem ok so far..

james.j...@gmail.com

unread,
Oct 31, 2015, 9:53:21 AM10/31/15
to Security-dev, james.j...@gmail.com
Just an FYI, but "Network Security with OpenSSL" also gets into a bit of non-blocking IO.
Reply all
Reply to author
Forward
0 new messages