summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryangwei <[email protected]>2023-06-26 17:31:14 +0800
committeryangwei <[email protected]>2023-06-26 17:31:14 +0800
commitfda2e4a435d7dbfce8d0ab1f2d02176255a77652 (patch)
tree15ee001347d3d5469631440e7169f67d759b32d7 /src
parentd55819b624a06fabe8729524b8e8b6aca3e0e92f (diff)
✨ feat(client hello extension): 支持识别ECH(扩展类型为0xFE0D),并增加测试用例v2.0.13
Diffstat (limited to 'src')
-rw-r--r--src/SSL_Proc.c4
-rw-r--r--src/ssl.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/SSL_Proc.c b/src/SSL_Proc.c
index 7277468..bea37aa 100644
--- a/src/SSL_Proc.c
+++ b/src/SSL_Proc.c
@@ -479,6 +479,10 @@ UCHAR ssl_doWithClientHello(ssl_stream **a_ssl_stream, struct streaminfo *a_tcp,
iUnAnaHelloLen -= (ESNILEN_LEN+(*a_ssl_stream)->stClientHello->encrypted_server_name.esni_len);
}
}
+ else if((*a_ssl_stream)->stClientHello->exts[i].type == ENCRPTED_CLIENT_HELLO_EXT_TYPE)
+ {
+ (*a_ssl_stream)->stClientHello->encrypt_chello = &(*a_ssl_stream)->stClientHello->exts[i];
+ }
}
return_val = ssl_callPlugins(a_ssl_stream, a_tcp, region_flag, thread_seq, a_packet);
diff --git a/src/ssl.h b/src/ssl.h
index 4448115..7e53cf2 100644
--- a/src/ssl.h
+++ b/src/ssl.h
@@ -106,6 +106,7 @@ typedef struct _st_esni_t
#define SERVER_NAME_OTHER_TYPE 0x0008
#define SESSION_TICKET_EXT_TYPE 0x0023
#define ENCRPTED_SERVER_NAME_EXT_TYPE 0xFFCE
+#define ENCRPTED_CLIENT_HELLO_EXT_TYPE 0xFE0D
/*important extension in clientHello: alpn(application_layer_protocol_negotiation) */
@@ -135,6 +136,7 @@ typedef struct _st_client_hello_t
unsigned char server_name[512]; // server_name = host_name+...
st_session_tciket_t session_ticket;
st_esni_t encrypted_server_name;
+ st_ext_t *encrypt_chello;
}st_client_hello_t;
//#############################################client hello end