change maat_plugin_table_get_ex_data() key type from uuid_t to uuid string
This commit is contained in:
@@ -286,7 +286,7 @@ int intercept_policy_select(struct intercept_policy_enforcer *enforcer, uuid_t *
|
|||||||
{
|
{
|
||||||
curr_rule_id = &rule_id_array[i];
|
curr_rule_id = &rule_id_array[i];
|
||||||
uuid_unparse(*curr_rule_id, str_rule_id);
|
uuid_unparse(*curr_rule_id, str_rule_id);
|
||||||
param = (struct intercept_param *)maat_plugin_table_get_ex_data(enforcer->maat, enforcer->table_name, (const char *)curr_rule_id, sizeof(uuid_t));
|
param = (struct intercept_param *)maat_plugin_table_get_ex_data(enforcer->maat, enforcer->table_name, (const char *)str_rule_id, strlen(str_rule_id));
|
||||||
if (param == NULL)
|
if (param == NULL)
|
||||||
{
|
{
|
||||||
TFE_LOG_INFO(enforcer->logger, "Failed to get intercept parameter of policy %s.", str_rule_id);
|
TFE_LOG_INFO(enforcer->logger, "Failed to get intercept parameter of policy %s.", str_rule_id);
|
||||||
@@ -353,7 +353,7 @@ int intercept_policy_enforce(struct intercept_policy_enforcer *enforcer, struct
|
|||||||
}
|
}
|
||||||
|
|
||||||
uuid_unparse(rule_id, str_rule_id);
|
uuid_unparse(rule_id, str_rule_id);
|
||||||
param = (struct intercept_param *)maat_plugin_table_get_ex_data(enforcer->maat, enforcer->table_name, (const char *)&rule_id, sizeof(uuid_t));
|
param = (struct intercept_param *)maat_plugin_table_get_ex_data(enforcer->maat, enforcer->table_name, (const char *)str_rule_id, strlen(str_rule_id));
|
||||||
if (param == NULL)
|
if (param == NULL)
|
||||||
{
|
{
|
||||||
TFE_LOG_INFO(enforcer->logger, "Failed to get intercept parameter of policy %s.", str_rule_id);
|
TFE_LOG_INFO(enforcer->logger, "Failed to get intercept parameter of policy %s.", str_rule_id);
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ void chaining_policy_enforce(struct chaining_policy_enforcer *enforcer, struct t
|
|||||||
}
|
}
|
||||||
|
|
||||||
uuid_unparse(*rule_id, str_rule_id);
|
uuid_unparse(*rule_id, str_rule_id);
|
||||||
struct chaining_param *param = (struct chaining_param *)maat_plugin_table_get_ex_data(enforcer->maat, enforcer->table_name, (const char *)rule_id, sizeof(uuid_t));
|
struct chaining_param *param = (struct chaining_param *)maat_plugin_table_get_ex_data(enforcer->maat, enforcer->table_name, (const char *)str_rule_id, strlen(str_rule_id));
|
||||||
if (param == NULL)
|
if (param == NULL)
|
||||||
{
|
{
|
||||||
TFE_LOG_INFO(enforcer->logger, "Failed to get chaining parameter of policy %s.", str_rule_id);
|
TFE_LOG_INFO(enforcer->logger, "Failed to get chaining parameter of policy %s.", str_rule_id);
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ enum ssl_stream_action ssl_policy_enforce(struct ssl_stream *upstream, void *u_p
|
|||||||
uuid_unparse(decrypted_uuid, decrypted_uuid_str);
|
uuid_unparse(decrypted_uuid, decrypted_uuid_str);
|
||||||
TFE_LOG_DEBUG(g_default_logger, "%s %s enforce policy %s", addr_string, sni, rule_uuid_str);
|
TFE_LOG_DEBUG(g_default_logger, "%s %s enforce policy %s", addr_string, sni, rule_uuid_str);
|
||||||
|
|
||||||
struct decryption_param *profile_param = (struct decryption_param *)maat_plugin_table_get_ex_data(enforcer->maat, "PXY_PROFILE_DECRYPTION", (const char *)&decrypted_uuid, sizeof(uuid_t));
|
struct decryption_param *profile_param = (struct decryption_param *)maat_plugin_table_get_ex_data(enforcer->maat, "PXY_PROFILE_DECRYPTION", (const char *)decrypted_uuid_str, strlen(decrypted_uuid_str));
|
||||||
if (profile_param == NULL)
|
if (profile_param == NULL)
|
||||||
{
|
{
|
||||||
TFE_LOG_INFO(g_default_logger, "Failed to get decryption parameter of profile %s.", decrypted_uuid_str);
|
TFE_LOG_INFO(g_default_logger, "Failed to get decryption parameter of profile %s.", decrypted_uuid_str);
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ int tcp_policy_enforce(struct tcp_policy_enforcer *tcp_enforcer, struct tfe_cmsg
|
|||||||
}
|
}
|
||||||
|
|
||||||
uuid_unparse(profile_uuid, profile_uuid_str);
|
uuid_unparse(profile_uuid, profile_uuid_str);
|
||||||
struct tcp_profile_param *param = (struct tcp_profile_param *)maat_plugin_table_get_ex_data(tcp_enforcer->maat, tcp_enforcer->table_name, (const char *)&profile_uuid, sizeof(uuid_t));
|
struct tcp_profile_param *param = (struct tcp_profile_param *)maat_plugin_table_get_ex_data(tcp_enforcer->maat, tcp_enforcer->table_name, (const char *)profile_uuid_str, strlen(profile_uuid_str));
|
||||||
if (param == NULL)
|
if (param == NULL)
|
||||||
{
|
{
|
||||||
TFE_LOG_INFO(tcp_enforcer->logger, "Failed to get tcp option parameter of profile %s.", profile_uuid_str);
|
TFE_LOG_INFO(tcp_enforcer->logger, "Failed to get tcp option parameter of profile %s.", profile_uuid_str);
|
||||||
|
|||||||
@@ -583,7 +583,7 @@ int traffic_mirror_on_open_cb(const struct tfe_stream * stream, unsigned int thr
|
|||||||
}
|
}
|
||||||
|
|
||||||
uuid_unparse(rule_uuid, rule_uuid_str);
|
uuid_unparse(rule_uuid, rule_uuid_str);
|
||||||
policy_ex_data = (struct policy_table_ex_data *)maat_plugin_table_get_ex_data(instance->maat_feather, "PXY_INTERCEPT_RULE", (const char *)&rule_uuid, sizeof(uuid_t));
|
policy_ex_data = (struct policy_table_ex_data *)maat_plugin_table_get_ex_data(instance->maat_feather, "PXY_INTERCEPT_RULE", (const char *)rule_uuid_str, strlen(rule_uuid_str));
|
||||||
if (!policy_ex_data || !policy_ex_data->enable)
|
if (!policy_ex_data || !policy_ex_data->enable)
|
||||||
{
|
{
|
||||||
goto detach;
|
goto detach;
|
||||||
@@ -610,7 +610,7 @@ int traffic_mirror_on_open_cb(const struct tfe_stream * stream, unsigned int thr
|
|||||||
if (policy_ex_data->is_profile_set)
|
if (policy_ex_data->is_profile_set)
|
||||||
{
|
{
|
||||||
uuid_unparse(policy_ex_data->profile_uuid, profile_uuid_str);
|
uuid_unparse(policy_ex_data->profile_uuid, profile_uuid_str);
|
||||||
profile_ex_data = (struct profile_table_ex_data *)maat_plugin_table_get_ex_data(instance->maat_feather, "TSG_PROFILE_TRAFFIC_MIRROR", (const char *)&policy_ex_data->profile_uuid, sizeof(uuid_t));
|
profile_ex_data = (struct profile_table_ex_data *)maat_plugin_table_get_ex_data(instance->maat_feather, "TSG_PROFILE_TRAFFIC_MIRROR", (const char *)profile_uuid_str, strlen(profile_uuid_str));
|
||||||
if (!profile_ex_data)
|
if (!profile_ex_data)
|
||||||
{
|
{
|
||||||
TFE_LOG_ERROR(instance->logger, "failed at getting policy %s's profile, profile id = %s, "
|
TFE_LOG_ERROR(instance->logger, "failed at getting policy %s's profile, profile id = %s, "
|
||||||
|
|||||||
Reference in New Issue
Block a user