Skip to content
Snippets Groups Projects
Commit edb88042 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

SSH: Remove bogus compatibility check.


All host keys can be used with all HMACs.

Change-Id: I71055d3085d13683e53491ac9a9d98734dd6e7e5
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
(cherry picked from commit 0aadfbd4)
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent b3f9207e
No related branches found
No related tags found
No related merge requests found
...@@ -252,27 +252,7 @@ void SshKeyExchange::determineHashingAlgorithm(const SshKeyExchangeInit &kexInit ...@@ -252,27 +252,7 @@ void SshKeyExchange::determineHashingAlgorithm(const SshKeyExchangeInit &kexInit
const QList<QByteArray> &serverCapabilities = serverToClient const QList<QByteArray> &serverCapabilities = serverToClient
? kexInit.macAlgorithmsServerToClient.names ? kexInit.macAlgorithmsServerToClient.names
: kexInit.macAlgorithmsClientToServer.names; : kexInit.macAlgorithmsClientToServer.names;
const QList<QByteArray> commonAlgos = SshCapabilities::commonCapabilities( *algo = SshCapabilities::findBestMatch(SshCapabilities::MacAlgorithms, serverCapabilities);
SshCapabilities::MacAlgorithms, serverCapabilities);
const QByteArray hashAlgo = hashAlgoForKexAlgo();
foreach (const QByteArray &potentialAlgo, commonAlgos) {
if (potentialAlgo == hashAlgo
|| !m_kexAlgoName.startsWith(SshCapabilities::EcdhKexNamePrefix)) {
*algo = potentialAlgo;
break;
}
}
if (algo->isEmpty()) {
throw SshServerException(SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
"Invalid combination of key exchange and hashing algorithms.",
QCoreApplication::translate("SshConnection",
"Server requested invalid combination of key exchange and hashing algorithms. "
"Key exchange algorithm list was: %1.\nHashing algorithm list was %2.")
.arg(QString::fromLocal8Bit(kexInit.keyAlgorithms.names.join(", ")))
.arg(QString::fromLocal8Bit(serverCapabilities.join(", "))));
}
} }
void SshKeyExchange::checkHostKey(const QByteArray &hostKey) void SshKeyExchange::checkHostKey(const QByteArray &hostKey)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment