mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-01-30 12:32:43 +00:00
Fix pairing error handling when the hash doesn't match
We shouldn't proceed to signature verification if we already failed hash verification
This commit is contained in:
parent
663bf750d9
commit
b59b885dbd
@ -375,14 +375,7 @@ namespace nvhttp {
|
||||
auto hash = crypto::hash(data);
|
||||
|
||||
// if hash not correct, probably MITM
|
||||
if (std::memcmp(hash.data(), sess.clienthash.data(), hash.size())) {
|
||||
// TODO: log
|
||||
|
||||
map_id_sess.erase(client.uniqueID);
|
||||
tree.put("root.paired", 0);
|
||||
}
|
||||
|
||||
if (crypto::verify256(crypto::x509(client.cert), secret, sign)) {
|
||||
if (!std::memcmp(hash.data(), sess.clienthash.data(), hash.size()) && crypto::verify256(crypto::x509(client.cert), secret, sign)) {
|
||||
tree.put("root.paired", 1);
|
||||
add_cert->raise(crypto::x509(client.cert));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user