This commit is contained in:
崔一鸣
2018-09-14 14:09:37 +08:00
committed by zhengchao
parent c1f8edb75f
commit aa4d83e464
3 changed files with 23 additions and 20 deletions

View File

@@ -1941,7 +1941,7 @@ struct ssl_chello* ssl_chello_parse(const unsigned char* buff, size_t buff_len,
if(buff[0] == 0x80)
{
struct ssl_chello* _chello = (struct ssl_chello*)ALLOC(struct ssl_chello, 1);
_chello->record_layer_version.major = 0x02;
_chello->min_version.major = 0x02;
if(buff_len < 2)
{
*result = PARSE_CHELLO_NOT_ENOUGH_BUFF;
@@ -1973,8 +1973,8 @@ struct ssl_chello* ssl_chello_parse(const unsigned char* buff, size_t buff_len,
*result = PARSE_CHELLO_INVALID_FORMAT;
return _chello;
}
_chello->chello_version.major = buff[pos];
_chello->chello_version.minor = buff[pos + 1];
_chello->max_version.major = buff[pos];
_chello->max_version.minor = buff[pos + 1];
*result = PARSE_CHELLO_SUCCESS;
return _chello;
}
@@ -1991,10 +1991,10 @@ struct ssl_chello* ssl_chello_parse(const unsigned char* buff, size_t buff_len,
return NULL;
}
struct ssl_chello* _chello = (struct ssl_chello*)ALLOC(struct ssl_chello, 1);
_chello->record_layer_version.major = buff[1];
_chello->record_layer_version.minor = buff[2];
_chello->chello_version.major = -1;
_chello->chello_version.minor = -1;
_chello->min_version.major = buff[1];
_chello->min_version.minor = buff[2];
_chello->max_version.major = -1;
_chello->max_version.minor = -1;
_chello->sni = NULL;
_chello->alpn = NULL;
_chello->cipher_suites = NULL;
@@ -2024,8 +2024,8 @@ struct ssl_chello* ssl_chello_parse(const unsigned char* buff, size_t buff_len,
*result = PARSE_CHELLO_INVALID_FORMAT;
return _chello;
}
_chello->chello_version.major = buff[pos];
_chello->chello_version.minor = buff[pos+1];
_chello->max_version.major = buff[pos];
_chello->max_version.minor = buff[pos+1];
pos += 34;
/* Session ID */
if (pos + 1 > buff_len)
@@ -2070,7 +2070,7 @@ struct ssl_chello* ssl_chello_parse(const unsigned char* buff, size_t buff_len,
len = (size_t)buff[pos];
pos += 1 + len;
/* ssl 3.0, no extensions */
if(_chello->record_layer_version.major == 3 && _chello->record_layer_version.minor == 0)
if(_chello->min_version.major == 3 && _chello->min_version.minor == 0)
{
if(pos == buff_len)
{