mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-18 00:45:58 +03:00
Compare commits
1 Commits
improve_na
...
feature/ps
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0489f19ceb |
@@ -24,6 +24,7 @@ namespace
|
||||
constexpr char accessToken[] = "api_key";
|
||||
constexpr char certificate[] = "certificate";
|
||||
constexpr char publicKey[] = "public_key";
|
||||
constexpr char pskKey[] = "preshared_key";
|
||||
constexpr char protocol[] = "protocol";
|
||||
|
||||
constexpr char uuid[] = "installation_uuid";
|
||||
@@ -193,6 +194,12 @@ ApiController::ApiPayloadData ApiController::generateApiPayloadData(const QStrin
|
||||
auto connData = WireguardConfigurator::genClientKeys();
|
||||
apiPayload.wireGuardClientPubKey = connData.clientPubKey;
|
||||
apiPayload.wireGuardClientPrivKey = connData.clientPrivKey;
|
||||
QSimpleCrypto::QBlockCipher blockCipher;
|
||||
apiPayload.wireGuardPskKey = blockCipher.generatePrivateSalt(32);
|
||||
|
||||
qDebug() << apiPayload.wireGuardClientPubKey;
|
||||
qDebug() << apiPayload.wireGuardPskKey;
|
||||
|
||||
}
|
||||
return apiPayload;
|
||||
}
|
||||
@@ -204,6 +211,7 @@ QJsonObject ApiController::fillApiPayload(const QString &protocol, const ApiCont
|
||||
obj[configKey::certificate] = apiPayloadData.certRequest.request;
|
||||
} else if (protocol == configKey::awg) {
|
||||
obj[configKey::publicKey] = apiPayloadData.wireGuardClientPubKey;
|
||||
obj[configKey::pskKey] = apiPayloadData.wireGuardPskKey;
|
||||
}
|
||||
|
||||
obj[configKey::osVersion] = QSysInfo::productType();
|
||||
|
||||
@@ -34,6 +34,7 @@ private:
|
||||
|
||||
QString wireGuardClientPrivKey;
|
||||
QString wireGuardClientPubKey;
|
||||
QString wireGuardPskKey;
|
||||
};
|
||||
|
||||
ApiPayloadData generateApiPayloadData(const QString &protocol);
|
||||
|
||||
Reference in New Issue
Block a user