On Fri, Mar 30, 2001 at 02:21:11PM -0800, John Denney wrote:
> The data you read was part of the ssl connect/accept handshake, which is
> now unavailable to SSL_accept. Don't read; do SSL_accept instead.
Yes, that is already 95% (and the most important part of the problem in
the example).
Additionally:
> > mypollfd.fd = connfd;
> > mypollfd.events = POLLIN;
> >
> > while (temp_ret != 1 && (error_code == SSL_ERROR_WANT_READ ||
> > error_code == SSL_ERROR_WANT_WRITE))
> > {
> > poll_ret = poll(&mypollfd, 1, 10000);
Here you additionally must take care, that WANT_READ indicates that more
data must be read from the socket (POLLIN) while WANT_WRITE indicates
that more data must be written to the socket (POLLOUT).
while ((temp_ret = SSL_accept(p_ssl)) == -1) {
switch (SSL_get_error(p_ssl, temp_ret)) {
case SSL_ERROR_WANT_READ:
poll for POLLIN;
case SSL_ERROR_WANT_WRITE:
poll for POLLOUT:
default:
hard_failure...
}
}
Best regards,
Lutz
--
Lutz Jaenicke [EMAIL PROTECTED]
BTU Cottbus http://www.aet.TU-Cottbus.DE/personen/jaenicke/
Lehrstuhl Allgemeine Elektrotechnik Tel. +49 355 69-4129
Universitaetsplatz 3-4, D-03044 Cottbus Fax. +49 355 69-4153
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]