修改client hello解析函数,允许sni为空

This commit is contained in:
崔一鸣
2019-06-21 17:04:27 +08:00
parent b56d52a325
commit 88678844a5

View File

@@ -440,19 +440,11 @@ 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->min_version.major == 3 && _chello->min_version.minor == 0)
/* no extensions */
if(pos == buff_len)
{
if(pos == buff_len)
{
*result = CHELLO_PARSE_SUCCESS;
return _chello;
}
else
{
*result = CHELLO_PARSE_INVALID_FORMAT;
return _chello;
}
*result = CHELLO_PARSE_SUCCESS;
return _chello;
}
/* Extensions */
if (pos + 2 > buff_len)