1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

fixed possible future version bug

git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@45 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
cameronrich 2006-11-30 05:56:15 +00:00
parent ada6d5e41b
commit df2886ed07

View File

@ -1168,17 +1168,12 @@ int basic_read(SSL *ssl, uint8_t **in_data)
version = (buf[1] << 4) + buf[2]; version = (buf[1] << 4) + buf[2];
ssl->need_bytes = (buf[3] << 8) + buf[4]; ssl->need_bytes = (buf[3] << 8) + buf[4];
/* should be 3.1 (TLSv1) */ /* should be v3.1 (TLSv1) or better - we'll send in v3.1 mode anyway */
if (version != 0x31) if (version < 0x31)
{ {
/* if we are talking to a client that talks v3.2, then we'll wear ret = SSL_ERROR_INVALID_VERSION;
* it - we'll respond in v3.1 mode anyway. */ ssl_display_error(ret);
if (version < 0x31 || !IS_SET_SSL_FLAG(SSL_IS_CLIENT)) goto error;
{
ret = SSL_ERROR_INVALID_VERSION;
ssl_display_error(ret);
goto error;
}
} }
CLR_SSL_FLAG(SSL_NEED_RECORD); CLR_SSL_FLAG(SSL_NEED_RECORD);