Commit d24ebfed authored by Christian Kandeler's avatar Christian Kandeler
Browse files

SSH: Fix misnomers.

parent 562265d5
......@@ -76,15 +76,15 @@ namespace {
SshConnectionParameters::SshConnectionParameters(ProxyType proxyType) :
timeout(0), authorizationType(AuthorizationByKey), port(0), proxyType(proxyType)
timeout(0), authenticationType(AuthenticationByKey), port(0), proxyType(proxyType)
{
}
static inline bool equals(const SshConnectionParameters &p1, const SshConnectionParameters &p2)
{
return p1.host == p2.host && p1.userName == p2.userName
&& p1.authorizationType == p2.authorizationType
&& (p1.authorizationType == SshConnectionParameters::AuthorizationByPassword ?
&& p1.authenticationType == p2.authenticationType
&& (p1.authenticationType == SshConnectionParameters::AuthenticationByPassword ?
p1.password == p2.password : p1.privateKeyFile == p2.privateKeyFile)
&& p1.timeout == p2.timeout && p1.port == p2.port;
}
......@@ -394,7 +394,7 @@ void SshConnectionPrivate::handleNewKeysPacket()
void SshConnectionPrivate::handleServiceAcceptPacket()
{
if (m_connParams.authorizationType == SshConnectionParameters::AuthorizationByPassword) {
if (m_connParams.authenticationType == SshConnectionParameters::AuthenticationByPassword) {
m_sendFacility.sendUserAuthByPwdRequestPacket(m_connParams.userName.toUtf8(),
SshCapabilities::SshConnectionService, m_connParams.password.toUtf8());
} else {
......@@ -418,7 +418,7 @@ void SshConnectionPrivate::handleServiceAcceptPacket()
void SshConnectionPrivate::handlePasswordExpiredPacket()
{
if (m_connParams.authorizationType == SshConnectionParameters::AuthorizationByKey) {
if (m_connParams.authenticationType == SshConnectionParameters::AuthenticationByKey) {
throw SSH_SERVER_EXCEPTION(SSH_DISCONNECT_PROTOCOL_ERROR,
"Got SSH_MSG_USERAUTH_PASSWD_CHANGEREQ, but did not use password.");
}
......@@ -449,7 +449,7 @@ void SshConnectionPrivate::handleUserAuthSuccessPacket()
void SshConnectionPrivate::handleUserAuthFailurePacket()
{
m_timeoutTimer.stop();
const QString errorMsg = m_connParams.authorizationType == SshConnectionParameters::AuthorizationByPassword
const QString errorMsg = m_connParams.authenticationType == SshConnectionParameters::AuthenticationByPassword
? tr("Server rejected password.") : tr("Server rejected key.");
throw SshClientException(SshAuthenticationError, errorMsg);
}
......
......@@ -54,7 +54,7 @@ class SshConnectionPrivate;
struct QTCREATOR_UTILS_EXPORT SshConnectionParameters
{
enum ProxyType { DefaultProxy, NoProxy };
enum AuthorizationType { AuthorizationByPassword, AuthorizationByKey };
enum AuthenticationType { AuthenticationByPassword, AuthenticationByKey };
SshConnectionParameters(ProxyType proxyType);
QString host;
......@@ -62,7 +62,7 @@ struct QTCREATOR_UTILS_EXPORT SshConnectionParameters
QString password;
QString privateKeyFile;
int timeout; // In seconds.
AuthorizationType authorizationType;
AuthenticationType authenticationType;
quint16 port;
ProxyType proxyType;
};
......
......@@ -1557,7 +1557,7 @@ void DebuggerPluginPrivate::startRemoteEngine()
sp.connParams.password = dlg.password();
sp.connParams.timeout = 5;
sp.connParams.authorizationType = Utils::SshConnectionParameters::AuthorizationByPassword;
sp.connParams.authenticationType = Utils::SshConnectionParameters::AuthenticationByPassword;
sp.connParams.port = 22;
sp.connParams.proxyType = Utils::SshConnectionParameters::NoProxy;
......
......@@ -43,7 +43,7 @@
#include <algorithm>
#include <cctype>
typedef Utils::SshConnectionParameters::AuthorizationType AuthType;
typedef Utils::SshConnectionParameters::AuthenticationType AuthType;
namespace Qt4ProjectManager {
namespace Internal {
......@@ -73,7 +73,7 @@ namespace {
const int DefaultGdbServerPortSim(13219);
const QString DefaultHostNameHW(QLatin1String("192.168.2.15"));
const QString DefaultHostNameSim(QLatin1String("localhost"));
const AuthType DefaultAuthType(Utils::SshConnectionParameters::AuthorizationByKey);
const AuthType DefaultAuthType(Utils::SshConnectionParameters::AuthenticationByKey);
const int DefaultTimeout(30);
const MaemoDeviceConfig::DeviceType DefaultDeviceType(MaemoDeviceConfig::Physical);
}
......@@ -231,7 +231,7 @@ MaemoDeviceConfig::Ptr MaemoDeviceConfig::createHardwareConfig(const QString &na
const QString privateKeyFilePath, Id &nextId)
{
Utils::SshConnectionParameters sshParams(Utils::SshConnectionParameters::NoProxy);
sshParams.authorizationType = Utils::SshConnectionParameters::AuthorizationByKey;
sshParams.authenticationType = Utils::SshConnectionParameters::AuthenticationByKey;
sshParams.host = hostName;
sshParams.privateKeyFile = privateKeyFilePath;
return Ptr(new MaemoDeviceConfig(name, osVersion, Physical, sshParams, nextId));
......@@ -241,7 +241,7 @@ MaemoDeviceConfig::Ptr MaemoDeviceConfig::createEmulatorConfig(const QString &na
MaemoGlobal::MaemoVersion osVersion, Id &nextId)
{
Utils::SshConnectionParameters sshParams(Utils::SshConnectionParameters::NoProxy);
sshParams.authorizationType = Utils::SshConnectionParameters::AuthorizationByPassword;
sshParams.authenticationType = Utils::SshConnectionParameters::AuthenticationByPassword;
sshParams.host = defaultHost(Emulator);
sshParams.password = defaultQemuPassword(osVersion);
return Ptr(new MaemoDeviceConfig(name, osVersion, Emulator, sshParams, nextId));
......@@ -278,7 +278,7 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings,
m_sshParameters.host = settings.value(HostKey, defaultHost(m_type)).toString();
m_sshParameters.port = settings.value(SshPortKey, defaultSshPort(m_type)).toInt();
m_sshParameters.userName = settings.value(UserNameKey, defaultUser(m_osVersion)).toString();
m_sshParameters.authorizationType
m_sshParameters.authenticationType
= static_cast<AuthType>(settings.value(AuthKey, DefaultAuthType).toInt());
m_sshParameters.password = settings.value(PasswordKey).toString();
m_sshParameters.privateKeyFile
......@@ -372,7 +372,7 @@ void MaemoDeviceConfig::save(QSettings &settings) const
settings.setValue(SshPortKey, m_sshParameters.port);
settings.setValue(PortsSpecKey, m_portsSpec);
settings.setValue(UserNameKey, m_sshParameters.userName);
settings.setValue(AuthKey, m_sshParameters.authorizationType);
settings.setValue(AuthKey, m_sshParameters.authenticationType);
settings.setValue(PasswordKey, m_sshParameters.password);
settings.setValue(KeyFileKey, m_sshParameters.privateKeyFile);
settings.setValue(TimeoutKey, m_sshParameters.timeout);
......
......@@ -205,7 +205,7 @@ void MaemoDeviceConfigurationsSettingsWidget::displayCurrent()
m_ui->deviceTypeValueLabel->setText(tr("Emulator (Qemu)"));
m_ui->portsLineEdit->setReadOnly(true);
}
if (sshParams.authorizationType == Utils::SshConnectionParameters::AuthorizationByPassword)
if (sshParams.authenticationType == Utils::SshConnectionParameters::AuthenticationByPassword)
m_ui->passwordButton->setChecked(true);
else
m_ui->keyButton->setChecked(true);
......@@ -265,9 +265,9 @@ void MaemoDeviceConfigurationsSettingsWidget::authenticationTypeChanged()
{
SshConnectionParameters sshParams = currentConfig()->sshParameters();
const bool usePassword = m_ui->passwordButton->isChecked();
sshParams.authorizationType = usePassword
? SshConnectionParameters::AuthorizationByPassword
: SshConnectionParameters::AuthorizationByKey;
sshParams.authenticationType = usePassword
? SshConnectionParameters::AuthenticationByPassword
: SshConnectionParameters::AuthenticationByKey;
m_devConfigs->setSshParameters(currentIndex(), sshParams);
m_ui->pwdLineEdit->setEnabled(usePassword);
m_ui->passwordLabel->setEnabled(usePassword);
......
......@@ -407,7 +407,7 @@ private:
m_ui->passwordLineEdit->setEnabled(false);
m_ui->deployButton->setEnabled(false);
Utils::SshConnectionParameters sshParams(SshConnectionParameters::NoProxy);
sshParams.authorizationType = SshConnectionParameters::AuthorizationByPassword;
sshParams.authenticationType = SshConnectionParameters::AuthenticationByPassword;
sshParams.host = hostAddress();
sshParams.port = MaemoDeviceConfig::defaultSshPort(MaemoDeviceConfig::Physical);
sshParams.password = password();
......
......@@ -66,7 +66,7 @@ MaemoPublisherFremantleFree::MaemoPublisherFremantleFree(const ProjectExplorer::
m_state(Inactive),
m_sshParams(SshConnectionParameters::DefaultProxy)
{
m_sshParams.authorizationType = SshConnectionParameters::AuthorizationByKey;
m_sshParams.authenticationType = SshConnectionParameters::AuthenticationByKey;
m_sshParams.timeout = 30;
m_sshParams.port = 22;
m_process = new QProcess(this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment