将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

@@ -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)
{