ShadowSocks password - sha256

This commit is contained in:
pokamest 2021-03-13 14:16:24 +03:00
parent 02f966bc67
commit a2bb382652
3 changed files with 11 additions and 3 deletions

View file

@ -4,6 +4,7 @@
#include "debug.h"
#include "utils.h"
#include <QCryptographicHash>
#include <QJsonDocument>
#include <QJsonObject>
@ -71,7 +72,8 @@ QJsonObject ShadowSocksVpnProtocol::genShadowSocksConfig(const ServerCredentials
ssConfig.insert("server", credentials.hostName);
ssConfig.insert("server_port", ServerController::ssRemotePort());
ssConfig.insert("local_port", ServerController::ssContainerPort());
ssConfig.insert("password", credentials.password);
ssConfig.insert("password", QString(QCryptographicHash::hash(credentials.password.toUtf8(), QCryptographicHash::Sha256).toHex()));
//ssConfig.insert("password", credentials.password);
ssConfig.insert("timeout", 60);
ssConfig.insert("method", ServerController::ssEncryption());
return ssConfig;