From 0db61c2a66612843209a1f6a56be11c1b4580780 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Sat, 15 Jun 2019 12:43:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=8B=A6=E6=88=AA=E7=AD=96?= =?UTF-8?q?=E7=95=A5=E4=B8=AD=E5=AD=97=E7=AC=A6=E4=B8=B2=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E7=9A=84keyring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/business/ssl-policy/src/ssl_policy.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/plugin/business/ssl-policy/src/ssl_policy.cpp b/plugin/business/ssl-policy/src/ssl_policy.cpp index b48c345..fb9dde7 100644 --- a/plugin/business/ssl-policy/src/ssl_policy.cpp +++ b/plugin/business/ssl-policy/src/ssl_policy.cpp @@ -81,7 +81,21 @@ void intercept_param_new_cb(int table_id, const char* key, const char* table_lin param->keyring=1; item=cJSON_GetObjectItem(json, "keyring"); - if(item && item->type==cJSON_Number) param->keyring=item->valueint; + if(item) + { + if(item->type==cJSON_Number) + { + param->keyring=item->valueint; + } + else if(item->type==cJSON_String) + { + param->keyring=atoi(item->valuestring); + } + else + { + TFE_LOG_ERROR(enforcer->logger, "Invalid intercept parameter: %d invalid keyring format", param->policy_id); + } + } exclusions=cJSON_GetObjectItem(json, "exclusions"); if(exclusions)