修正对无拓展的tlsv1协议clienthello的解析时认为格式非法的问题。

This commit is contained in:
luqiuwen
2019-06-22 12:55:51 +08:00
parent 0475638ab9
commit 9b16502a30

View File

@@ -2318,20 +2318,14 @@ struct ssl_chello* ssl_chello_parse(const unsigned char* buff, size_t buff_len,
} }
len = (size_t)buff[pos]; len = (size_t)buff[pos];
pos += 1 + len; pos += 1 + len;
/* ssl 3.0, no extensions */
if(_chello->min_version.major == 3 && _chello->min_version.minor == 0) /* No extension */
{ if(pos == buff_len)
if(pos == buff_len) {
{ *result = CHELLO_PARSE_SUCCESS;
*result = CHELLO_PARSE_SUCCESS; return _chello;
return _chello; }
}
else
{
*result = CHELLO_PARSE_INVALID_FORMAT;
return _chello;
}
}
/* Extensions */ /* Extensions */
if (pos + 2 > buff_len) if (pos + 2 > buff_len)
{ {