delete insecure hint

This commit is contained in:
arm64v8a
2023-04-24 14:21:06 +09:00
parent 923f15e69c
commit bc9c5799b1
16 changed files with 8 additions and 122 deletions

View File

@@ -170,7 +170,6 @@ set(PROJECT_SOURCES
fmt/Bean2CoreObj_box.cpp fmt/Bean2CoreObj_box.cpp
fmt/Bean2External.cpp fmt/Bean2External.cpp
fmt/Bean2Link.cpp fmt/Bean2Link.cpp
fmt/InsecureHint.cpp
fmt/Link2Bean.cpp fmt/Link2Bean.cpp
fmt/ChainBean.hpp # translate fmt/ChainBean.hpp # translate

View File

@@ -63,10 +63,6 @@ namespace NekoRay::fmt {
virtual ExternalBuildResult BuildExternal(int mapping_port, int socks_port, int external_stat) { return {}; }; virtual ExternalBuildResult BuildExternal(int mapping_port, int socks_port, int external_stat) { return {}; };
virtual QString ToShareLink() { return {}; }; virtual QString ToShareLink() { return {}; };
virtual QString InsecureHint() { return {}; };
QString DisplayInsecureHint();
}; };
} // namespace NekoRay::fmt } // namespace NekoRay::fmt

View File

@@ -1,61 +0,0 @@
#include "V2RayStreamSettings.hpp"
#include "ShadowSocksBean.hpp"
#include "VMessBean.hpp"
#include "TrojanVLESSBean.hpp"
#include "SocksHttpBean.hpp"
namespace NekoRay::fmt {
QString AbstractBean::DisplayInsecureHint() {
if (!dataStore->insecure_hint) return {};
auto insecure_hint = InsecureHint();
auto stream = GetStreamSettings(this);
if (stream != nullptr) insecure_hint += "\n" + stream->InsecureHint();
return insecure_hint.trimmed();
}
QString V2rayStreamSettings::InsecureHint() const {
if (allow_insecure) {
return QObject::tr("The configuration (insecure) can be detected and identified, the transmission is fully visible to the censor and is not resistant to man-in-the-middle tampering with the content of the communication.");
}
return {};
}
QString ShadowSocksBean::InsecureHint() {
if (method.contains("-poly") || method.contains("-gcm")) {
return {};
}
return QObject::tr(
"This configuration (Shadowsocks streaming cipher) can be accurately proactively detected and decrypted by censors without requiring a password, and cannot be mitigated by turning on IV replay filters on the server side.\n"
"\n"
"Learn more: https://github.com/net4people/bbs/issues/24");
}
QString VMessBean::InsecureHint() {
if (security == "none" || security == "zero") {
if (stream->security.isEmpty()) {
return QObject::tr("This profile is cleartext, don't use it if the server is not in your local network.");
}
}
if (aid > 0) {
return QObject::tr(
"This configuration (VMess MD5 authentication) has been deprecated by upstream because of its questionable resistance to tampering and concealment.\n"
"\n"
"As of January 1, 2022, compatibility with MD5 authentication information will be disabled on the server side by default. Any client using MD5 authentication information will not be able to connect to a server with VMess MD5 authentication information disabled.");
}
return {};
}
QString TrojanVLESSBean::InsecureHint() {
if (stream->security.isEmpty()) {
return QObject::tr("This profile is cleartext, don't use it if the server is not in your local network.");
}
return {};
}
QString SocksHttpBean::InsecureHint() {
if (stream->security.isEmpty()) {
return QObject::tr("This profile is cleartext, don't use it if the server is not in your local network.");
}
return {};
}
} // namespace NekoRay::fmt

View File

@@ -28,7 +28,5 @@ namespace NekoRay::fmt {
bool TryParseLink(const QString &link); bool TryParseLink(const QString &link);
QString ToShareLink() override; QString ToShareLink() override;
QString InsecureHint() override;
}; };
} // namespace NekoRay::fmt } // namespace NekoRay::fmt

View File

@@ -33,7 +33,5 @@ namespace NekoRay::fmt {
bool TryParseLink(const QString &link); bool TryParseLink(const QString &link);
QString ToShareLink() override; QString ToShareLink() override;
QString InsecureHint() override;
}; };
} // namespace NekoRay::fmt } // namespace NekoRay::fmt

View File

@@ -31,7 +31,5 @@ namespace NekoRay::fmt {
bool TryParseLink(const QString &link); bool TryParseLink(const QString &link);
QString ToShareLink() override; QString ToShareLink() override;
QString InsecureHint() override;
}; };
} // namespace NekoRay::fmt } // namespace NekoRay::fmt

View File

@@ -47,8 +47,6 @@ namespace NekoRay::fmt {
QJsonObject BuildStreamSettingsV2Ray(); QJsonObject BuildStreamSettingsV2Ray();
void BuildStreamSettingsSingBox(QJsonObject *outbound); void BuildStreamSettingsSingBox(QJsonObject *outbound);
[[nodiscard]] QString InsecureHint() const;
}; };
inline V2rayStreamSettings *GetStreamSettings(AbstractBean *bean) { inline V2rayStreamSettings *GetStreamSettings(AbstractBean *bean) {

View File

@@ -28,7 +28,5 @@ namespace NekoRay::fmt {
bool TryParseLink(const QString &link); bool TryParseLink(const QString &link);
QString ToShareLink() override; QString ToShareLink() override;
QString InsecureHint() override;
}; };
} // namespace NekoRay::fmt } // namespace NekoRay::fmt

View File

@@ -47,7 +47,6 @@ namespace NekoRay {
_add(new configItem("remember_enable", &remember_enable, itemType::boolean)); _add(new configItem("remember_enable", &remember_enable, itemType::boolean));
_add(new configItem("language", &language, itemType::integer)); _add(new configItem("language", &language, itemType::integer));
_add(new configItem("spmode", &remember_spmode, itemType::integer)); _add(new configItem("spmode", &remember_spmode, itemType::integer));
_add(new configItem("insecure_hint", &insecure_hint, itemType::boolean));
_add(new configItem("skip_cert", &skip_cert, itemType::boolean)); _add(new configItem("skip_cert", &skip_cert, itemType::boolean));
_add(new configItem("hk_mw", &hotkey_mainwindow, itemType::string)); _add(new configItem("hk_mw", &hotkey_mainwindow, itemType::string));
_add(new configItem("hk_group", &hotkey_group, itemType::string)); _add(new configItem("hk_group", &hotkey_group, itemType::string));

View File

@@ -99,7 +99,6 @@ namespace NekoRay {
bool sub_insecure = false; bool sub_insecure = false;
// Security // Security
bool insecure_hint = true;
bool skip_cert = false; bool skip_cert = false;
int enable_js_hook = 0; int enable_js_hook = 0;
QString utlsFingerprint = ""; QString utlsFingerprint = "";

View File

@@ -102,7 +102,7 @@
</message> </message>
<message> <message>
<source>Insecure hint</source> <source>Insecure hint</source>
<translation>اشاره ناامن</translation> <translation type="vanished">اشاره ناامن</translation>
</message> </message>
<message> <message>
<source>Statistics refresh rate</source> <source>Statistics refresh rate</source>
@@ -1328,7 +1328,7 @@ End: %2</source>
</message> </message>
<message> <message>
<source>Profile is insecure: %1</source> <source>Profile is insecure: %1</source>
<translation>پروفایل ناامن می باشد: %1</translation> <translation type="vanished">پروفایل ناامن می باشد: %1</translation>
</message> </message>
<message> <message>
<source>Stopping profile %1</source> <source>Stopping profile %1</source>
@@ -1465,26 +1465,6 @@ Deleted %3 Profiles:
<source>Chain Proxy</source> <source>Chain Proxy</source>
<translation>پروکسی زنجیره ای</translation> <translation>پروکسی زنجیره ای</translation>
</message> </message>
<message>
<source>The configuration (insecure) can be detected and identified, the transmission is fully visible to the censor and is not resistant to man-in-the-middle tampering with the content of the communication.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>This configuration (Shadowsocks streaming cipher) can be accurately proactively detected and decrypted by censors without requiring a password, and cannot be mitigated by turning on IV replay filters on the server side.
Learn more: https://github.com/net4people/bbs/issues/24</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>This profile is cleartext, don&apos;t use it if the server is not in your local network.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>This configuration (VMess MD5 authentication) has been deprecated by upstream because of its questionable resistance to tampering and concealment.
As of January 1, 2022, compatibility with MD5 authentication information will be disabled on the server side by default. Any client using MD5 authentication information will not be able to connect to a server with VMess MD5 authentication information disabled.</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Core not found: %1</source> <source>Core not found: %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>

View File

@@ -97,7 +97,7 @@
</message> </message>
<message> <message>
<source>Insecure hint</source> <source>Insecure hint</source>
<translation></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<source>Statistics refresh rate</source> <source>Statistics refresh rate</source>
@@ -1144,7 +1144,7 @@ End: %2</source>
</message> </message>
<message> <message>
<source>Profile is insecure: %1</source> <source>Profile is insecure: %1</source>
<translation>: %1</translation> <translation type="vanished">: %1</translation>
</message> </message>
<message> <message>
<source>Remove Unavailable</source> <source>Remove Unavailable</source>
@@ -1453,13 +1453,13 @@ Release note:
</message> </message>
<message> <message>
<source>The configuration (insecure) can be detected and identified, the transmission is fully visible to the censor and is not resistant to man-in-the-middle tampering with the content of the communication.</source> <source>The configuration (insecure) can be detected and identified, the transmission is fully visible to the censor and is not resistant to man-in-the-middle tampering with the content of the communication.</source>
<translation> () .</translation> <translation type="vanished"> () .</translation>
</message> </message>
<message> <message>
<source>This configuration (Shadowsocks streaming cipher) can be accurately proactively detected and decrypted by censors without requiring a password, and cannot be mitigated by turning on IV replay filters on the server side. <source>This configuration (Shadowsocks streaming cipher) can be accurately proactively detected and decrypted by censors without requiring a password, and cannot be mitigated by turning on IV replay filters on the server side.
Learn more: https://github.com/net4people/bbs/issues/24</source> Learn more: https://github.com/net4people/bbs/issues/24</source>
<translation> (Shadowsocks ) , IV . <translation type="vanished"> (Shadowsocks ) , IV .
了解更多: https://github.com/net4people/bbs/issues/24</translation> 了解更多: https://github.com/net4people/bbs/issues/24</translation>
</message> </message>
@@ -1467,7 +1467,7 @@ Learn more: https://github.com/net4people/bbs/issues/24</source>
<source>This configuration (VMess MD5 authentication) has been deprecated by upstream because of its questionable resistance to tampering and concealment. <source>This configuration (VMess MD5 authentication) has been deprecated by upstream because of its questionable resistance to tampering and concealment.
As of January 1, 2022, compatibility with MD5 authentication information will be disabled on the server side by default. Any client using MD5 authentication information will not be able to connect to a server with VMess MD5 authentication information disabled.</source> As of January 1, 2022, compatibility with MD5 authentication information will be disabled on the server side by default. Any client using MD5 authentication information will not be able to connect to a server with VMess MD5 authentication information disabled.</source>
<translation> (VMess MD5 ) , , . <translation type="vanished"> (VMess MD5 ) , , .
2022 1 1 , MD5 . 使 MD5 VMess MD5 .</translation> 2022 1 1 , MD5 . 使 MD5 VMess MD5 .</translation>
</message> </message>
@@ -1489,7 +1489,7 @@ As of January 1, 2022, compatibility with MD5 authentication information will be
</message> </message>
<message> <message>
<source>This profile is cleartext, don&apos;t use it if the server is not in your local network.</source> <source>This profile is cleartext, don&apos;t use it if the server is not in your local network.</source>
<translation>使</translation> <translation type="vanished">使</translation>
</message> </message>
<message> <message>
<source>Select</source> <source>Select</source>

View File

@@ -248,7 +248,6 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent)
ui->utlsFingerprint->addItems(IS_NEKO_BOX ? Preset::SingBox::UtlsFingerPrint : Preset::V2Ray::UtlsFingerPrint); ui->utlsFingerprint->addItems(IS_NEKO_BOX ? Preset::SingBox::UtlsFingerPrint : Preset::V2Ray::UtlsFingerPrint);
D_LOAD_BOOL(insecure_hint)
D_LOAD_BOOL(skip_cert) D_LOAD_BOOL(skip_cert)
ui->enable_js_hook->setCurrentIndex(NekoRay::dataStore->enable_js_hook); ui->enable_js_hook->setCurrentIndex(NekoRay::dataStore->enable_js_hook);
ui->utlsFingerprint->setCurrentText(NekoRay::dataStore->utlsFingerprint); ui->utlsFingerprint->setCurrentText(NekoRay::dataStore->utlsFingerprint);
@@ -304,7 +303,6 @@ void DialogBasicSettings::accept() {
// Security // Security
D_SAVE_BOOL(insecure_hint)
D_SAVE_BOOL(skip_cert) D_SAVE_BOOL(skip_cert)
NekoRay::dataStore->enable_js_hook = ui->enable_js_hook->currentIndex(); NekoRay::dataStore->enable_js_hook = ui->enable_js_hook->currentIndex();
NekoRay::dataStore->utlsFingerprint = ui->utlsFingerprint->currentText(); NekoRay::dataStore->utlsFingerprint = ui->utlsFingerprint->currentText();

View File

@@ -663,13 +663,6 @@
<string>Security</string> <string>Security</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCheckBox" name="insecure_hint">
<property name="text">
<string>Insecure hint</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="skip_cert"> <widget class="QCheckBox" name="skip_cert">
<property name="text"> <property name="text">

View File

@@ -933,11 +933,6 @@ void MainWindow::refresh_proxy_list_impl_refresh_data(const int &id) {
// C0: Type // C0: Type
auto f = f0->clone(); auto f = f0->clone();
f->setText(profile->bean->DisplayType()); f->setText(profile->bean->DisplayType());
auto insecure_hint = profile->bean->DisplayInsecureHint();
if (!insecure_hint.isEmpty()) {
f->setBackground(Qt::red);
f->setToolTip(insecure_hint);
}
ui->proxyListTable->setItem(row, 0, f); ui->proxyListTable->setItem(row, 0, f);
// C1: Address+Port // C1: Address+Port

View File

@@ -216,8 +216,6 @@ void MainWindow::neko_start(int _id) {
if (NekoRay::dataStore->started_id >= 0) neko_stop(); if (NekoRay::dataStore->started_id >= 0) neko_stop();
show_log_impl(">>>>>>>> " + tr("Starting profile %1").arg(ent->bean->DisplayTypeAndName())); show_log_impl(">>>>>>>> " + tr("Starting profile %1").arg(ent->bean->DisplayTypeAndName()));
auto insecure_hint = ent->bean->DisplayInsecureHint();
if (!insecure_hint.isEmpty()) show_log_impl(">>>>>>>> " + tr("Profile is insecure: %1").arg(insecure_hint));
#ifndef NKR_NO_GRPC #ifndef NKR_NO_GRPC
libcore::LoadConfigReq req; libcore::LoadConfigReq req;