Re: [openssl-users] SSL_read, SSL_write error handling

2016-09-15 Thread Viktor Dukhovni
On Thu, Sep 15, 2016 at 07:18:52AM +0200, Alex Hultman wrote: > io_callback(events) { > if (messages_to_send && (events & OS_WRITABLE)) { > SSL_write(.); > if (error) { > if (error_is_want_read) { > system_poll &=

Re: [openssl-users] SSL_read, SSL_write error handling

2016-09-14 Thread Alex Hultman
I did find a very good explanation here: https://mta.openssl.org/pipermail/openssl-users/2015-March/000709.html The idea of "what SSL wants" and "what the app wants" is a very good explanation. This is the pseudocode I'm working with currently: io_callback(events) { if

Re: [openssl-users] SSL_read, SSL_write error handling

2016-09-14 Thread Viktor Dukhovni
On Thu, Sep 15, 2016 at 05:07:22AM +0200, Alex Hultman wrote: > If SSL_write returns the error SSL_ERROR_WANT_READ, am I then allowed to > call SSL_read before I have called SSL_write? WANT_READ means that OpenSSL *internally* needs to read some (often ciphertext) bytes from the peer, and that