> Uh, the example code I whipped up doesn't give you
> SSL_ERROR_ZERO_RETURN, it gives you SSL_ERROR_SYSCALL.

Correct, my mistake.  I actually meant SSL_ERROR_SYSCALL
(SSL_ERROR_ZERO_RETURN means that the connection has been shut down
cleanly, and this return value would be totally incorrect in this
case).

> I'd say that the problem isn't as much in SSL_write as in
SSL_get_error.
> The error codes and success codes overlap :(

SSL_read() and SSL_write() are not really meant to be called with zero
length.  The return value cannot be larger than zero when this is
done, so SSL_get_error() will interpret the return value as an error
indication.

We could change SSL_read() and SSL_write() to return an actual error
when they are called with length 0, but this might break programs that
do such calls but don't rely on SSL_get_error() for them.  I suppose
it should be possible to change the implementations behind SSL_read()
and SSL_write() (i.e. ssl3_read() etc.) to use an extra flag for the
special case of zero length parameters so that SSL_get_error() will
indicate success unless there really was some kind of error, but I'm
not convinced this is worth the effort -- why call the functions with
length 0 anyway?
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to