From a339d39ee37504b45182200671dfaa1c775ad3e3 Mon Sep 17 00:00:00 2001 From: yangwei Date: Thu, 8 Apr 2021 18:08:21 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8feat(tsg=5Fssl=5Futils):=20client=20he?= =?UTF-8?q?llo=E8=AF=86=E5=88=AB=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E4=B8=BAesni=E7=9A=84=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/tsg_ssl_utils.h | 3 ++- src/tsg_ssl_utils.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/inc/tsg_ssl_utils.h b/inc/tsg_ssl_utils.h index 5da3bcf..7eada60 100644 --- a/inc/tsg_ssl_utils.h +++ b/inc/tsg_ssl_utils.h @@ -29,7 +29,8 @@ struct ssl_chello char* alpn; char* cipher_suites; char* cipher_suites_tls13; + long long is_encrypt_sni; }; struct ssl_chello* ssl_chello_parse(const unsigned char* buff, size_t buff_len, enum chello_parse_result* result); -void ssl_chello_free(struct ssl_chello* chello); \ No newline at end of file +void ssl_chello_free(struct ssl_chello* chello); diff --git a/src/tsg_ssl_utils.cpp b/src/tsg_ssl_utils.cpp index 5aed2a9..5e86cfd 100644 --- a/src/tsg_ssl_utils.cpp +++ b/src/tsg_ssl_utils.cpp @@ -236,6 +236,10 @@ static enum chello_parse_result parse_extensions(const unsigned char* buff, size return result; } } + if (buff[pos] == 0xff && buff[pos + 1] == 0xce)//identify encrypt sni + { + chello->is_encrypt_sni = 1; + } pos += (4 + len); } /* Check we ended where we expected to */