Merge remote-tracking branch 'origin/2.4'

Conflicts:
	src/libs/qmljs/qmljsinterpreter.cpp
	src/libs/utils/ssh/sshconnection.cpp
	src/plugins/madde/maemopackagecreationstep.cpp
	src/plugins/qt4projectmanager/qmakestep.cpp

Change-Id: Id0c9185638038f7506bc9507872d6699345414a9
This commit is contained in:
Eike Ziller
2011-12-07 13:24:45 +01:00
18 changed files with 202 additions and 127 deletions

View File

@@ -453,14 +453,6 @@ void SshConnectionPrivate::handleServiceAcceptPacket()
m_sendFacility.sendUserAuthByPwdRequestPacket(m_connParams.userName.toUtf8(),
SshCapabilities::SshConnectionService, m_connParams.password.toUtf8());
} else {
Utils::FileReader reader;
if (m_connParams.privateKeyFile.isEmpty())
throw SshClientException(SshKeyFileError, tr("No private key file given."));
if (!reader.fetch(m_connParams.privateKeyFile))
throw SshClientException(SshKeyFileError,
tr("Private key error: %1").arg(reader.errorString()));
m_sendFacility.createAuthenticationKey(reader.data());
m_sendFacility.sendUserAuthByKeyRequestPacket(m_connParams.userName.toUtf8(),
SshCapabilities::SshConnectionService);
}
@@ -639,6 +631,22 @@ void SshConnectionPrivate::connectToHost()
m_error = SshNoError;
m_ignoreNextPacket = false;
m_errorString.clear();
try {
if (m_connParams.authenticationType == SshConnectionParameters::AuthenticationByKey)
createPrivateKey();
} catch (const SshClientException &ex) {
m_error = ex.error;
m_errorString = ex.errorString;
emit error(m_error);
return;
} catch (const Botan::Exception &ex) {
m_error = SshKeyFileError;
m_errorString = QString::fromAscii(ex.what());
emit error(m_error);
return;
}
connect(m_socket, SIGNAL(connected()), this, SLOT(handleSocketConnected()));
connect(m_socket, SIGNAL(readyRead()), this, SLOT(handleIncomingData()));
connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)), this,
@@ -683,7 +691,18 @@ void SshConnectionPrivate::closeConnection(SshErrorCode sshError,
bool SshConnectionPrivate::canUseSocket() const
{
return m_socket->isValid()
&& m_socket->state() == QAbstractSocket::ConnectedState;
&& m_socket->state() == QAbstractSocket::ConnectedState;
}
void SshConnectionPrivate::createPrivateKey()
{
Utils::FileReader reader;
if (m_connParams.privateKeyFile.isEmpty())
throw SshClientException(SshKeyFileError, tr("No private key file given."));
if (!reader.fetch(m_connParams.privateKeyFile))
throw SshClientException(SshKeyFileError,
tr("Private key file error: %1").arg(reader.errorString()));
m_sendFacility.createAuthenticationKey(reader.data());
}
QSharedPointer<SshRemoteProcess> SshConnectionPrivate::createRemoteProcess(const QByteArray &command)

View File

@@ -137,6 +137,7 @@ private:
void handleChannelClose();
void handleDisconnect();
bool canUseSocket() const;
void createPrivateKey();
void sendData(const QByteArray &data);