mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-15 05:42:28 +00:00
parent
355e4a5c67
commit
b66f7f6c8b
1 changed files with 7 additions and 5 deletions
|
@ -238,17 +238,18 @@ NvPairingManager::pair(QString appVersion, QString pin, QSslCertificate& serverC
|
||||||
return PairState::ALREADY_IN_PROGRESS;
|
return PairState::ALREADY_IN_PROGRESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
serverCert = QSslCertificate(serverCertStr);
|
QSslCertificate unverifiedServerCert = QSslCertificate(serverCertStr);
|
||||||
if (serverCert.isNull()) {
|
if (unverifiedServerCert.isNull()) {
|
||||||
Q_ASSERT(!serverCert.isNull());
|
Q_ASSERT(!unverifiedServerCert.isNull());
|
||||||
|
|
||||||
qCritical() << "Failed to parse plaincert";
|
qCritical() << "Failed to parse plaincert";
|
||||||
m_Http.openConnectionToString(m_Http.m_BaseUrlHttp, "unpair", nullptr, REQUEST_TIMEOUT_MS);
|
m_Http.openConnectionToString(m_Http.m_BaseUrlHttp, "unpair", nullptr, REQUEST_TIMEOUT_MS);
|
||||||
return PairState::FAILED;
|
return PairState::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pin this cert for TLS
|
// Pin this cert for TLS until pairing is complete. If successful, we will propagate
|
||||||
m_Http.setServerCert(serverCert);
|
// the cert into the NvComputer object and persist it.
|
||||||
|
m_Http.setServerCert(unverifiedServerCert);
|
||||||
|
|
||||||
QByteArray randomChallenge = generateRandomBytes(16);
|
QByteArray randomChallenge = generateRandomBytes(16);
|
||||||
QByteArray encryptedChallenge = encrypt(randomChallenge, aesKey);
|
QByteArray encryptedChallenge = encrypt(randomChallenge, aesKey);
|
||||||
|
@ -353,5 +354,6 @@ NvPairingManager::pair(QString appVersion, QString pin, QSslCertificate& serverC
|
||||||
return PairState::FAILED;
|
return PairState::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
serverCert = std::move(unverifiedServerCert);
|
||||||
return PairState::PAIRED;
|
return PairState::PAIRED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue