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