forked from qt-creator/qt-creator
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:
@@ -605,6 +605,12 @@ void SshConnectionPrivate::handleTimeout()
|
|||||||
|
|
||||||
void SshConnectionPrivate::sendKeepAlivePacket()
|
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);
|
Q_ASSERT(m_lastInvalidMsgSeqNr == InvalidSeqNr);
|
||||||
m_lastInvalidMsgSeqNr = m_sendFacility.nextClientSeqNr();
|
m_lastInvalidMsgSeqNr = m_sendFacility.nextClientSeqNr();
|
||||||
m_sendFacility.sendInvalidPacket();
|
m_sendFacility.sendInvalidPacket();
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ enum SshPacketType {
|
|||||||
SSH_MSG_REQUEST_SUCCESS = 81,
|
SSH_MSG_REQUEST_SUCCESS = 81,
|
||||||
SSH_MSG_REQUEST_FAILURE = 82,
|
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 = 90,
|
||||||
SSH_MSG_CHANNEL_OPEN_CONFIRMATION = 91,
|
SSH_MSG_CHANNEL_OPEN_CONFIRMATION = 91,
|
||||||
SSH_MSG_CHANNEL_OPEN_FAILURE = 92,
|
SSH_MSG_CHANNEL_OPEN_FAILURE = 92,
|
||||||
|
|||||||
Reference in New Issue
Block a user