将client hello中的签名算法、EC算法增加到客户端标志。

This commit is contained in:
zhengchao
2019-05-24 20:42:19 +08:00
parent 75208aad0f
commit eba9031b86
3 changed files with 20 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
add_executable(tfe src/key_keeper.cpp src/kni_acceptor.cpp src/ssl_stream.cpp
src/ssl_sess_cache.cpp src/ssl_service_cache.cpp
src/ssl_sess_cache.cpp src/ssl_sess_ticket.cpp src/ssl_service_cache.cpp
src/ssl_trusted_cert_storage.cpp src/ev_root_ca_metadata.cpp src/ssl_utils.cpp
src/tcp_stream.cpp src/main.cpp src/proxy.cpp)

View File

@@ -67,11 +67,26 @@ static void ssl_svc_free_server_st(void * data)
static size_t ssl_svc_client_st_mk_key(const struct ssl_chello* chello, char* key_buff, size_t sz)
{
size_t key_sz=0;
key_sz=snprintf(key_buff, sz, "%d.%d-%d.%d:%s:%s:%s:%s", chello->min_version.major, chello->min_version.minor,
size_t key_len=0;
key_len=snprintf(key_buff, sz, "%d.%d-%d.%d:%s:%s:%s:", chello->min_version.major, chello->min_version.minor,
chello->max_version.major, chello->max_version.minor,
chello->sni, chello->alpn, chello->cipher_suites, chello->cipher_suites_tls13);
return key_sz;
chello->sni, chello->alpn?chello->alpn:"null");
if(chello->cipher_suites && sz-key_len>chello->cipher_suites_len)
{
memcpy(key_buff+key_len, chello->cipher_suites, chello->cipher_suites_len);
key_len+=chello->cipher_suites_len;
}
if(chello->sign_algos && sz-key_len > chello->sign_algos_len)
{
memcpy(key_buff+key_len, chello->sign_algos, chello->sign_algos_len);
key_len+=chello->sign_algos_len;
}
if(chello->supported_groups && sz-key_len > chello->supported_groups_len)
{
memcpy(key_buff+key_len, chello->supported_groups, chello->supported_groups_len);
key_len+=chello->supported_groups_len;
}
return key_len;
}
static long cli_st_read_cb(void * data, const uchar * key, uint size, void * user_arg)
{

View File

@@ -1920,7 +1920,6 @@ static int parse_extensions(const unsigned char *buff, uint16_t buff_len, struct
struct ssl_chello* ssl_chello_parse(const unsigned char* buff, size_t buff_len, int parse_cipher, enum chello_parse_result* result)
{
int n=0;
if(buff == NULL)
{
*result = CHELLO_PARSE_INVALID_FORMAT;
@@ -1995,18 +1994,6 @@ struct ssl_chello* ssl_chello_parse(const unsigned char* buff, size_t buff_len,
return NULL;
}
struct ssl_version min_version;
struct ssl_version max_version;
char *sni;
char *alpn;
char *sign_algos;
uint16_t sign_algos_len;
char *supported_groups;
uint16_t supported_groups_len;
char *cipher_suites;
uint16_t cipher_suites_len;
struct ssl_chello* _chello = (struct ssl_chello*)ALLOC(struct ssl_chello, 1);
_chello->min_version.major = buff[1];
_chello->min_version.minor = buff[2];