From 7bbe8b9c58f9523be19a5ba65d324814eb23258f Mon Sep 17 00:00:00 2001 From: Lai Zenan Date: Mon, 9 Sep 2024 04:25:16 +0800 Subject: [PATCH] fix: remove fileGet in subexport.cpp for security issue --- scripts/build.windows.release.sh | 2 +- src/generator/config/subexport.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/build.windows.release.sh b/scripts/build.windows.release.sh index a73904c13..129ce94cb 100644 --- a/scripts/build.windows.release.sh +++ b/scripts/build.windows.release.sh @@ -38,7 +38,7 @@ cmake -DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD make install -j4 cd .. -git clone https://github.com/ToruNiina/toml11 --depth=1 +git clone https://github.com/ToruNiina/toml11 --branch v3.8.1 --depth=1 cd toml11 cmake -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" -DCMAKE_CXX_STANDARD=11 . make install -j4 diff --git a/src/generator/config/subexport.cpp b/src/generator/config/subexport.cpp index 20c8a265e..03916200e 100644 --- a/src/generator/config/subexport.cpp +++ b/src/generator/config/subexport.cpp @@ -514,7 +514,7 @@ void proxyToClash(std::vector &nodes, YAML::Node &yamlnode, const ProxyGr if (!x.Alpn.empty()) singleproxy["alpn"] = x.Alpn; if (!x.Ca.empty()) - singleproxy["ca-str"] = fileGet(x.Ca); + singleproxy["ca"] = x.Ca; if (!x.CaStr.empty()) singleproxy["ca-str"] = x.CaStr; if (x.RecvWindowConn) @@ -547,7 +547,7 @@ void proxyToClash(std::vector &nodes, YAML::Node &yamlnode, const ProxyGr if (!x.Alpn.empty()) singleproxy["alpn"] = x.Alpn; if (!x.Ca.empty()) - singleproxy["ca-str"] = fileGet(x.Ca); + singleproxy["ca"] = x.Ca; if (!x.CaStr.empty()) singleproxy["ca-str"] = x.CaStr; if (x.CWND) @@ -2370,7 +2370,7 @@ void proxyToSingBox(std::vector &nodes, rapidjson::Document &json, std::v if (!x.Ca.empty()) { rapidjson::Value ca_str; - ca_str.SetString(fileGet(x.Ca).c_str(), allocator); + ca_str.SetString(x.Ca.c_str(), allocator); tls.AddMember("certificate", ca_str, allocator); } if (!x.CaStr.empty()) @@ -2409,7 +2409,7 @@ void proxyToSingBox(std::vector &nodes, rapidjson::Document &json, std::v if (!x.Ca.empty()) { rapidjson::Value ca_str(rapidjson::kStringType); - ca_str.SetString(fileGet(x.Ca).c_str(), allocator); + ca_str.SetString(x.Ca.c_str(), allocator); tls.AddMember("certificate", ca_str, allocator); } if (!x.CaStr.empty())