Don't hardcode the server signature length

This commit is contained in:
Cameron Gutman 2023-11-29 21:53:49 -06:00
parent f374e88bac
commit c63b918bb2

View file

@ -298,8 +298,8 @@ NvPairingManager::pair(QString appVersion, QString pin, QSslCertificate& serverC
} }
QByteArray pairingSecret = NvHTTP::getXmlStringFromHex(respXml, "pairingsecret"); QByteArray pairingSecret = NvHTTP::getXmlStringFromHex(respXml, "pairingsecret");
QByteArray serverSecret = QByteArray(pairingSecret.data(), 16); QByteArray serverSecret = pairingSecret.left(16);
QByteArray serverSignature = QByteArray(&pairingSecret.data()[16], 256); QByteArray serverSignature = pairingSecret.mid(16);
if (!verifySignature(serverSecret, if (!verifySignature(serverSecret,
serverSignature, serverSignature,