From 4c23caa45135dd326331a0664b32027bb944d9a3 Mon Sep 17 00:00:00 2001 From: fengweihao Date: Sat, 1 Jun 2019 17:39:12 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9keyring=5Fid=E8=A1=A8?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E8=AF=BB=E5=8F=96=E6=8E=A5=E5=8F=A3=202.?= =?UTF-8?q?=E4=BF=AE=E6=94=B9table=5Finfo.conf=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/table_info.conf | 2 +- src/cert_session.c | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/conf/table_info.conf b/conf/table_info.conf index 2b202ff..69dca58 100644 --- a/conf/table_info.conf +++ b/conf/table_info.conf @@ -17,4 +17,4 @@ #id name type src_charset dst_charset do_merge cross_cache quick_mode 1 COMPILE compile 2 GROUP group -3 PXY_PROFILE_KEYRING plugin {"key":1,"valid":11,"foreign":"11,12"} +3 PXY_PROFILE_KEYRING plugin {"key":1,"valid":9,"foreign":"4,5"} diff --git a/src/cert_session.c b/src/cert_session.c index be75207..e773724 100644 --- a/src/cert_session.c +++ b/src/cert_session.c @@ -827,8 +827,10 @@ long __attribute__((__unused__))argl, void __attribute__((__unused__))*argp) pxy_obj->ref_cnt--; if (pxy_obj->ref_cnt == 0) { - X509_free(pxy_obj->root); - EVP_PKEY_free(pxy_obj->key); + if (pxy_obj->root) + X509_free(pxy_obj->root); + if (pxy_obj->key) + EVP_PKEY_free(pxy_obj->key); kfree(&pxy_obj); *ad=NULL; } @@ -2022,7 +2024,7 @@ const char* table_line, MAAT_PLUGIN_EX_DATA* ad, long __attribute__((__unused__) char private_file[CT_STRING_MAX] = {0}, public_file[CT_STRING_MAX]={0}; char __attribute__((__unused__))_priv_file[CT_PATH_MAX] = {0}; char __attribute__((__unused__))_publi_file[CT_PATH_MAX] = {0}; - int service = 0, ret=0; + int ret=0; struct pxy_obj_keyring *pxy_obj = NULL; @@ -2036,10 +2038,10 @@ const char* table_line, MAAT_PLUGIN_EX_DATA* ad, long __attribute__((__unused__) pxy_obj->ref_cnt = 1; - ret=sscanf(table_line, "%d\t%d\t%s\t%s\t%s\t%s\t%lu\t%s\t%s\t%d\t%s\t%s", &pxy_obj->keyring_id, &service, profile_name, - pxy_obj->keyring_type, _priv_file, _publi_file, &pxy_obj->expire_after, pxy_obj->public_algo, - pxy_obj->v3_ctl, &pxy_obj->is_valid, private_file, public_file); - if(ret!=12) + ret=sscanf(table_line, "%d\t%s\t%s\t%s\t%s\t%lu\t%s\t%s\t%d", &pxy_obj->keyring_id, profile_name, + pxy_obj->keyring_type, private_file, public_file, &pxy_obj->expire_after, pxy_obj->public_algo, + pxy_obj->v3_ctl, &pxy_obj->is_valid); + if(ret!=9) { kfree(&pxy_obj); mesa_runtime_log(RLOG_LV_FATAL, MODULE_NAME, "certstore parse config failed: %s", table_line);