mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
Fix for version (take 2)
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@206 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
parent
8558c49351
commit
1a19505e76
@ -122,19 +122,18 @@ static int process_client_hello(SSL *ssl)
|
|||||||
int i, j, cs_len, id_len, offset = 6 + SSL_RANDOM_SIZE;
|
int i, j, cs_len, id_len, offset = 6 + SSL_RANDOM_SIZE;
|
||||||
int ret = SSL_OK;
|
int ret = SSL_OK;
|
||||||
|
|
||||||
/* should be v3.1 (TLSv1) or better - we'll send in v3.1 mode anyway */
|
|
||||||
uint8_t version = (record_buf[1] << 4) + record_buf[2];
|
uint8_t version = (record_buf[1] << 4) + record_buf[2];
|
||||||
|
ssl->version = ssl->client_version = version;
|
||||||
|
|
||||||
if (version > SSL_PROTOCOL_VERSION)
|
if (version > SSL_PROTOCOL_VERSION)
|
||||||
version = SSL_PROTOCOL_VERSION;
|
ssl->version = SSL_PROTOCOL_VERSION; /* use client's version */
|
||||||
else if (version < SSL_PROTOCOL_MIN_VERSION)
|
else if (version < SSL_PROTOCOL_MIN_VERSION) /* old version supported? */
|
||||||
{
|
{
|
||||||
ret = SSL_ERROR_INVALID_VERSION;
|
ret = SSL_ERROR_INVALID_VERSION;
|
||||||
ssl_display_error(ret);
|
ssl_display_error(ret);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssl->version = ssl->client_version = version;
|
|
||||||
memcpy(ssl->dc->client_random, &buf[6], SSL_RANDOM_SIZE);
|
memcpy(ssl->dc->client_random, &buf[6], SSL_RANDOM_SIZE);
|
||||||
|
|
||||||
/* process the session id */
|
/* process the session id */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user