summaryrefslogtreecommitdiffstats
path: root/ssl/s3_pkt.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-02-21 17:09:54 +0000
committerBodo Möller <bodo@openssl.org>2000-02-21 17:09:54 +0000
commita2a0158959e597188c10fbfeaf61888b2df2e587 (patch)
treea563afeb10919ce28f583523044924f6a817882f /ssl/s3_pkt.c
parente7ecc7d4ddcfc5d2a09dde220e3fc0b5e4b46289 (diff)
Fix some bugs and document others
Diffstat (limited to 'ssl/s3_pkt.c')
-rw-r--r--ssl/s3_pkt.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c
index e95dcd9461..32eda4e657 100644
--- a/ssl/s3_pkt.c
+++ b/ssl/s3_pkt.c
@@ -709,7 +709,6 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len)
int al,i,j,n,ret;
SSL3_RECORD *rr;
void (*cb)()=NULL;
- BIO *bio;
if (s->s3->rbuf.buf == NULL) /* Not initialized yet */
if (!ssl3_setup_buffers(s))
@@ -988,9 +987,15 @@ start:
if (((s->state&SSL_ST_MASK) == SSL_ST_OK) &&
!(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS))
{
+#if 0 /* worked only because C operator preferences are not as expected (and
+ * because this is not really needed for clients except for detecting
+ * protocol violations): */
s->state=SSL_ST_BEFORE|(s->server)
?SSL_ST_ACCEPT
:SSL_ST_CONNECT;
+#else
+ s->state = s->server ? SSL_ST_ACCEPT : SSL_ST_CONNECT;
+#endif
s->new_session=1;
}
n=s->handshake_func(s);
@@ -1001,11 +1006,20 @@ start:
return(-1);
}
+#if 1 /* probably nonsense (does not work with readahead),
+ * but keep it for now anyway ... s_server relies on this */
+ {
+ 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 non-blocking world */
+ * in the non-blocking world */ /* That's "non-non-blocking",
+ * I guess? When receiving a
+ * Hello Request, we have the
+ * same problem (e.g. in s_client),
+ * but it's really an application bug.
+ */
s->rwstate=SSL_READING;
bio=SSL_get_rbio(s);
@@ -1013,6 +1027,10 @@ start:
BIO_set_retry_read(bio);
return(-1);
}
+#else
+ goto start;
+#endif
+ }
switch (rr->type)
{
@@ -1041,7 +1059,7 @@ start:
* but have application data. If the library was
* running inside ssl3_read() (i.e. in_read_app_data
* is set) and it makes sense to read application data
- * at this point (session renegotation not yet started),
+ * at this point (session renegotiation not yet started),
* we will indulge it.
*/
if (s->s3->in_read_app_data &&