summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/ssl/s3_pkt.c
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-11-13 01:03:58 +0000
committerkris <kris@FreeBSD.org>2000-11-13 01:03:58 +0000
commit539b977eff7c71f628cb2a407543a51070b14763 (patch)
tree258f64877cac3711a3434257baddcbae72af2af3 /crypto/openssl/ssl/s3_pkt.c
parent893841d237b49d10e810e8b130839b4b63fd5ab4 (diff)
downloadFreeBSD-src-539b977eff7c71f628cb2a407543a51070b14763.zip
FreeBSD-src-539b977eff7c71f628cb2a407543a51070b14763.tar.gz
Initial import of OpenSSL 0.9.6
Diffstat (limited to 'crypto/openssl/ssl/s3_pkt.c')
-rw-r--r--crypto/openssl/ssl/s3_pkt.c54
1 files changed, 29 insertions, 25 deletions
diff --git a/crypto/openssl/ssl/s3_pkt.c b/crypto/openssl/ssl/s3_pkt.c
index eb96531..1414079 100644
--- a/crypto/openssl/ssl/s3_pkt.c
+++ b/crypto/openssl/ssl/s3_pkt.c
@@ -899,19 +899,21 @@ start:
return(-1);
}
- if (s->s3->rbuf.left == 0) /* no read-ahead left? */
+ if (!(s->mode & SSL_MODE_AUTO_RETRY))
{
- BIO *bio;
- /* In the case where we try to read application data
- * the first time, but we trigger an SSL handshake, we
- * return -1 with the retry option set. I do this
- * otherwise renegotiation can cause nasty problems
- * in the blocking world */ /* ? */
- s->rwstate=SSL_READING;
- bio=SSL_get_rbio(s);
- BIO_clear_retry_flags(bio);
- BIO_set_retry_read(bio);
- return(-1);
+ if (s->s3->rbuf.left == 0) /* no read-ahead left? */
+ {
+ BIO *bio;
+ /* In the case where we try to read application data,
+ * but we trigger an SSL handshake, we return -1 with
+ * the retry option set. Otherwise renegotiation may
+ * cause nasty problems in the blocking world */
+ s->rwstate=SSL_READING;
+ bio=SSL_get_rbio(s);
+ BIO_clear_retry_flags(bio);
+ BIO_set_retry_read(bio);
+ return(-1);
+ }
}
}
}
@@ -954,7 +956,7 @@ start:
s->rwstate=SSL_NOTHING;
s->s3->fatal_alert = alert_descr;
SSLerr(SSL_F_SSL3_READ_BYTES, SSL_AD_REASON_OFFSET + alert_descr);
- sprintf(tmp,"%d",alert_descr);
+ BIO_snprintf(tmp,sizeof tmp,"%d",alert_descr);
ERR_add_error_data(2,"SSL alert number ",tmp);
s->shutdown|=SSL_RECEIVED_SHUTDOWN;
SSL_CTX_remove_session(s->ctx,s->session);
@@ -1022,19 +1024,21 @@ start:
return(-1);
}
- if (s->s3->rbuf.left == 0) /* no read-ahead left? */
+ if (!(s->mode & SSL_MODE_AUTO_RETRY))
{
- BIO *bio;
- /* In the case where we try to read application data
- * the first time, but we trigger an SSL handshake, we
- * return -1 with the retry option set. I do this
- * otherwise renegotiation can cause nasty problems
- * in the blocking world */ /* ? */
- s->rwstate=SSL_READING;
- bio=SSL_get_rbio(s);
- BIO_clear_retry_flags(bio);
- BIO_set_retry_read(bio);
- return(-1);
+ if (s->s3->rbuf.left == 0) /* no read-ahead left? */
+ {
+ BIO *bio;
+ /* In the case where we try to read application data,
+ * but we trigger an SSL handshake, we return -1 with
+ * the retry option set. Otherwise renegotiation may
+ * cause nasty problems in the blocking world */
+ s->rwstate=SSL_READING;
+ bio=SSL_get_rbio(s);
+ BIO_clear_retry_flags(bio);
+ BIO_set_retry_read(bio);
+ return(-1);
+ }
}
goto start;
}
OpenPOWER on IntegriCloud