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:
parent
ada6d5e41b
commit
df2886ed07
15
ssl/tls1.c
15
ssl/tls1.c
@ -1168,17 +1168,12 @@ int basic_read(SSL *ssl, uint8_t **in_data)
|
||||
version = (buf[1] << 4) + buf[2];
|
||||
ssl->need_bytes = (buf[3] << 8) + buf[4];
|
||||
|
||||
/* should be 3.1 (TLSv1) */
|
||||
if (version != 0x31)
|
||||
/* should be v3.1 (TLSv1) or better - we'll send in v3.1 mode anyway */
|
||||
if (version < 0x31)
|
||||
{
|
||||
/* if we are talking to a client that talks v3.2, then we'll wear
|
||||
* it - we'll respond in v3.1 mode anyway. */
|
||||
if (version < 0x31 || !IS_SET_SSL_FLAG(SSL_IS_CLIENT))
|
||||
{
|
||||
ret = SSL_ERROR_INVALID_VERSION;
|
||||
ssl_display_error(ret);
|
||||
goto error;
|
||||
}
|
||||
ret = SSL_ERROR_INVALID_VERSION;
|
||||
ssl_display_error(ret);
|
||||
goto error;
|
||||
}
|
||||
|
||||
CLR_SSL_FLAG(SSL_NEED_RECORD);
|
||||
|
Loading…
x
Reference in New Issue
Block a user