SSH: Fix misnomers.

This commit is contained in:
Christian Kandeler
2011-02-28 17:01:53 +01:00
parent 562265d58c
commit d24ebfed3d
7 changed files with 21 additions and 21 deletions

View File

@@ -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);
}

View File

@@ -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;
};