diff options
author | Bodo Möller <bodo@openssl.org> | 2000-02-20 23:35:31 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2000-02-20 23:35:31 +0000 |
commit | 45206340d3918de146864e43de83484cfb20691e (patch) | |
tree | 899a8172eb82353443a247c431f045b4f5c7ec4f /ssl | |
parent | b35e9050f282c5ea2164bd5b08ed34d03accf45f (diff) |
ignore Client Hellos when we're in handshake anyway
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/s3_both.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/ssl/s3_both.c b/ssl/s3_both.c index 6236b74572..4d8cafe2be 100644 --- a/ssl/s3_both.c +++ b/ssl/s3_both.c @@ -285,20 +285,34 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) if (s->state == st1) /* s->init_num < 4 */ { - while (s->init_num < 4) + int skip_message; + + do { - i=ssl3_read_bytes(s,SSL3_RT_HANDSHAKE,&p[s->init_num], - 4-s->init_num); - if (i <= 0) + while (s->init_num < 4) { - s->rwstate=SSL_READING; - *ok = 0; - return i; + i=ssl3_read_bytes(s,SSL3_RT_HANDSHAKE,&p[s->init_num], + 4-s->init_num); + if (i <= 0) + { + s->rwstate=SSL_READING; + *ok = 0; + return i; + } + s->init_num+=i; } - s->init_num+=i; + + skip_message = 0; + if (!s->server) + if (p[0] == SSL3_MT_HELLO_REQUEST) + /* The server may always send 'Hello Request' messages -- + * we are doing a handshake anyway now, so ignore them + * if their format is correct */ + if (p[1] == 0 && p[2] == 0 &&p[3] == 0) + skip_message = 1; } + while (skip_message); -/* XXX server may always send Hello Request */ if ((mt >= 0) && (*p != mt)) { al=SSL_AD_UNEXPECTED_MESSAGE; |