SSH: Fix key re-exchange bug.

We used the encrypted client payload by mistake. The bug only manifests
itself from the second key exchange on, because during the first one,
no encryption is active, so the "encrypted" payload is the same as
the non-encrypted one.
This commit is contained in:
Christian Kandeler
2011-04-28 10:57:17 +02:00
parent c5a40e9e63
commit 9d90809e6d
7 changed files with 42 additions and 18 deletions

View File

@@ -55,7 +55,7 @@ quint32 SshOutgoingPacket::macLength() const
return m_encrypter.macLength();
}
void SshOutgoingPacket::generateKeyExchangeInitPacket()
QByteArray SshOutgoingPacket::generateKeyExchangeInitPacket()
{
const QByteArray &supportedkeyExchangeMethods
= encodeNameList(SshCapabilities::KeyExchangeMethods);
@@ -81,7 +81,9 @@ void SshOutgoingPacket::generateKeyExchangeInitPacket()
m_data.append(supportedLanguages).append(supportedLanguages);
appendBool(false); // No guessed packet.
m_data.append(QByteArray(4, 0)); // Reserved.
QByteArray payload = m_data.mid(PayloadOffset);
finalize();
return payload;
}
void SshOutgoingPacket::generateKeyDhInitPacket(const Botan::BigInt &e)