Finish 802.1x settings stuff (not fully tested)

main
Aaron Rainbolt 1 year ago
parent f8a2c45843
commit bc06fb5639

@ -83,8 +83,6 @@ QVariantMap ConnectionSettingsEngine::readConnectionSettings(QString connUuidStr
result.insert("autoconnectPriority", connSettings->autoconnectPriority()); result.insert("autoconnectPriority", connSettings->autoconnectPriority());
result.insert("allUsersMayConnect", connSettings->permissions().isEmpty() ? true : false); result.insert("allUsersMayConnect", connSettings->permissions().isEmpty() ? true : false);
qWarning() << connSettings->toMap();
QStringList secondaryConns = connSettings->secondaries(); QStringList secondaryConns = connSettings->secondaries();
NetworkManager::Connection::List list = NetworkManager::listConnections(); NetworkManager::Connection::List list = NetworkManager::listConnections();
@ -242,6 +240,17 @@ QVariantMap ConnectionSettingsEngine::readConnectionSettings(QString connUuidStr
default: default:
; ;
} }
switch (connSecurity802_1xSetting->passwordFlags()) {
case NetworkManager::Setting::None:
result.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers);
break;
case NetworkManager::Setting::AgentOwned:
result.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser);
break;
case NetworkManager::Setting::NotSaved:
result.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved);
break;
}
} else { } else {
result.insert("802.1xEnabled", false); result.insert("802.1xEnabled", false);
} }
@ -367,7 +376,6 @@ void ConnectionSettingsEngine::modifyConnectionSettings(QString connUuidStr, QVa
} }
if (settings["802.1xEnabled"].isValid() && settings["802.1xEnabled"].toBool()) { if (settings["802.1xEnabled"].isValid() && settings["802.1xEnabled"].toBool()) {
NetworkManager::Security8021xSetting secSetting;
QList<NetworkManager::Security8021xSetting::EapMethod> eapMethodsList; QList<NetworkManager::Security8021xSetting::EapMethod> eapMethodsList;
switch (settings["802.1xAuthMode"].toInt()) { switch (settings["802.1xAuthMode"].toInt()) {
case ConnectionSettingsEngine::Security802_1xAuthMd5: case ConnectionSettingsEngine::Security802_1xAuthMd5:
@ -424,7 +432,7 @@ void ConnectionSettingsEngine::modifyConnectionSettings(QString connUuidStr, QVa
case ConnectionSettingsEngine::Security802_1xAuthTtls: case ConnectionSettingsEngine::Security802_1xAuthTtls:
eapMethodsList.append(NetworkManager::Security8021xSetting::EapMethodTtls); eapMethodsList.append(NetworkManager::Security8021xSetting::EapMethodTtls);
secSetting.setAnonymousIdentity(settings["802.1xTtlsAnonymousIdentity"].toString()); secSetting.setAnonymousIdentity(settings["802.1xTtlsAnonymousIdentity"].toString());
secSetting.setDomainSuffixMatch(settings["802.1xTtleAnonymousIdentity"].toString()); secSetting.setDomainSuffixMatch(settings["802.1xTtlsDomain"].toString());
secSetting.setCaCertificate(settings["802.1xTtlsCaCertificate"].toString().toUtf8().append('\0')); secSetting.setCaCertificate(settings["802.1xTtlsCaCertificate"].toString().toUtf8().append('\0'));
switch (settings["802.1xTtlsAuthMethod"].toInt()) { switch (settings["802.1xTtlsAuthMethod"].toInt()) {
case ConnectionSettingsEngine::Security802_1xAuthMethodPap: case ConnectionSettingsEngine::Security802_1xAuthMethodPap:
@ -448,7 +456,7 @@ void ConnectionSettingsEngine::modifyConnectionSettings(QString connUuidStr, QVa
case ConnectionSettingsEngine::Security802_1xAuthPeap: case ConnectionSettingsEngine::Security802_1xAuthPeap:
eapMethodsList.append(NetworkManager::Security8021xSetting::EapMethodPeap); eapMethodsList.append(NetworkManager::Security8021xSetting::EapMethodPeap);
secSetting.setAnonymousIdentity(settings["802.1xPeapAnonymousIdentity"].toString()); secSetting.setAnonymousIdentity(settings["802.1xPeapAnonymousIdentity"].toString());
secSetting.setDomainSuffixMatch(settings["802.1xPeapAnonymousIdentity"].toString()); secSetting.setDomainSuffixMatch(settings["802.1xPeapDomain"].toString());
secSetting.setCaCertificate(settings["802.1xPeapCaCertificate"].toString().toUtf8().append('\0')); secSetting.setCaCertificate(settings["802.1xPeapCaCertificate"].toString().toUtf8().append('\0'));
switch (settings["802.1xPeapVersion"].toInt()) { switch (settings["802.1xPeapVersion"].toInt()) {
case ConnectionSettingsEngine::Security802_1xPeapVersionUnknown: case ConnectionSettingsEngine::Security802_1xPeapVersionUnknown:
@ -478,6 +486,17 @@ void ConnectionSettingsEngine::modifyConnectionSettings(QString connUuidStr, QVa
secSetting.setPassword(settings["802.1xPeapPassword"].toString()); secSetting.setPassword(settings["802.1xPeapPassword"].toString());
break; break;
} }
switch (settings["802.1xPasswordStore"].toInt()) {
case ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers:
secSetting.setPasswordFlags(NetworkManager::Setting::None);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser:
secSetting.setPasswordFlags(NetworkManager::Setting::AgentOwned);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved:
secSetting.setPasswordFlags(NetworkManager::Setting::NotSaved);
break;
}
secSetting.setEapMethods(eapMethodsList); secSetting.setEapMethods(eapMethodsList);
ensure802_1xSettings = true; ensure802_1xSettings = true;
} else { } else {

@ -18,7 +18,7 @@ EthernetSettings::EthernetSettings(QString connUuidStr, QWidget *parent) :
ui->tabWidget->addTab(security802_1xSettingsTab, "802.1x Security"); ui->tabWidget->addTab(security802_1xSettingsTab, "802.1x Security");
generalSettingsTab->loadSettings(connSettings); generalSettingsTab->loadSettings(connSettings);
ethernetSettingsTab->loadSettings(connSettings); ethernetSettingsTab->loadSettings(connSettings);
// security802_1xSettingsTab->loadSettings(connSettings); security802_1xSettingsTab->loadSettings(connSettings);
connect(ui->cancelButton, &QPushButton::clicked, this, &EthernetSettings::onCancelButtonClicked); connect(ui->cancelButton, &QPushButton::clicked, this, &EthernetSettings::onCancelButtonClicked);
connect(ui->saveButton, &QPushButton::clicked, this, &EthernetSettings::onSaveButtonClicked); connect(ui->saveButton, &QPushButton::clicked, this, &EthernetSettings::onSaveButtonClicked);
} }
@ -40,7 +40,7 @@ void EthernetSettings::onSaveButtonClicked()
{ {
QVariantMap settings = generalSettingsTab->readSettings(); QVariantMap settings = generalSettingsTab->readSettings();
settings.insert(ethernetSettingsTab->readSettings()); settings.insert(ethernetSettingsTab->readSettings());
// settings.insert(security802_1xSettingsTab->readSettings()); settings.insert(security802_1xSettingsTab->readSettings());
settings.insert("connName", ui->connectionNameLineEdit->text()); settings.insert("connName", ui->connectionNameLineEdit->text());
ConnectionSettingsEngine::modifyConnectionSettings(targetConnUuidStr, settings); ConnectionSettingsEngine::modifyConnectionSettings(targetConnUuidStr, settings);
this->done(0); this->done(0);

@ -1,5 +1,6 @@
#include "security802_1xtab.h" #include "security802_1xtab.h"
#include "ui_security802_1xtab.h" #include "ui_security802_1xtab.h"
#include <QDebug>
Security802_1xTab::Security802_1xTab(QWidget *parent) : Security802_1xTab::Security802_1xTab(QWidget *parent) :
QDialog(parent), QDialog(parent),
@ -8,6 +9,21 @@ Security802_1xTab::Security802_1xTab(QWidget *parent) :
ui->setupUi(this); ui->setupUi(this);
connect(ui->enable802_1xCheckBox, &QCheckBox::stateChanged, this, &Security802_1xTab::onEnable802_1xCheckBoxToggled); connect(ui->enable802_1xCheckBox, &QCheckBox::stateChanged, this, &Security802_1xTab::onEnable802_1xCheckBoxToggled);
onEnable802_1xCheckBoxToggled(Qt::Unchecked); onEnable802_1xCheckBoxToggled(Qt::Unchecked);
QStringList passwordStoreItems;
passwordStoreItems.append(tr("Store password for all users (not encrypted)"));
passwordStoreItems.append(tr("Store password for this user (encrypted)"));
passwordStoreItems.append(tr("Ask for this password every time"));
ui->md5PasswordStoreComboBox->addItems(passwordStoreItems);
ui->tlsPasswordStoreComboBox->addItems(passwordStoreItems);
ui->pwdPasswordStoreComboBox->addItems(passwordStoreItems);
ui->fastPasswordStoreComboBox->addItems(passwordStoreItems);
ui->ttlsPasswordStoreComboBox->addItems(passwordStoreItems);
ui->peapPasswordStoreComboBox->addItems(passwordStoreItems);
ui->fastAutoPacProvisionComboBox->addItems(QStringList() << tr("Anonymous") << tr("Authenticated") << tr("Both"));
ui->fastInnerAuthenticationComboBox->addItems(QStringList() << tr("GTC") << tr("MSCHAPv2"));
ui->ttlsInnerAuthenticationComboBox->addItems(QStringList() << tr("PAP") << tr("CHAP") << tr("MSCHAP") << tr("MSCHAPv2"));
ui->peapVersionComboBox->addItems(QStringList() << tr("Automatic") << tr ("Zero") << tr("One"));
ui->peapInnerAuthenticationComboBox->addItems(QStringList() << tr("MSCHAPv2") << tr("MD5") << tr("GTC"));
} }
Security802_1xTab::~Security802_1xTab() Security802_1xTab::~Security802_1xTab()
@ -15,6 +31,366 @@ Security802_1xTab::~Security802_1xTab()
delete ui; delete ui;
} }
QVariantMap Security802_1xTab::readSettings()
{
QVariantMap output;
if (ui->enable802_1xCheckBox->isChecked()) {
output.insert("802.1xEnabled", true);
switch (ui->authenticationModeTabs->currentIndex()) {
case 0: // MD5
output.insert("802.1xAuthMode", ConnectionSettingsEngine::Security802_1xAuthMd5);
output.insert("802.1xMd5Username", ui->md5UsernameLineEdit->text());
output.insert("802.1xMd5Password", ui->md5PasswordLineEdit->text());
switch (ui->md5PasswordStoreComboBox->currentIndex()) {
case 0: // all users
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers);
break;
case 1: // one user
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser);
break;
case 2: // ask every time
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved);
break;
}
break;
case 1: // TLS
output.insert("802.1xAuthMode", ConnectionSettingsEngine::Security802_1xAuthTls);
output.insert("802.1xTlsIdentity", ui->tlsIdentityLineEdit->text());
output.insert("802.1xTlsDomain", ui->tlsDomainLineEdit->text());
output.insert("802.1xTlsCaCertificate", ui->tlsCaCertificateLineEdit->text());
output.insert("802.1xTlsUserCertificate",ui->tlsUserCertificateLineEdit->text());
output.insert("802.1xTlsUserPrivateKey", ui->tlsUserPrivateKeyLineEdit->text());
output.insert("802.1xTlsUserKeyPassword", ui->tlsUserKeyPasswordLineEdit->text());
switch (ui->tlsPasswordStoreComboBox->currentIndex()) {
case 0: // all users
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers);
break;
case 1: // one user
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser);
break;
case 2: // ask every time
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved);
break;
}
break;
case 2: // PWD
output.insert("802.1xAuthMode", ConnectionSettingsEngine::Security802_1xAuthPwd);
output.insert("802.1xPwdUsername", ui->pwdUsernameLineEdit->text());
output.insert("802.1xPwdPassword", ui->pwdPasswordLineEdit->text());
switch (ui->pwdPasswordStoreComboBox->currentIndex()) {
case 0: // all users
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers);
break;
case 1: // one user
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser);
break;
case 2: // ask every time
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved);
break;
}
break;
case 3: // FAST
output.insert("802.1xAuthMode", ConnectionSettingsEngine::Security802_1xAuthFast);
output.insert("802.1xFastAnonymousIdentity", ui->fastAnonymousIdentityLineEdit->text());
if (ui->fastAutoPacProvisionCheckBox->isChecked()) {
switch (ui->fastAutoPacProvisionComboBox->currentIndex()) {
case 0: // Anonymous
output.insert("802.1xFastProvisioningMode", ConnectionSettingsEngine::Security802_1xFastProvisioningAnonymous);
break;
case 1: // Authenticated
output.insert("802.1xFastProvisioningMode", ConnectionSettingsEngine::Security802_1xFastProvisioningAuthenticated);
break;
case 2: // Both
output.insert("802.1xFastProvisioningMode", ConnectionSettingsEngine::Security802_1xFastProvisioningBoth);
break;
}
} else {
output.insert("802.1xFastProvisioningMode", ConnectionSettingsEngine::Security802_1xFastProvisioningOff);
}
output.insert("802.1xFastPacFile", ui->fastPacFileLineEdit->text());
switch (ui->fastInnerAuthenticationComboBox->currentIndex()) {
case 0: // GTC
output.insert("802.1xFastAuthMethod", ConnectionSettingsEngine::Security802_1xAuthMethodGtc);
break;
case 1: // MSCHAPv2
output.insert("802.1xFastAuthMethod", ConnectionSettingsEngine::Security802_1xAuthMethodMschapv2);
break;
}
output.insert("802.1xFastUsername", ui->fastUsernameLineEdit->text());
output.insert("802.1xFastPassword", ui->fastPasswordLineEdit->text());
switch (ui->fastPasswordStoreComboBox->currentIndex()) {
case 0: // all users
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers);
break;
case 1: // one user
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser);
break;
case 2: // ask every time
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved);
break;
}
break;
case 4: // Tunneled TLS
output.insert("802.1xAuthMode", ConnectionSettingsEngine::Security802_1xAuthTtls);
output.insert("802.1xTtlsAnonymousIdentity", ui->ttlsAnonymousIdentityLineEdit->text());
output.insert("802.1xTtlsDomain", ui->ttlsDomainLineEdit->text());
output.insert("802.1xTtlsCaCertificate", ui->ttlsCaCertificateLineEdit->text());
switch (ui->ttlsInnerAuthenticationComboBox->currentIndex()) {
case 0: // PAP
output.insert("802.1xTtlsAuthMethod", ConnectionSettingsEngine::Security802_1xAuthMethodPap);
break;
case 1: // CHAP
output.insert("802.1xTtlsAuthMethod", ConnectionSettingsEngine::Security802_1xAuthMethodChap);
break;
case 2: // MSCHAP
output.insert("802.1xTtlsAuthMethod", ConnectionSettingsEngine::Security802_1xAuthMethodMschap);
break;
case 3: // MSCHAPv2
output.insert("802.1xTtlsAuthMethod", ConnectionSettingsEngine::Security802_1xAuthMethodMschapv2);
break;
}
output.insert("802.1xTtlsUsername", ui->ttlsUsernameLineEdit->text());
output.insert("802.1xTtlsPassword", ui->ttlsPasswordLineEdit->text());
switch (ui->ttlsPasswordStoreComboBox->currentIndex()) {
case 0: // all users
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers);
break;
case 1: // one user
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser);
break;
case 2: // ask every time
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved);
break;
}
break;
case 5: // Protected EAP
output.insert("802.1xAuthMode", ConnectionSettingsEngine::Security802_1xAuthPeap);
output.insert("802.1xPeapAnonymousIdentity", ui->peapAnonymousIdentityLineEdit->text());
output.insert("802.1xPeapDomain", ui->peapDomainLineEdit->text());
output.insert("802.1xPeapCaCertificate", ui->peapCaCertificateLineEdit->text());
switch (ui->peapVersionComboBox->currentIndex()) {
case 0: // Automatic
output.insert("802.1xPeapVersion", ConnectionSettingsEngine::Security802_1xPeapVersionUnknown);
break;
case 1: // Zero
output.insert("802.1xPeapVersion", ConnectionSettingsEngine::Security802_1xPeapVersionZero);
break;
case 2: // One
output.insert("802.1xPeapVersion", ConnectionSettingsEngine::Security802_1xPeapVersionOne);
break;
}
switch (ui->peapInnerAuthenticationComboBox->currentIndex()) {
case 0: // MSCHAPv2
output.insert("802.1xPeapAuthMethod", ConnectionSettingsEngine::Security802_1xAuthMethodMschapv2);
break;
case 1: // MD5
output.insert("802.1xPeapAuthMethod", ConnectionSettingsEngine::Security802_1xAuthMethodMd5);
break;
case 2: // GTC
output.insert("802.1xPeapAuthMethod", ConnectionSettingsEngine::Security802_1xAuthMethodGtc);
break;
}
output.insert("802.1xPeapUsername", ui->peapUsernameLineEdit->text());
output.insert("802.1xPeapPassword", ui->peapPasswordLineEdit->text());
switch (ui->peapPasswordStoreComboBox->currentIndex()) {
case 0: // all users
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers);
break;
case 1: // one user
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser);
break;
case 2: // ask every time
output.insert("802.1xPasswordStore", ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved);
break;
}
break;
}
} else {
output.insert("802.1xEnabled", false);
}
return output;
}
void Security802_1xTab::loadSettings(QVariantMap settings)
{
if (settings["802.1xEnabled"].isValid() && settings["802.1xEnabled"].toBool()) {
ui->enable802_1xCheckBox->setChecked(true);
switch (settings["802.1xAuthMode"].toInt()) {
case ConnectionSettingsEngine::Security802_1xAuthMd5:
ui->authenticationModeTabs->setCurrentIndex(0);
ui->md5UsernameLineEdit->setText(settings["802.1xMd5Username"].toString());
ui->md5PasswordLineEdit->setText(settings["802.1xMd5Password"].toString());
switch (settings["802.1xPasswordStore"].toInt()) {
case ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers:
ui->md5PasswordStoreComboBox->setCurrentIndex(0);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser:
ui->md5PasswordStoreComboBox->setCurrentIndex(1);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved:
ui->md5PasswordStoreComboBox->setCurrentIndex(2);
break;
}
break;
case ConnectionSettingsEngine::Security802_1xAuthTls:
ui->authenticationModeTabs->setCurrentIndex(1);
ui->tlsIdentityLineEdit->setText(settings["802.1xTlsIdentity"].toString());
ui->tlsDomainLineEdit->setText(settings["802.1xTlsDomain"].toString());
ui->tlsCaCertificateLineEdit->setText(settings["802.1xTlsCaCertificate"].toString());
ui->tlsUserCertificateLineEdit->setText(settings["802.1xTlsUserCertificate"].toString());
ui->tlsUserPrivateKeyLineEdit->setText(settings["802.1xTlsUserPrivateKey"].toString());
ui->tlsUserKeyPasswordLineEdit->setText(settings["802.1xTlsUserKeyPassword"].toString());
switch (settings["802.1xPasswordStore"].toInt()) {
case ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers:
ui->tlsPasswordStoreComboBox->setCurrentIndex(0);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser:
ui->tlsPasswordStoreComboBox->setCurrentIndex(1);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved:
ui->tlsPasswordStoreComboBox->setCurrentIndex(2);
break;
}
break;
case ConnectionSettingsEngine::Security802_1xAuthPwd:
ui->authenticationModeTabs->setCurrentIndex(2);
ui->pwdUsernameLineEdit->setText(settings["802.1xPwdUsername"].toString());
ui->pwdPasswordLineEdit->setText(settings["802.1xPwdPassword"].toString());
switch (settings["802.1xPasswordStore"].toInt()) {
case ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers:
ui->pwdPasswordStoreComboBox->setCurrentIndex(0);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser:
ui->pwdPasswordStoreComboBox->setCurrentIndex(1);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved:
ui->pwdPasswordStoreComboBox->setCurrentIndex(2);
break;
}
break;
case ConnectionSettingsEngine::Security802_1xAuthFast:
ui->authenticationModeTabs->setCurrentIndex(3);
ui->fastAnonymousIdentityLineEdit->setText(settings["802.1xFastAnonymousIdentity"].toString());
switch (settings["802.1xFastProvisioningMode"].toInt()) {
case ConnectionSettingsEngine::Security802_1xFastProvisioningAnonymous:
ui->fastAutoPacProvisionCheckBox->setChecked(true);
ui->fastAutoPacProvisionComboBox->setCurrentIndex(0);
break;
case ConnectionSettingsEngine::Security802_1xFastProvisioningAuthenticated:
ui->fastAutoPacProvisionCheckBox->setChecked(true);
ui->fastAutoPacProvisionComboBox->setCurrentIndex(1);
break;
case ConnectionSettingsEngine::Security802_1xFastProvisioningBoth:
ui->fastAutoPacProvisionCheckBox->setChecked(true);
ui->fastAutoPacProvisionComboBox->setCurrentIndex(2);
break;
case ConnectionSettingsEngine::Security802_1xFastProvisioningOff:
ui->fastAutoPacProvisionCheckBox->setChecked(false);
break;
}
ui->fastPacFileLineEdit->setText(settings["802.1xFastPacFile"].toString());
switch (settings["802.1xFastAuthMethod"].toInt()) {
case ConnectionSettingsEngine::Security802_1xAuthMethodGtc:
ui->fastInnerAuthenticationComboBox->setCurrentIndex(0);
break;
case ConnectionSettingsEngine::Security802_1xAuthMethodMschapv2:
ui->fastInnerAuthenticationComboBox->setCurrentIndex(1);
break;
}
ui->fastUsernameLineEdit->setText(settings["802.1xFastUsername"].toString());
ui->fastPasswordLineEdit->setText(settings["802.1xFastPassword"].toString());
switch (settings["802.1xPasswordStore"].toInt()) {
case ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers:
ui->fastPasswordStoreComboBox->setCurrentIndex(0);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser:
ui->fastPasswordStoreComboBox->setCurrentIndex(1);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved:
ui->fastPasswordStoreComboBox->setCurrentIndex(2);
break;
}
break;
case ConnectionSettingsEngine::Security802_1xAuthTtls:
ui->authenticationModeTabs->setCurrentIndex(4);
ui->ttlsAnonymousIdentityLineEdit->setText(settings["802.1xTtlsAnonymousIdentity"].toString());
ui->ttlsDomainLineEdit->setText(settings["802.1xTtlsDomain"].toString());
ui->ttlsCaCertificateLineEdit->setText(settings["802.1xTtlsCaCertificate"].toString());
switch (settings["802.1xTtlsAuthMethod"].toInt()) {
case ConnectionSettingsEngine::Security802_1xAuthMethodPap:
ui->ttlsInnerAuthenticationComboBox->setCurrentIndex(0);
break;
case ConnectionSettingsEngine::Security802_1xAuthMethodChap:
ui->ttlsInnerAuthenticationComboBox->setCurrentIndex(1);
break;
case ConnectionSettingsEngine::Security802_1xAuthMethodMschap:
ui->ttlsInnerAuthenticationComboBox->setCurrentIndex(2);
break;
case ConnectionSettingsEngine::Security802_1xAuthMethodMschapv2:
ui->ttlsInnerAuthenticationComboBox->setCurrentIndex(3);
break;
}
ui->ttlsUsernameLineEdit->setText(settings["802.1xTtlsUsername"].toString());
ui->ttlsPasswordLineEdit->setText(settings["802.1xTtlsPassword"].toString());
switch (settings["802.1xPasswordStore"].toInt()) {
case ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers:
ui->ttlsPasswordStoreComboBox->setCurrentIndex(0);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser:
ui->ttlsPasswordStoreComboBox->setCurrentIndex(1);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved:
ui->ttlsPasswordStoreComboBox->setCurrentIndex(2);
break;
}
break;
case ConnectionSettingsEngine::Security802_1xAuthPeap:
ui->authenticationModeTabs->setCurrentIndex(5);
ui->peapAnonymousIdentityLineEdit->setText(settings["802.1xPeapAnonymousIdentity"].toString());
ui->peapDomainLineEdit->setText(settings["802.1xPeapDomain"].toString());
ui->peapCaCertificateLineEdit->setText(settings["802.1xPeapCaCertificate"].toString());
switch (settings["802.1xPeapVersion"].toInt()) {
case ConnectionSettingsEngine::Security802_1xPeapVersionUnknown:
ui->peapVersionComboBox->setCurrentIndex(0);
break;
case ConnectionSettingsEngine::Security802_1xPeapVersionZero:
ui->peapVersionComboBox->setCurrentIndex(1);
break;
case ConnectionSettingsEngine::Security802_1xPeapVersionOne:
ui->peapVersionComboBox->setCurrentIndex(2);
break;
}
switch (settings["802.1xPeapAuthMethod"].toInt()) {
case ConnectionSettingsEngine::Security802_1xAuthMethodMschapv2:
ui->peapInnerAuthenticationComboBox->setCurrentIndex(0);
break;
case ConnectionSettingsEngine::Security802_1xAuthMethodMd5:
ui->peapInnerAuthenticationComboBox->setCurrentIndex(1);
break;
case ConnectionSettingsEngine::Security802_1xAuthMethodGtc:
ui->peapInnerAuthenticationComboBox->setCurrentIndex(2);
break;
}
ui->peapUsernameLineEdit->setText(settings["802.1xPeapUsername"].toString());
ui->peapPasswordLineEdit->setText(settings["802.1xPeapPassword"].toString());
switch (settings["802.1xPasswordStore"].toInt()) {
case ConnectionSettingsEngine::Security802_1xPasswordStoreForAllUsers:
ui->peapPasswordStoreComboBox->setCurrentIndex(0);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreForOneUser:
ui->peapPasswordStoreComboBox->setCurrentIndex(1);
break;
case ConnectionSettingsEngine::Security802_1xPasswordStoreNotSaved:
ui->peapPasswordStoreComboBox->setCurrentIndex(2);
break;
}
break;
}
} else {
ui->enable802_1xCheckBox->setChecked(false);
}
}
void Security802_1xTab::onEnable802_1xCheckBoxToggled(int state) void Security802_1xTab::onEnable802_1xCheckBoxToggled(int state)
{ {
switch (state) { switch (state) {

@ -1,6 +1,7 @@
#ifndef SECURITY802_1XTAB_H #ifndef SECURITY802_1XTAB_H
#define SECURITY802_1XTAB_H #define SECURITY802_1XTAB_H
#include "connectionsettingsengine.h"
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui {
@ -15,6 +16,9 @@ public:
explicit Security802_1xTab(QWidget *parent = nullptr); explicit Security802_1xTab(QWidget *parent = nullptr);
~Security802_1xTab(); ~Security802_1xTab();
QVariantMap readSettings();
void loadSettings(QVariantMap settings);
private slots: private slots:
void onEnable802_1xCheckBoxToggled(int state); void onEnable802_1xCheckBoxToggled(int state);

@ -31,7 +31,7 @@
<item> <item>
<widget class="QTabWidget" name="authenticationModeTabs"> <widget class="QTabWidget" name="authenticationModeTabs">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="md5Tab"> <widget class="QWidget" name="md5Tab">
<attribute name="title"> <attribute name="title">
@ -179,7 +179,7 @@
<item row="4" column="1"> <item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="QLineEdit" name="userPrivateKeyLineEdit"/> <widget class="QLineEdit" name="tlsUserPrivateKeyLineEdit"/>
</item> </item>
<item> <item>
<widget class="QPushButton" name="tlsUserPrivateKeyOpenFileButton"> <widget class="QPushButton" name="tlsUserPrivateKeyOpenFileButton">
@ -209,7 +209,7 @@
<item row="3" column="1"> <item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QLineEdit" name="tlsCaUserCertificateLineEdit"/> <widget class="QLineEdit" name="tlsUserCertificateLineEdit"/>
</item> </item>
<item> <item>
<widget class="QPushButton" name="tlsUserCertificateOpenFileButton"> <widget class="QPushButton" name="tlsUserCertificateOpenFileButton">
@ -318,7 +318,7 @@
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="7" column="1">
<widget class="QComboBox" name="fastStorePasswordComboBox"/> <widget class="QComboBox" name="fastPasswordStoreComboBox"/>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
@ -413,16 +413,35 @@
<string>Tunneled TLS</string> <string>Tunneled TLS</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_5"> <layout class="QGridLayout" name="gridLayout_5">
<item row="6" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label_25"> <widget class="QLabel" name="label_23">
<property name="text"> <property name="text">
<string>Password</string> <string>Inner authentication</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1">
<widget class="QLineEdit" name="ttlsUsernameLineEdit"/>
</item>
<item row="8" column="1">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="ttlsPasswordLineEdit"/>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_20"> <widget class="QLabel" name="label_20">
<property name="text"> <property name="text">
@ -433,50 +452,54 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="2" column="0">
<widget class="QLineEdit" name="ttlsDomainLineEdit"/> <widget class="QLabel" name="label_21">
</item> <property name="text">
<item row="2" column="1"> <string>CA certificate</string>
<layout class="QHBoxLayout" name="horizontalLayout_5"> </property>
<item> <property name="alignment">
<widget class="QLineEdit" name="ttlsCaCertificateLineEdit"/> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</item> </property>
<item> </widget>
<widget class="QPushButton" name="ttlsCaCertificateOpenFileButton">
<property name="text">
<string>Open file...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="ttlsCaCertificatePasswordLineEdit"/>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="ttlsAnonymousIdentityLineEdit"/>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_23"> <widget class="QLabel" name="label_24">
<property name="text"> <property name="text">
<string>Inner authentication</string> <string>Username</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="7" column="1">
<widget class="QLabel" name="label_22"> <widget class="QComboBox" name="ttlsPasswordStoreComboBox"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_25">
<property name="text"> <property name="text">
<string>CA certificate password</string> <string>Password</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLineEdit" name="ttlsCaCertificateLineEdit"/>
</item>
<item>
<widget class="QPushButton" name="ttlsCaCertificateOpenFileButton">
<property name="text">
<string>Open file...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="ttlsShowPasswordCheckBox"> <widget class="QCheckBox" name="ttlsShowPasswordCheckBox">
<property name="text"> <property name="text">
<string>Show password</string> <string>Show password</string>
@ -493,14 +516,33 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1"> <item row="1" column="1">
<widget class="QComboBox" name="ttlsStorePasswordComboBox"/> <widget class="QLineEdit" name="ttlsDomainLineEdit"/>
</item> </item>
<item row="4" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="ttlsAnonymousIdentityLineEdit"/>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="ttlsInnerAuthenticationComboBox"/> <widget class="QComboBox" name="ttlsInnerAuthenticationComboBox"/>
</item> </item>
</layout>
</widget>
<widget class="QWidget" name="protectedEapTab">
<attribute name="title">
<string>Protected EAP (PEAP)</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_6">
<item row="5" column="1">
<widget class="QLineEdit" name="peapUsernameLineEdit"/>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="peapInnerAuthenticationComboBox"/>
</item>
<item row="8" column="1">
<widget class="QComboBox" name="peapPasswordStoreComboBox"/>
</item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_21"> <widget class="QLabel" name="label_28">
<property name="text"> <property name="text">
<string>CA certificate</string> <string>CA certificate</string>
</property> </property>
@ -509,16 +551,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1"> <item row="0" column="0">
<widget class="QLineEdit" name="ttlsPasswordLineEdit"/> <widget class="QLabel" name="label_26">
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="ttlsUsernameLineEdit"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_24">
<property name="text"> <property name="text">
<string>Username</string> <string>Anonymous Identity</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -526,7 +562,7 @@
</widget> </widget>
</item> </item>
<item row="9" column="1"> <item row="9" column="1">
<spacer name="verticalSpacer_5"> <spacer name="verticalSpacer_6">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
@ -538,72 +574,6 @@
</property> </property>
</spacer> </spacer>
</item> </item>
</layout>
</widget>
<widget class="QWidget" name="protectedEapTab">
<attribute name="title">
<string>Protected EAP (PEAP)</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Anonymous Identity</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_30">
<property name="text">
<string>PEAP version</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="peapVersionComboBox"/>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="peapDomainLineEdit"/>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="peapUsernameLineEdit"/>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="peapAnonymousIdentityLineEdit"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_29">
<property name="text">
<string>CA certificate password</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="peapShowPasswordCheckBox">
<property name="text">
<string>Show password</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Inner authentication</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1"> <item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
@ -618,32 +588,36 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="1"> <item row="7" column="1">
<widget class="QLineEdit" name="peapCaCertificatePasswordLineEdit"/> <widget class="QCheckBox" name="peapShowPasswordCheckBox">
<property name="text">
<string>Show password</string>
</property>
</widget>
</item> </item>
<item row="6" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_32"> <widget class="QLabel" name="label_31">
<property name="text"> <property name="text">
<string>Username</string> <string>Inner authentication</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="0" column="1">
<widget class="QLabel" name="label_28"> <widget class="QLineEdit" name="peapAnonymousIdentityLineEdit"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_30">
<property name="text"> <property name="text">
<string>CA certificate</string> <string>PEAP version</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1">
<widget class="QLineEdit" name="peapPasswordLineEdit"/>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_27"> <widget class="QLabel" name="label_27">
<property name="text"> <property name="text">
@ -654,13 +628,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="1"> <item row="5" column="0">
<widget class="QComboBox" name="peapStorePasswordComboBox"/> <widget class="QLabel" name="label_32">
<property name="text">
<string>Username</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item> </item>
<item row="5" column="1"> <item row="1" column="1">
<widget class="QComboBox" name="peapInnerAuthenticationComboBox"/> <widget class="QLineEdit" name="peapDomainLineEdit"/>
</item> </item>
<item row="7" column="0"> <item row="6" column="0">
<widget class="QLabel" name="label_33"> <widget class="QLabel" name="label_33">
<property name="text"> <property name="text">
<string>Password</string> <string>Password</string>
@ -670,18 +651,11 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="1"> <item row="6" column="1">
<spacer name="verticalSpacer_6"> <widget class="QLineEdit" name="peapPasswordLineEdit"/>
<property name="orientation"> </item>
<enum>Qt::Vertical</enum> <item row="3" column="1">
</property> <widget class="QComboBox" name="peapVersionComboBox"/>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>

Loading…
Cancel
Save