Merge branch 'develop-ssh-identify' into develop-20.09

# Conflicts:
#	inc/tsg_rule.h
#	src/tsg_entry.cpp
#	src/tsg_rule.cpp
This commit is contained in:
liuxueli
2020-08-24 16:36:54 +08:00
5 changed files with 43 additions and 2 deletions

View File

@@ -19,6 +19,7 @@
#include "tsg_statistic.h"
#include "tsg_send_log_internal.h"
#include "tsg_ssl_utils.h"
#include "tsg_ssh_utils.h"
#ifdef __cplusplus
extern "C"
@@ -229,6 +230,9 @@ static char *schema_index2string(tsg_protocol_t proto)
case PROTO_QUIC:
schema_field_value=(char *)"QUIC";
break;
case PROTO_SSH:
schema_field_value=(char *)"SSH";
break;
default:
break;
}
@@ -421,7 +425,7 @@ static struct Maat_rule_t *tsg_policy_decision_criteria(struct streaminfo *a_str
static int identify_application_protocol(struct streaminfo *a_stream, struct _identify_info *identify_info, void *a_packet)
{
int ret=0;
identify_info->proto = PROTO_UNKONWN;
//http
char *host=NULL;
@@ -507,6 +511,13 @@ static int identify_application_protocol(struct streaminfo *a_stream, struct _id
return 1;
}
ret = ssh_protocol_identify((unsigned char *)a_stream->ptcpdetail->pdata, (unsigned int)a_stream->ptcpdetail->datalen,g_tsg_para.logger);
if(ret > 0)
{
identify_info->proto=PROTO_SSH;
return 1;
}
//ssh
//quic
ret=quic_protocol_identify(a_stream, a_packet, identify_info->domain, sizeof(identify_info->domain));
if(ret>0)