TSG-7627: 解析加密GQUIC048 SNI导致watchdog timeout
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
#include "gquic_process.h"
|
||||
#include "quic_analysis.h"
|
||||
#include "parser-quic.h"
|
||||
#include "parser_quic.h"
|
||||
|
||||
int is_iquic(enum _QUIC_VERSION quic_version)
|
||||
{
|
||||
@@ -60,6 +60,32 @@ int is_iquic(enum _QUIC_VERSION quic_version)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int is_quic_port(struct streaminfo *pstream)
|
||||
{
|
||||
switch(pstream->addr.addrtype)
|
||||
{
|
||||
case ADDR_TYPE_IPV4:
|
||||
case __ADDR_TYPE_IP_PAIR_V4:
|
||||
if(ntohs(pstream->addr.ipv4->source)!=443 && ntohs(pstream->addr.ipv4->dest)!=443)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case ADDR_TYPE_IPV6:
|
||||
case __ADDR_TYPE_IP_PAIR_V6:
|
||||
if(ntohs(pstream->addr.ipv6->source)!=443 && ntohs(pstream->addr.ipv6->dest)!=443)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int get_value(unsigned char *payload, int *offset, int len)
|
||||
{
|
||||
switch(len)
|
||||
@@ -1108,7 +1134,7 @@ int quic_process(struct streaminfo *pstream, struct _quic_context* _context, int
|
||||
break;
|
||||
default:
|
||||
if( ((is_gquic>=MVFST_VERSION_00 && is_gquic<=MVFST_VERSION_0F) ||
|
||||
(is_gquic>=GQUIC_VERSION_Q047 && is_gquic<=GQUIC_VERSION_Q059) ||
|
||||
(is_gquic>=GQUIC_VERSION_Q049 && is_gquic<=GQUIC_VERSION_Q059) ||
|
||||
(is_gquic>=GQUIC_VERSION_T050 && is_gquic<=GQUIC_VERSION_T059) ||
|
||||
(is_gquic>=GQUIC_VERSION_T050 && is_gquic<=GQUIC_VERSION_T059) ||
|
||||
(is_gquic>=IQUIC_VERSION_I022 && is_gquic<=IQUIC_VERSION_I029) ||
|
||||
@@ -1166,6 +1192,11 @@ int quic_protocol_identify(struct streaminfo *a_stream, void *a_packet, char *ou
|
||||
void *pme=NULL;
|
||||
char *sni=NULL;
|
||||
struct _quic_context *_context=NULL;
|
||||
|
||||
if(!is_quic_port(a_stream))
|
||||
{
|
||||
return len;
|
||||
}
|
||||
|
||||
quic_init_stream(&pme, a_stream->threadnum);
|
||||
_context=(struct _quic_context *)pme;
|
||||
|
||||
Reference in New Issue
Block a user