fre 2002-07-12 klockan 09.36 skrev Bodo Moeller via RT:
> 
> Martin Sj�gren:
> 
> > When you write a zero-length string with SSL_write, OpenSSL signals a
> > "protocol-violating EOF" even though no such thing has happened. My
> > guess is that a zero returned is misinterpreted somewhere though I have
> > not had time to dig through the source.
> 
> SSL_write() with length 0 will return 0, and this return value is
> always interpreted as "protocol-violating EOF" according to the
> SSL_get_error() manpage (SSL_get_error() returns SSL_ERROR_ZERO_RETURN).
> This is an inconsistency, but even if we change SSL_write() to
> return a different value, the program will not work -- we cannot
> return a positive value, and negative values would be interpreted as
> errors too.

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

$ ./a.out
rand: 1
accept: 1
connect: 1
ERR_get_error=0; ret=0; err=5; errno=0

where err is the result of SSL_get_error.


I think you're losing me somewhere.

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 :(


Regards,
Martin

-- 
Martin Sj�gren
  [EMAIL PROTECTED]              ICQ : 41245059
  Phone: +46 (0)31 7710870       Cell: +46 (0)739 169191
  GPG key: http://www.strakt.com/~martin/gpg.html

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to