summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2015-07-21 18:01:56 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2015-08-25 09:37:47 +0000
commitedb880429e70127387359d831c31263de363d39e (patch)
tree0aa195350aa59687f86ac3202823359888c5c7f9
parentb3f9207ea962b4106b017a435dc19bc93bede0d6 (diff)
SSH: Remove bogus compatibility check.
All host keys can be used with all HMACs. Change-Id: I71055d3085d13683e53491ac9a9d98734dd6e7e5 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> (cherry picked from commit 0aadfbd4537e83bab7b65c3658aa323c003610c4) Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
-rw-r--r--src/libs/ssh/sshkeyexchange.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/libs/ssh/sshkeyexchange.cpp b/src/libs/ssh/sshkeyexchange.cpp
index 25da1805c8..18ad4971af 100644
--- a/src/libs/ssh/sshkeyexchange.cpp
+++ b/src/libs/ssh/sshkeyexchange.cpp
@@ -252,27 +252,7 @@ void SshKeyExchange::determineHashingAlgorithm(const SshKeyExchangeInit &kexInit
const QList<QByteArray> &serverCapabilities = serverToClient
? kexInit.macAlgorithmsServerToClient.names
: kexInit.macAlgorithmsClientToServer.names;
- const QList<QByteArray> commonAlgos = SshCapabilities::commonCapabilities(
- 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(", "))));
-
- }
+ *algo = SshCapabilities::findBestMatch(SshCapabilities::MacAlgorithms, serverCapabilities);
}
void SshKeyExchange::checkHostKey(const QByteArray &hostKey)