修正 ssl_svc_client_st_mk_key() 返回的 hash_key_sz

This commit is contained in:
luwenpeng
2019-08-15 13:15:54 +08:00
parent 9c8bc53d28
commit 1f7a32f7f5

View File

@@ -137,7 +137,7 @@ static size_t ssl_svc_client_st_mk_key(const struct ssl_chello* chello, const st
key_len=snprintf(key_buff, sz, "%s:", sip); key_len=snprintf(key_buff, sz, "%s:", sip);
chello_id_len=ssl_svc_app_st_mk_key(chello, addr, chello_id_buff, sizeof(chello_id_buff)); chello_id_len=ssl_svc_app_st_mk_key(chello, addr, chello_id_buff, sizeof(chello_id_buff));
memcpy(key_buff+key_len, chello_id_buff, MIN(chello_id_len, sz-key_len)); memcpy(key_buff+key_len, chello_id_buff, MIN(chello_id_len, sz-key_len));
key_len+=chello_id_len; key_len += MIN(chello_id_len, sz-key_len);
free(addr_str); free(addr_str);
return key_len; return key_len;
@@ -378,7 +378,7 @@ struct ssl_service_cache* ssl_service_cache_create(unsigned int slot_size, unsig
cache->fail_as_cli_pinning_count=fail_as_pinning_cnt; cache->fail_as_cli_pinning_count=fail_as_pinning_cnt;
cache->fail_as_proto_err_count=fail_as_proto_err_cnt; cache->fail_as_proto_err_count=fail_as_proto_err_cnt;
cache->fail_time_window=fail_time_win; cache->fail_time_window=fail_time_win;
cache->succ_as_app_not_pinning_count=4;//TODO: read from profile. cache->succ_as_app_not_pinning_count=SUCC_AS_APP_NOT_PINNING;//TODO: read from profile.
void (*free_func[])(void *)={ssl_svc_free_client_st, ssl_svc_free_server_st, ssl_svc_free_app_st}; void (*free_func[])(void *)={ssl_svc_free_client_st, ssl_svc_free_server_st, ssl_svc_free_app_st};
for(i=0; i<3; i++) for(i=0; i<3; i++)
{ {