diff --git a/client/core/controllers/apiController.cpp b/client/core/controllers/apiController.cpp index 5cdaa7aec..bbeb13814 100644 --- a/client/core/controllers/apiController.cpp +++ b/client/core/controllers/apiController.cpp @@ -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(); diff --git a/client/core/controllers/apiController.h b/client/core/controllers/apiController.h index 1f8114989..f846c6719 100644 --- a/client/core/controllers/apiController.h +++ b/client/core/controllers/apiController.h @@ -34,6 +34,7 @@ public slots: QString wireGuardClientPrivKey; QString wireGuardClientPubKey; + QString wireGuardPskKey; }; ApiPayloadData generateApiPayloadData(const QString &protocol);