Compare commits
1 commit
dev
...
feature/ps
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0489f19ceb |
2 changed files with 9 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ namespace
|
||||||
constexpr char accessToken[] = "api_key";
|
constexpr char accessToken[] = "api_key";
|
||||||
constexpr char certificate[] = "certificate";
|
constexpr char certificate[] = "certificate";
|
||||||
constexpr char publicKey[] = "public_key";
|
constexpr char publicKey[] = "public_key";
|
||||||
|
constexpr char pskKey[] = "preshared_key";
|
||||||
constexpr char protocol[] = "protocol";
|
constexpr char protocol[] = "protocol";
|
||||||
|
|
||||||
constexpr char uuid[] = "installation_uuid";
|
constexpr char uuid[] = "installation_uuid";
|
||||||
|
|
@ -193,6 +194,12 @@ ApiController::ApiPayloadData ApiController::generateApiPayloadData(const QStrin
|
||||||
auto connData = WireguardConfigurator::genClientKeys();
|
auto connData = WireguardConfigurator::genClientKeys();
|
||||||
apiPayload.wireGuardClientPubKey = connData.clientPubKey;
|
apiPayload.wireGuardClientPubKey = connData.clientPubKey;
|
||||||
apiPayload.wireGuardClientPrivKey = connData.clientPrivKey;
|
apiPayload.wireGuardClientPrivKey = connData.clientPrivKey;
|
||||||
|
QSimpleCrypto::QBlockCipher blockCipher;
|
||||||
|
apiPayload.wireGuardPskKey = blockCipher.generatePrivateSalt(32);
|
||||||
|
|
||||||
|
qDebug() << apiPayload.wireGuardClientPubKey;
|
||||||
|
qDebug() << apiPayload.wireGuardPskKey;
|
||||||
|
|
||||||
}
|
}
|
||||||
return apiPayload;
|
return apiPayload;
|
||||||
}
|
}
|
||||||
|
|
@ -204,6 +211,7 @@ QJsonObject ApiController::fillApiPayload(const QString &protocol, const ApiCont
|
||||||
obj[configKey::certificate] = apiPayloadData.certRequest.request;
|
obj[configKey::certificate] = apiPayloadData.certRequest.request;
|
||||||
} else if (protocol == configKey::awg) {
|
} else if (protocol == configKey::awg) {
|
||||||
obj[configKey::publicKey] = apiPayloadData.wireGuardClientPubKey;
|
obj[configKey::publicKey] = apiPayloadData.wireGuardClientPubKey;
|
||||||
|
obj[configKey::pskKey] = apiPayloadData.wireGuardPskKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
obj[configKey::osVersion] = QSysInfo::productType();
|
obj[configKey::osVersion] = QSysInfo::productType();
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ private:
|
||||||
|
|
||||||
QString wireGuardClientPrivKey;
|
QString wireGuardClientPrivKey;
|
||||||
QString wireGuardClientPubKey;
|
QString wireGuardClientPubKey;
|
||||||
|
QString wireGuardPskKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
ApiPayloadData generateApiPayloadData(const QString &protocol);
|
ApiPayloadData generateApiPayloadData(const QString &protocol);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue