fixed windows build errors after refactoring
This commit is contained in:
parent
80fca589af
commit
68d9394d9f
2 changed files with 18 additions and 18 deletions
|
@ -69,14 +69,14 @@ void SshConfigurator::openSshTerminal(const ServerCredentials &credentials)
|
||||||
p->setProcessEnvironment(prepareEnv());
|
p->setProcessEnvironment(prepareEnv());
|
||||||
p->setProgram(qApp->applicationDirPath() + "\\cygwin\\putty.exe");
|
p->setProgram(qApp->applicationDirPath() + "\\cygwin\\putty.exe");
|
||||||
|
|
||||||
if (credentials.password.contains("PRIVATE KEY")) {
|
if (credentials.secretData.contains("PRIVATE KEY")) {
|
||||||
// todo: connect by key
|
// todo: connect by key
|
||||||
// p->setNativeArguments(QString("%1@%2")
|
// p->setNativeArguments(QString("%1@%2")
|
||||||
// .arg(credentials.userName).arg(credentials.hostName).arg(credentials.password));
|
// .arg(credentials.userName).arg(credentials.hostName).arg(credentials.secretData));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p->setNativeArguments(QString("%1@%2 -pw %3")
|
p->setNativeArguments(QString("%1@%2 -pw %3")
|
||||||
.arg(credentials.userName).arg(credentials.hostName).arg(credentials.password));
|
.arg(credentials.userName).arg(credentials.hostName).arg(credentials.secretData));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
p->setProgram("/bin/bash");
|
p->setProgram("/bin/bash");
|
||||||
|
|
|
@ -35,14 +35,14 @@ Ikev2Protocol::~Ikev2Protocol()
|
||||||
|
|
||||||
void Ikev2Protocol::stop()
|
void Ikev2Protocol::stop()
|
||||||
{
|
{
|
||||||
setConnectionState(VpnProtocol::Disconnecting);
|
setConnectionState(Vpn::ConnectionState::Disconnecting);
|
||||||
{
|
{
|
||||||
if (! disconnect_vpn() ){
|
if (! disconnect_vpn() ){
|
||||||
qDebug()<<"We don't disconnect";
|
qDebug()<<"We don't disconnect";
|
||||||
setConnectionState(VpnProtocol::Error);
|
setConnectionState(Vpn::ConnectionState::Error);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setConnectionState(VpnProtocol::Disconnected);
|
setConnectionState(Vpn::ConnectionState::Disconnected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,40 +55,40 @@ void Ikev2Protocol::newConnectionStateEventReceived(UINT unMsg, tagRASCONNSTATE
|
||||||
{
|
{
|
||||||
case RASCS_OpenPort:
|
case RASCS_OpenPort:
|
||||||
//qDebug()<<__FUNCTION__ << __LINE__;
|
//qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
setConnectionState(Preparing);
|
setConnectionState(Vpn::ConnectionState::Preparing);
|
||||||
break;
|
break;
|
||||||
case RASCS_PortOpened:
|
case RASCS_PortOpened:
|
||||||
//qDebug()<<__FUNCTION__ << __LINE__;
|
//qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
setConnectionState(Preparing);
|
setConnectionState(Vpn::ConnectionState::Preparing);
|
||||||
break;
|
break;
|
||||||
case RASCS_ConnectDevice:
|
case RASCS_ConnectDevice:
|
||||||
//qDebug()<<__FUNCTION__ << __LINE__;
|
//qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
setConnectionState(Preparing);
|
setConnectionState(Vpn::ConnectionState::Preparing);
|
||||||
break;
|
break;
|
||||||
case RASCS_DeviceConnected:
|
case RASCS_DeviceConnected:
|
||||||
//qDebug()<<__FUNCTION__ << __LINE__;
|
//qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
setConnectionState(Preparing);
|
setConnectionState(Vpn::ConnectionState::Preparing);
|
||||||
break;
|
break;
|
||||||
case RASCS_AllDevicesConnected:
|
case RASCS_AllDevicesConnected:
|
||||||
//qDebug()<<__FUNCTION__ << __LINE__;
|
//qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
setConnectionState(Preparing);
|
setConnectionState(Vpn::ConnectionState::Preparing);
|
||||||
break;
|
break;
|
||||||
case RASCS_Authenticate:
|
case RASCS_Authenticate:
|
||||||
//qDebug()<<__FUNCTION__ << __LINE__;
|
//qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
setConnectionState(Preparing);
|
setConnectionState(Vpn::ConnectionState::Preparing);
|
||||||
break;
|
break;
|
||||||
case RASCS_AuthNotify:
|
case RASCS_AuthNotify:
|
||||||
//qDebug()<<__FUNCTION__ << __LINE__;
|
//qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
if (dwError != 0) {
|
if (dwError != 0) {
|
||||||
//qDebug() << "have error" << dwError;
|
//qDebug() << "have error" << dwError;
|
||||||
setConnectionState(Disconnected);
|
setConnectionState(Vpn::ConnectionState::Disconnected);
|
||||||
} else {
|
} else {
|
||||||
//qDebug() << "RASCS_AuthNotify but no error" << dwError;
|
//qDebug() << "RASCS_AuthNotify but no error" << dwError;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RASCS_AuthRetry:
|
case RASCS_AuthRetry:
|
||||||
//qDebug()<<__FUNCTION__ << __LINE__;
|
//qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
setConnectionState(Preparing);
|
setConnectionState(Vpn::ConnectionState::Preparing);
|
||||||
break;
|
break;
|
||||||
case RASCS_AuthCallback:
|
case RASCS_AuthCallback:
|
||||||
qDebug()<<__FUNCTION__ << __LINE__;
|
qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
|
@ -151,16 +151,16 @@ void Ikev2Protocol::newConnectionStateEventReceived(UINT unMsg, tagRASCONNSTATE
|
||||||
qDebug()<<__FUNCTION__ << __LINE__;
|
qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
break;
|
break;
|
||||||
case RASCS_PasswordExpired:
|
case RASCS_PasswordExpired:
|
||||||
setConnectionState(Error);
|
setConnectionState(Vpn::ConnectionState::Error);
|
||||||
qDebug()<<__FUNCTION__ << __LINE__;
|
qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RASCS_Connected: // = RASCS_DONE:
|
case RASCS_Connected: // = RASCS_DONE:
|
||||||
setConnectionState(Connected);
|
setConnectionState(Vpn::ConnectionState::Connected);
|
||||||
//qDebug()<<__FUNCTION__ << __LINE__;
|
//qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
break;
|
break;
|
||||||
case RASCS_Disconnected:
|
case RASCS_Disconnected:
|
||||||
setConnectionState(Disconnected);
|
setConnectionState(Vpn::ConnectionState::Disconnected);
|
||||||
//qDebug()<<__FUNCTION__ << __LINE__;
|
//qDebug()<<__FUNCTION__ << __LINE__;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -177,7 +177,7 @@ void Ikev2Protocol::readIkev2Configuration(const QJsonObject &configuration)
|
||||||
ErrorCode Ikev2Protocol::start()
|
ErrorCode Ikev2Protocol::start()
|
||||||
{
|
{
|
||||||
QByteArray cert = QByteArray::fromBase64(m_config[config_key::cert].toString().toUtf8());
|
QByteArray cert = QByteArray::fromBase64(m_config[config_key::cert].toString().toUtf8());
|
||||||
setConnectionState(Connecting);
|
setConnectionState(Vpn::ConnectionState::Connecting);
|
||||||
|
|
||||||
QTemporaryFile certFile;
|
QTemporaryFile certFile;
|
||||||
certFile.setAutoRemove(false);
|
certFile.setAutoRemove(false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue