mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
added a check that S1 + messageInitiationSize should not be equal to S2 + messageResponseSize (#754)
This commit is contained in:
@@ -129,6 +129,16 @@ QJsonObject AwgConfigModel::getConfig()
|
||||
return m_fullConfig;
|
||||
}
|
||||
|
||||
bool AwgConfigModel::isHeadersEqual(const QString &h1, const QString &h2, const QString &h3, const QString &h4)
|
||||
{
|
||||
return (h1 == h2) || (h1 == h3) || (h1 == h4) || (h2 == h3) || (h2 == h4) || (h3 == h4);
|
||||
}
|
||||
|
||||
bool AwgConfigModel::isPacketSizeEqual(const int s1, const int s2)
|
||||
{
|
||||
return (AwgConstant::messageInitiationSize + s1 == AwgConstant::messageResponseSize + s2);
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> AwgConfigModel::roleNames() const
|
||||
{
|
||||
QHash<int, QByteArray> roles;
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
|
||||
#include "containers/containers_defs.h"
|
||||
|
||||
namespace AwgConstant {
|
||||
const int messageInitiationSize = 148;
|
||||
const int messageResponseSize = 92;
|
||||
}
|
||||
|
||||
struct AwgConfig
|
||||
{
|
||||
AwgConfig(const QJsonObject &jsonConfig);
|
||||
@@ -57,6 +62,9 @@ public slots:
|
||||
void updateModel(const QJsonObject &config);
|
||||
QJsonObject getConfig();
|
||||
|
||||
bool isHeadersEqual(const QString &h1, const QString &h2, const QString &h3, const QString &h4);
|
||||
bool isPacketSizeEqual(const int s1, const int s2);
|
||||
|
||||
protected:
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user