authenticatingStarted = false;
encryptionStarted = false;
usingEncryption = false;
+ firstEncryptedCommand = false;
commandsTimedOut = 0;
socket = new QUdpSocket(this);
#endif
m_salt = encryptReply->salt();
usingEncryption = true;
+ firstEncryptedCommand = true;
emit encryptionEstablished();
return;
}
emit connectionError();
goto endLoop;
case UNKNOWN_COMMAND:
- if (usingEncryption)
+ if (usingEncryption && firstEncryptedCommand)
{
m_error = EncryptionError;
m_errorString = tr("Server did not recognize encrypted command. Make sure the API Key is correct.");
+ firstEncryptedCommand = false;
emit connectionError();
goto endLoop;
}
+ else if (usingEncryption && !firstEncryptedCommand)
+ {
+ usingEncryption = false;
+ m_salt.clear();
+ m_sessionId.clear();
+ }
break;
default:
if (replyCode > 601 && replyCode < 700)
}
}
+ firstEncryptedCommand = false;
+
QByteArray commandId = tmp.mid(0, 5);
commandsTimedOut = 0;