diff options
| author | liuxueli <[email protected]> | 2023-06-29 18:09:32 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2023-07-04 10:37:49 +0800 |
| commit | dd82ba3f1c52f8ea5d4f263a4ccf9b253878d702 (patch) | |
| tree | 474afafede1a69a797ca6a332d54a399df47f63c /src | |
| parent | 060407d1cb6d348e6169db647a549ca51224c82c (diff) | |
适配SSL解析层头文件变化
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/tsg_bridge.cpp | 1 | ||||
| -rw-r--r-- | src/tsg_entry.cpp | 2 | ||||
| -rw-r--r-- | src/tsg_protocol.cpp | 25 | ||||
| -rw-r--r-- | src/tsg_variable.cpp | 6 |
5 files changed, 3 insertions, 33 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4eeece9..93f3482 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8) add_definitions(-fPIC) -set(SRC tsg_entry.cpp tsg_rule.cpp tsg_ssl_utils.cpp tsg_send_log.cpp tsg_statistic.cpp tsg_ssh_utils.cpp tsg_gtp_signaling.cpp tsg_action.cpp tsg_leaky_bucket.cpp tsg_dns.cpp tsg_icmp.cpp tsg_tamper.cpp tsg_bridge.cpp tsg_protocol.cpp tsg_sync_state.cpp tsg_variable.cpp tsg_proxy.cpp mpack.c tsg_stat.cpp) +set(SRC tsg_entry.cpp tsg_rule.cpp tsg_ssl_utils.cpp tsg_send_log.cpp tsg_statistic.cpp tsg_ssh_utils.cpp tsg_gtp_signaling.cpp tsg_action.cpp tsg_leaky_bucket.cpp tsg_dns.cpp tsg_icmp.cpp tsg_tamper.cpp tsg_bridge.cpp tsg_sync_state.cpp tsg_variable.cpp tsg_proxy.cpp mpack.c tsg_stat.cpp) include_directories(${CMAKE_SOURCE_DIR}/inc) include_directories(/opt/MESA/include/MESA/) diff --git a/src/tsg_bridge.cpp b/src/tsg_bridge.cpp index 1c3c8d3..cf7e754 100644 --- a/src/tsg_bridge.cpp +++ b/src/tsg_bridge.cpp @@ -13,7 +13,6 @@ extern int session_app_identify_result_cb(const struct streaminfo *a_stream, int bridge_id, void *data); extern int session_flags_identify_result_cb(const struct streaminfo *a_stream, int bridge_id, void *data); -extern int tm_get_ssl_ja3_fingerprint(const struct streaminfo *a_stream, char **ja3_fingerprint); extern int matched_service_chaining_rules_deal(const struct streaminfo *a_stream, struct maat_rule *s_chaining_rules, size_t n_s_chaining_rules, int thread_seq); extern int matched_shaping_rules_deal(const struct streaminfo * a_stream, struct maat_rule * shaping_results, size_t n_shaping_results, int thread_seq); diff --git a/src/tsg_entry.cpp b/src/tsg_entry.cpp index b6a0930..372082c 100644 --- a/src/tsg_entry.cpp +++ b/src/tsg_entry.cpp @@ -2011,7 +2011,7 @@ size_t session_pending_state_deal(const struct streaminfo *a_stream, struct sess if(srt_process_context->proto==PROTO_SSL) { - struct _ssl_ja3_info_t *ja3_info=ssl_get_ja3_fingerprint((struct streaminfo *)a_stream, (unsigned char *)a_stream->ptcpdetail->pdata, (unsigned int)a_stream->ptcpdetail->datalen, a_stream->threadnum); + struct ssl_ja3_info *ja3_info=ssl_get_ja3_fingerprint((struct streaminfo *)a_stream, (unsigned char *)a_stream->ptcpdetail->pdata, (unsigned int)a_stream->ptcpdetail->datalen, a_stream->threadnum); if(ja3_info!=NULL) { if(ja3_info->fp!=NULL && ja3_info->fp_len>0) diff --git a/src/tsg_protocol.cpp b/src/tsg_protocol.cpp deleted file mode 100644 index 9f0e448..0000000 --- a/src/tsg_protocol.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <stdint.h> - -#include <MESA/ssl.h> -#include <MESA/stream.h> - -int tm_get_ssl_ja3_fingerprint(const struct streaminfo *a_stream, char **ja3_fingerprint) -{ - struct _ssl_ja3_info_t *ja3_info=ssl_get_ja3_fingerprint((struct streaminfo *)a_stream, (unsigned char *)a_stream->ptcpdetail->pdata, (unsigned int)a_stream->ptcpdetail->datalen, a_stream->threadnum); - if(ja3_info!=NULL) - { - if(ja3_info->fp!=NULL && ja3_info->fp_len>0) - { - *ja3_fingerprint=(char *)dictator_malloc(a_stream->threadnum, ja3_info->fp_len+1); - memset(*ja3_fingerprint, 0, ja3_info->fp_len+1); - memcpy(*ja3_fingerprint, ja3_info->fp, ja3_info->fp_len); - return 1; - } - } - - return 0; -} - diff --git a/src/tsg_variable.cpp b/src/tsg_variable.cpp index 207a00d..b853bed 100644 --- a/src/tsg_variable.cpp +++ b/src/tsg_variable.cpp @@ -61,11 +61,7 @@ unsigned int tsg_l7_protocol_name2id(const char *l7_protocol_name, unsigned int long long tsg_get_current_time_ms(void) { - int size=sizeof(long long); - long long current_time_ms=0; - sapp_get_platform_opt(SPO_CURTIME_TIMET_MS, ¤t_time_ms, &size); - - return current_time_ms; + return get_timestamp_ms(); } unsigned long long tsg_get_stream_trace_id(const struct streaminfo * a_stream) |
