diff options
| author | yangwei <[email protected]> | 2023-06-26 15:31:45 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2023-06-27 17:34:45 +0800 |
| commit | 2fda08dc43e8586855e934a11690ff2b78f5bfa7 (patch) | |
| tree | fda1bcb37a3f244da8a38ec989670ab1ae29129a | |
| parent | b1803031b730dcc7dbaf965f92a9ec55b7a66cbf (diff) | |
✨ feat(支持识别ECH): chello_parse_result增加is_encrypt_chello
| -rw-r--r-- | inc/tsg_ssl_utils.h | 3 | ||||
| -rw-r--r-- | src/tsg_ssl_utils.cpp | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/inc/tsg_ssl_utils.h b/inc/tsg_ssl_utils.h index 7eada60..8d9637a 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; + int is_encrypt_sni; + int is_encrypt_chello; }; struct ssl_chello* ssl_chello_parse(const unsigned char* buff, size_t buff_len, enum chello_parse_result* result); diff --git a/src/tsg_ssl_utils.cpp b/src/tsg_ssl_utils.cpp index ca1b3e2..86fd8d2 100644 --- a/src/tsg_ssl_utils.cpp +++ b/src/tsg_ssl_utils.cpp @@ -241,6 +241,10 @@ static enum chello_parse_result parse_extensions(const unsigned char* buff, size { chello->is_encrypt_sni = 1; } + if (buff[pos] == 0xfe && buff[pos + 1] == 0x0d)//identify encrypt chello + { + chello->is_encrypt_chello = 1; + } pos += (4 + len); } /* Check we ended where we expected to */ |
