On Mon, 26 Jun 2006, Darryl Miles wrote:
Bodo Moeller wrote:
When using SSL_write() over a non-blocking transport channel, you may
have to call SSL_write() multiple times until all your data has been
transferred. In this case, the data buffer needs to stay constant
between calls until SSL_write() finally returns a positive number
since (unless you are using SSL_MODE_ENABLE_PARTIAL_WRITE) some of the
calls to SSL_write() may read some of your data, and if the buffer
changes, you might end up inadvertantly transferring incoherent data.
To help detect such potential application bugs, OpenSSL includes a
simple sanity check -- if SSL_write() is called again but the data
buffer *location* has changed, OpenSSL suspects that this is a mistake
and returns an error.
Sorry, I deleted the Bodo's message, so I'm replying to Darryl.
Many years ago I had a program that reallocated the buffers when needed. I
analyzed the SSL code (I hope my messages are still somewhere in the
archive) and found out that in fact SSL layer reads the data only once. I
did not found any condition where data was read twice from input buffer.
Since then we have always set the SSL_MODE_ENABLE_PARTIAL_WRITE flag and
does the buffer reallocation as needed.
There is no need for the data buffer to stay constant between calls to
SSL_write.
Arne
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager [EMAIL PROTECTED]