SSH: Don't send keep-alive packet during key exchange.

Only certain types of messages are allowed in that phase.
This commit is contained in:
Christian Kandeler
2011-04-28 11:12:34 +02:00
parent 9d90809e6d
commit 53ff5b187c
2 changed files with 8 additions and 0 deletions

View File

@@ -605,6 +605,12 @@ void SshConnectionPrivate::handleTimeout()
void SshConnectionPrivate::sendKeepAlivePacket()
{
// This type of message is not allowed during key exchange.
if (m_keyExchangeState != NoKeyExchange) {
m_keepAliveTimer.start();
return;
}
Q_ASSERT(m_lastInvalidMsgSeqNr == InvalidSeqNr);
m_lastInvalidMsgSeqNr = m_sendFacility.nextClientSeqNr();
m_sendFacility.sendInvalidPacket();

View File

@@ -68,6 +68,8 @@ enum SshPacketType {
SSH_MSG_REQUEST_SUCCESS = 81,
SSH_MSG_REQUEST_FAILURE = 82,
// TODO: We currently take no precautions against sending these messages
// during a key re-exchange, which is not allowed.
SSH_MSG_CHANNEL_OPEN = 90,
SSH_MSG_CHANNEL_OPEN_CONFIRMATION = 91,
SSH_MSG_CHANNEL_OPEN_FAILURE = 92,