[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [networkmanagement/nm09] /: Add support for 802.1x subject_match
From: Ilia Kats <ilia-kats () gmx ! net>
Date: 2011-08-23 16:43:31
Message-ID: 20110823164331.9F024A6078 () git ! kde ! org
[Download RAW message or body]
Git commit 5f383f9c91e3c9b69f80a2fb2832e97f0540ff5e by Ilia Kats.
Committed on 23/08/2011 at 14:03.
Pushed by iliakats into branch 'nm09'.
Add support for 802.1x subject_match and altsubject_match settings,
introduced in NetworkManager 0.9.0
bump minimum required NM version to 0.9.0
This also introduces a UI setting to display a basic or advanced user
interface. This currently only affects 802.1x settings,but could be
extended to other settings as well.
M +53 -2 backends/NetworkManager/settings/802-1xdbus.cpp
M +6 -4 libs/ui/security/peapwidget.h
M +4 -0 libs/internals/settings/802-1x.cpp
M +76 -7 libs/ui/security/eapmethodpeapbase.ui
M +74 -5 libs/ui/security/eapmethodtlsbase.ui
M +71 -2 libs/ui/security/eapmethodttlsbase.ui
M +2 -2 solidcontrolfuture/solid/CMakeLists.txt
M +93 -9 libs/ui/security/ttlswidget.cpp
M +3 -0 libs/internals/knmserviceprefs.kcfg
M +1 -1 plasma_nm_version.h
M +96 -2 libs/ui/security/tlswidget.cpp
M +1 -1 CMakeLists.txt
M +5 -2 libs/ui/security/ttlswidget.h
M +86 -0 libs/internals/settings/802-1x.h
M +29 -6 settings/config/othersettings.ui
M +1 -0 libs/ui/security/eapmethodinnerauth.h
M +94 -8 libs/ui/security/peapwidget.cpp
M +8 -0 libs/ui/security/eapmethodinnerauth.cpp
M +2 -0 libs/ui/security/tlswidget.h
http://commits.kde.org/networkmanagement/5f383f9c91e3c9b69f80a2fb2832e97f0540ff5e
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e16ee0d..60bcec7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
project(plasma-networkmanagement)
option(INSTALL_KNM_AUTOSTART "Install the autostart file for knetworkmanager. \
Warning: This prevents the plasmoid from working properly")
-set (MINIMUM_NM_VERSION_REQUIRED "0.8.999")
+set (MINIMUM_NM_VERSION_REQUIRED "0.9.0")
find_package(KDE4 REQUIRED)
include (KDE4Defaults)
diff --git a/backends/NetworkManager/settings/802-1xdbus.cpp \
b/backends/NetworkManager/settings/802-1xdbus.cpp index a2549f2..edcd158 100644
--- a/backends/NetworkManager/settings/802-1xdbus.cpp
+++ b/backends/NetworkManager/settings/802-1xdbus.cpp
@@ -31,6 +31,12 @@ void Security8021xDbus::fromMap(const QVariantMap & map)
if (map.contains(QLatin1String(NM_SETTING_802_1X_CA_PATH))) {
setting->setCapath(map.value(QLatin1String(NM_SETTING_802_1X_CA_PATH)).value<QString>());
}
+ if (map.contains(QLatin1String(NM_SETTING_802_1X_SUBJECT_MATCH))) {
+ setting->setSubjectmatch(map.value(QLatin1String(NM_SETTING_802_1X_SUBJECT_MATCH)).value<QString>());
+ }
+ if (map.contains(QLatin1String(NM_SETTING_802_1X_ALTSUBJECT_MATCHES))) {
+ setting->setAltsubjectmatches(map.value(QLatin1String(NM_SETTING_802_1X_ALTSUBJECT_MATCHES)).value<QStringList>());
+ }
if (map.contains(QLatin1String(NM_SETTING_802_1X_CLIENT_CERT))) {
setting->setClientcert(map.value(QLatin1String(NM_SETTING_802_1X_CLIENT_CERT)).value<QByteArray>());
}
@@ -44,10 +50,36 @@ void Security8021xDbus::fromMap(const QVariantMap & map)
setting->setPhase1fastprovisioning(map.value(QLatin1String(NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING)).value<QString>());
}
if (map.contains(QLatin1String(NM_SETTING_802_1X_PHASE2_AUTH))) {
- setting->setPhase2auth(map.value(QLatin1String(NM_SETTING_802_1X_PHASE2_AUTH)).value<int>());
+ QString auth = \
map.value(QLatin1String(NM_SETTING_802_1X_PHASE2_AUTH)).value<QString>(); + if \
(auth == QLatin1String("pap")) + \
setting->setPhase2auth(Knm::Security8021xSetting::EnumPhase2auth::pap); + else \
if (auth == QLatin1String("mschap")) + \
setting->setPhase2auth(Knm::Security8021xSetting::EnumPhase2auth::mschap); + \
else if (auth == QLatin1String("mschapv2")) + \
setting->setPhase2auth(Knm::Security8021xSetting::EnumPhase2auth::mschapv2); + \
else if (auth == QLatin1String("chap")) + \
setting->setPhase2auth(Knm::Security8021xSetting::EnumPhase2auth::chap); + \
else if (auth == QLatin1String("md5")) + \
setting->setPhase2auth(Knm::Security8021xSetting::EnumPhase2auth::md5); + else \
if (auth == QLatin1String("gtc")) + \
setting->setPhase2auth(Knm::Security8021xSetting::EnumPhase2auth::gtc); + else \
if (auth == QLatin1String("otp")) + \
setting->setPhase2auth(Knm::Security8021xSetting::EnumPhase2auth::otp); + else \
if (auth == QLatin1String("tls")) + \
setting->setPhase2auth(Knm::Security8021xSetting::EnumPhase2auth::tls); }
if (map.contains(QLatin1String(NM_SETTING_802_1X_PHASE2_AUTHEAP))) {
- setting->setPhase2autheap(map.value(QLatin1String(NM_SETTING_802_1X_PHASE2_AUTHEAP)).value<int>());
+ QString eap = \
map.value(QLatin1String(NM_SETTING_802_1X_PHASE2_AUTHEAP)).value<QString>(); + \
if (eap == QLatin1String("md5")) + \
setting->setPhase2autheap(Knm::Security8021xSetting::EnumPhase2autheap::md5); + \
else if (eap == QLatin1String("gtc")) + \
setting->setPhase2autheap(Knm::Security8021xSetting::EnumPhase2autheap::gtc); + \
else if (eap == QLatin1String("otp")) + \
setting->setPhase2autheap(Knm::Security8021xSetting::EnumPhase2autheap::otp); + \
else if (eap == QLatin1String("mschapv2")) + \
setting->setPhase2autheap(Knm::Security8021xSetting::EnumPhase2autheap::mschapv2); + \
else if (eap == QLatin1String("tls")) + \
setting->setPhase2autheap(Knm::Security8021xSetting::EnumPhase2autheap::tls); }
if (map.contains(QLatin1String(NM_SETTING_802_1X_PHASE2_CA_CERT))) {
setting->setPhase2cacert(map.value(QLatin1String(NM_SETTING_802_1X_PHASE2_CA_CERT)).value<QByteArray>());
@@ -55,6 +87,12 @@ void Security8021xDbus::fromMap(const QVariantMap & map)
if (map.contains(QLatin1String(NM_SETTING_802_1X_PHASE2_CA_PATH))) {
setting->setPhase2capath(map.value(QLatin1String(NM_SETTING_802_1X_PHASE2_CA_PATH)).value<QString>());
}
+ if (map.contains(QLatin1String(NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH))) {
+ setting->setPhase2subjectmatch(map.value(QLatin1String(NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH)).value<QString>());
+ }
+ if (map.contains(QLatin1String(NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES))) {
+ setting->setPhase2altsubjectmatches(map.value(QLatin1String(NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES)).value<QStringList>());
+ }
if (map.contains(QLatin1String(NM_SETTING_802_1X_PHASE2_CLIENT_CERT))) {
setting->setPhase2clientcert(map.value(QLatin1String(NM_SETTING_802_1X_PHASE2_CLIENT_CERT)).value<QByteArray>());
}
@@ -114,6 +152,12 @@ QVariantMap Security8021xDbus::toMap()
if (!setting->capath().isEmpty()) {
map.insert(QLatin1String(NM_SETTING_802_1X_CA_PATH), setting->capath());
}
+ if (!setting->subjectmatch().isEmpty()) {
+ map.insert(QLatin1String(NM_SETTING_802_1X_SUBJECT_MATCH), \
setting->subjectmatch()); + }
+ if (!setting->altsubjectmatches().isEmpty()) {
+ map.insert(QLatin1String(NM_SETTING_802_1X_ALTSUBJECT_MATCHES), \
setting->altsubjectmatches()); + }
if (!setting->clientcert().isEmpty()) {
map.insert(QLatin1String(NM_SETTING_802_1X_CLIENT_CERT), \
setting->clientcert()); }
@@ -158,6 +202,9 @@ QVariantMap Security8021xDbus::toMap()
case Knm::Security8021xSetting::EnumPhase2auth::otp:
map.insert(QLatin1String(NM_SETTING_802_1X_PHASE2_AUTH), "otp");
break;
+ case Knm::Security8021xSetting::EnumPhase2auth::tls:
+ map.insert(QLatin1String(NM_SETTING_802_1X_PHASE2_AUTH), "tls");
+ break;
}
switch (setting->phase2autheap()) {
case Knm::Security8021xSetting::EnumPhase2autheap::none:
@@ -183,6 +230,10 @@ QVariantMap Security8021xDbus::toMap()
map.insert(QLatin1String(NM_SETTING_802_1X_PHASE2_CA_CERT), \
setting->phase2cacert()); if (!setting->phase2capath().isEmpty())
map.insert(QLatin1String(NM_SETTING_802_1X_PHASE2_CA_PATH), \
setting->phase2capath()); + if (!setting->phase2subjectmatch().isEmpty())
+ map.insert(QLatin1String(NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH), \
setting->phase2subjectmatch()); + if \
(!setting->phase2altsubjectmatches().isEmpty()) + \
map.insert(QLatin1String(NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES), \
setting->phase2altsubjectmatches()); if (!setting->phase2clientcert().isEmpty())
map.insert(QLatin1String(NM_SETTING_802_1X_PHASE2_CLIENT_CERT), \
setting->phase2clientcert()); if (!setting->phase2privatekey().isEmpty())
diff --git a/libs/internals/knmserviceprefs.kcfg \
b/libs/internals/knmserviceprefs.kcfg index 39e633f..3d9787b 100644
--- a/libs/internals/knmserviceprefs.kcfg
+++ b/libs/internals/knmserviceprefs.kcfg
@@ -38,6 +38,9 @@
<choice name="KBits_s"/>
</choices>
</entry>
+ <entry name="ShowAdvancedSettings" type="Bool">
+ <default>false</default>
+ </entry>
</group>
<group name="SystemTray">
<entry name="IconCount" type="UInt">
diff --git a/libs/internals/settings/802-1x.cpp b/libs/internals/settings/802-1x.cpp
index 4914c4e..704f10a 100644
--- a/libs/internals/settings/802-1x.cpp
+++ b/libs/internals/settings/802-1x.cpp
@@ -20,6 +20,8 @@ Security8021xSetting::Security8021xSetting(Security8021xSetting \
*setting) : Sett setAnonymousidentity(setting->anonymousidentity());
setCacert(setting->cacert());
setCapath(setting->capath());
+ setSubjectmatch(setting->subjectmatch());
+ setAltsubjectmatches(setting->altsubjectmatches());
setClientcert(setting->clientcert());
setClientcertpath(setting->clientcertpath());
setPhase1peapver(setting->phase1peapver());
@@ -29,6 +31,8 @@ Security8021xSetting::Security8021xSetting(Security8021xSetting \
*setting) : Sett setPhase2autheap(setting->phase2autheap());
setPhase2cacert(setting->phase2cacert());
setPhase2capath(setting->phase2capath());
+ setPhase2subjectmatch(setting->phase2subjectmatch());
+ setPhase2altsubjectmatches(setting->phase2altsubjectmatches());
setPhase2clientcert(setting->phase2clientcert());
setPhase2clientcertpath(setting->phase2clientcertpath());
setPassword(setting->password());
diff --git a/libs/internals/settings/802-1x.h b/libs/internals/settings/802-1x.h
index 7c42d7f..25ed9e3 100644
--- a/libs/internals/settings/802-1x.h
+++ b/libs/internals/settings/802-1x.h
@@ -136,6 +136,47 @@ class KNMINTERNALS_EXPORT Security8021xSetting : public Setting
}
/**
+ Set subject match
+ */
+ void setSubjectmatch( const QString & s)
+ {
+ mSubjectmatch = s;
+ }
+
+ /**
+ Get subject match
+ */
+ QString subjectmatch() const
+ {
+ return mSubjectmatch;
+ }
+
+ /**
+ set altsubject matches
+ */
+ void setAltsubjectmatches( const QStringList & v)
+ {
+ mAltsubjectmatches = v;
+ }
+
+ /**
+ add altsubject match
+ */
+ void addAltsubjectmatch( const QString & s)
+ {
+ if (!mAltsubjectmatches.contains(s))
+ mAltsubjectmatches.append(s);
+ }
+
+ /**
+ get altsubject matches
+ */
+ QStringList altsubjectmatches() const
+ {
+ return mAltsubjectmatches;
+ }
+
+ /**
Set Client Cert
*/
void setClientcert( const QByteArray & v )
@@ -300,6 +341,47 @@ class KNMINTERNALS_EXPORT Security8021xSetting : public Setting
}
/**
+ Set Phase 2 subject match
+ */
+ void setPhase2subjectmatch( const QString & s)
+ {
+ mPhase2subjectmatch = s;
+ }
+
+ /**
+ Get Phase 2 subject match
+ */
+ QString phase2subjectmatch() const
+ {
+ return mPhase2subjectmatch;
+ }
+
+ /**
+ set Phase 2 altsubject matches
+ */
+ void setPhase2altsubjectmatches( const QStringList & v)
+ {
+ mPhase2altsubjectmatches = v;
+ }
+
+ /**
+ add Phase 2 altsubject match
+ */
+ void addPhase2altsubjectmatch( const QString & s)
+ {
+ if (!mPhase2altsubjectmatches.contains(s))
+ mPhase2altsubjectmatches.append(s);
+ }
+
+ /**
+ get Phase 2 altsubject matches
+ */
+ QStringList phase2altsubjectmatches() const
+ {
+ return mPhase2altsubjectmatches;
+ }
+
+ /**
Set Phase 2 client cert
*/
void setPhase2clientcert( const QByteArray & v )
@@ -653,6 +735,8 @@ kDebug() << eap;
QString mAnonymousidentity;
QByteArray mCacert;
QString mCapath;
+ QString mSubjectmatch;
+ QStringList mAltsubjectmatches;
QByteArray mClientcert;
QString mClientcertpath;
int mPhase1peapver;
@@ -662,6 +746,8 @@ kDebug() << eap;
int mPhase2autheap;
QByteArray mPhase2cacert;
QString mPhase2capath;
+ QString mPhase2subjectmatch;
+ QStringList mPhase2altsubjectmatches;
QByteArray mPhase2clientcert;
QString mPhase2clientcertpath;
QString mPassword;
diff --git a/libs/ui/security/eapmethodinnerauth.cpp \
b/libs/ui/security/eapmethodinnerauth.cpp index b84f56e..891f08a 100644
--- a/libs/ui/security/eapmethodinnerauth.cpp
+++ b/libs/ui/security/eapmethodinnerauth.cpp
@@ -34,6 +34,14 @@ EapMethodInnerAuth::EapMethodInnerAuth(Knm::Connection* \
connection, QWidget * pa
d->innerAuth->label->setText(i18nc("Label for inner auth combobox", "&Inner \
Authentication:")); }
+EapMethodInnerAuth::EapMethodInnerAuth(Knm::Connection* connection, \
EapMethodInnerAuthPrivate &dd, QWidget * parent) +: EapMethod(dd, connection, parent)
+{
+ Q_D(EapMethodInnerAuth);
+ d->innerAuth = new EapMethodStack(connection, this);
+ d->innerAuth->label->setText(i18nc("Label for inner auth combobox", "&Inner \
Authentication:")); +}
+
EapMethodInnerAuth::~EapMethodInnerAuth()
{
}
diff --git a/libs/ui/security/eapmethodinnerauth.h \
b/libs/ui/security/eapmethodinnerauth.h index 10e8919..bdbb530 100644
--- a/libs/ui/security/eapmethodinnerauth.h
+++ b/libs/ui/security/eapmethodinnerauth.h
@@ -31,6 +31,7 @@ Q_OBJECT
Q_DECLARE_PRIVATE(EapMethodInnerAuth)
public:
EapMethodInnerAuth(Knm::Connection* connection, QWidget * parent = 0);
+ EapMethodInnerAuth(Knm::Connection* connection, EapMethodInnerAuthPrivate &dd, \
QWidget * parent = 0); virtual ~EapMethodInnerAuth();
public Q_SLOTS:
diff --git a/libs/ui/security/eapmethodpeapbase.ui \
b/libs/ui/security/eapmethodpeapbase.ui index 4b9c5fd..744e1e7 100644
--- a/libs/ui/security/eapmethodpeapbase.ui
+++ b/libs/ui/security/eapmethodpeapbase.ui
@@ -7,12 +7,12 @@
<x>0</x>
<y>0</y>
<width>400</width>
- <height>300</height>
+ <height>351</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <layout class="QGridLayout" name="gridLayout">
+ <layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
@@ -45,7 +45,14 @@
<item row="1" column="1">
<widget class="KUrlRequester" name="kurCaCert"/>
</item>
- <item row="3" column="0">
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="chkUseSystemCaCerts">
+ <property name="text">
+ <string>Use Syste&m CA Certs</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>PEAP &Version:</string>
@@ -58,7 +65,7 @@
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="6" column="1">
<widget class="KComboBox" name="cboPeapVersion">
<item>
<property name="text">
@@ -77,13 +84,70 @@
</item>
</widget>
</item>
- <item row="2" column="1">
- <widget class="QCheckBox" name="chkUseSystemCaCerts">
+ <item row="3" column="0">
+ <widget class="QLabel" name="lblSubjectMatch">
<property name="text">
- <string>Use Syste&m CA Certs</string>
+ <string>Subject Match:</string>
</property>
</widget>
</item>
+ <item row="3" column="1">
+ <widget class="KLineEdit" name="leSubjectMatch">
+ <property name="toolTip">
+ <string>Only connect to servers whose certficate subject matches this. For \
the syntax see the wpa_supplicant documentation.</string> + </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="lblAltSubjectMatches">
+ <property name="text">
+ <string>Alternative Subject Matches:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLineEdit" name="leAltSubjectMatches">
+ <property name="toolTip">
+ <string>Only connect to servers whose certificate contains at least one of \
the entries. For the syntax see the wpa_supplicant documentation. Use ',' to separate \
entries.</string> + </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KPushButton" name="altSubjectMatchesMoreBtn">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="lblConnectToTheseServers">
+ <property name="text">
+ <string>Connect to these Servers:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="KLineEdit" name="leConnectToTheseServers">
+ <property name="toolTip">
+ <string>Only connect to these servers. Use ',' to separate \
entries.</string> + </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KPushButton" name="connectToTheseServersMoreBtn">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</item>
<item>
@@ -108,6 +172,11 @@
<header>kurlrequester.h</header>
</customwidget>
<customwidget>
+ <class>KPushButton</class>
+ <extends>QPushButton</extends>
+ <header>kpushbutton.h</header>
+ </customwidget>
+ <customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
diff --git a/libs/ui/security/eapmethodtlsbase.ui \
b/libs/ui/security/eapmethodtlsbase.ui index 8d0c773..d8ffdf4 100644
--- a/libs/ui/security/eapmethodtlsbase.ui
+++ b/libs/ui/security/eapmethodtlsbase.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>388</width>
- <height>213</height>
+ <height>434</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@@ -68,7 +68,7 @@
</property>
</widget>
</item>
- <item row="4" column="0">
+ <item row="7" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Private &Key:</string>
@@ -81,10 +81,10 @@
</property>
</widget>
</item>
- <item row="4" column="1">
+ <item row="7" column="1">
<widget class="KUrlRequester" name="kurPrivateKey"/>
</item>
- <item row="5" column="0">
+ <item row="8" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Private Key Pass&word:</string>
@@ -97,7 +97,7 @@
</property>
</widget>
</item>
- <item row="5" column="1">
+ <item row="8" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="KLineEdit" name="lePrivateKeyPassword">
@@ -127,6 +127,70 @@
</item>
</layout>
</item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="lblSubjectMatch">
+ <property name="text">
+ <string>Subject Match:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="KLineEdit" name="leSubjectMatch">
+ <property name="toolTip">
+ <string>Only connect to servers whose certficate's subject matches this. For \
the syntax see the wpa_supplicant documentation.</string> + </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="lblAltSubjectMatches">
+ <property name="text">
+ <string>Alternative Subject Matches:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLineEdit" name="leAltSubjectMatches">
+ <property name="toolTip">
+ <string>Only connect to servers whose certificate's alternative subject \
contains at least one of the entries. For the syntax see the wpa_supplicant \
documentation. Use ',' to separate entries.</string> + </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KPushButton" name="altSubjectMatchesMoreBtn">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="6" column="0">
+ <widget class="QLabel" name="lblConnectToTheseServers">
+ <property name="text">
+ <string>Connect to these Servers:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="KLineEdit" name="leConnectToTheseServers">
+ <property name="toolTip">
+ <string>Only connect to these servers. Use ',' to separate \
entries.</string> + </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KPushButton" name="connectToTheseServersMoreBtn">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</item>
<item>
@@ -151,6 +215,11 @@
<header>kurlrequester.h</header>
</customwidget>
<customwidget>
+ <class>KPushButton</class>
+ <extends>QPushButton</extends>
+ <header>kpushbutton.h</header>
+ </customwidget>
+ <customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
diff --git a/libs/ui/security/eapmethodttlsbase.ui \
b/libs/ui/security/eapmethodttlsbase.ui index 4f2e1a9..d3871eb 100644
--- a/libs/ui/security/eapmethodttlsbase.ui
+++ b/libs/ui/security/eapmethodttlsbase.ui
@@ -7,12 +7,12 @@
<x>0</x>
<y>0</y>
<width>400</width>
- <height>300</height>
+ <height>337</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <layout class="QGridLayout" name="gridLayout">
+ <layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
@@ -52,6 +52,70 @@
</property>
</widget>
</item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="lblSubjectMatch">
+ <property name="text">
+ <string>Subject Match:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="KLineEdit" name="leSubjectMatch">
+ <property name="toolTip">
+ <string>Only connect to servers whose certficate's subject matches this. For \
the syntax see the wpa_supplicant documentation.</string> + </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="lblAltSubjectMatches">
+ <property name="text">
+ <string>Alternative Subject Matches:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLineEdit" name="leAltSubjectMatches">
+ <property name="toolTip">
+ <string>Only connect to servers whose certificate's alternative subject \
contains at least one of the entries. For the syntax see the wpa_supplicant \
documentation. Use ',' to separate entries.</string> + </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KPushButton" name="altSubjectMatchesMoreBtn">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="lblConnectToTheseServers">
+ <property name="text">
+ <string>Connect to these Servers:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_1">
+ <item>
+ <widget class="KLineEdit" name="leConnectToTheseServers">
+ <property name="toolTip">
+ <string>Only connect to these servers. Use ',' to separate \
entries.</string> + </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KPushButton" name="connectToTheseServersMoreBtn">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</item>
<item>
@@ -76,6 +140,11 @@
<header>kurlrequester.h</header>
</customwidget>
<customwidget>
+ <class>KPushButton</class>
+ <extends>QPushButton</extends>
+ <header>kpushbutton.h</header>
+ </customwidget>
+ <customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
diff --git a/libs/ui/security/peapwidget.cpp b/libs/ui/security/peapwidget.cpp
index 2bb9d13..01838f6 100644
--- a/libs/ui/security/peapwidget.cpp
+++ b/libs/ui/security/peapwidget.cpp
@@ -21,27 +21,65 @@ along with this program. If not, see \
<http://www.gnu.org/licenses/>.
#include "peapwidget.h"
-#include <nm-setting-8021x.h>
#include <connection.h>
+#include <settings/802-1x.h>
+#include <knmserviceprefs.h>
#include "eapmethodstack.h"
#include "eapmethodsimple.h"
#include "eapmethodinnerauth_p.h"
-#include "settings/802-1x.h"
+
+#include "editlistdialog.h"
+#include "listvalidator.h"
+
+class PeapWidgetPrivate : public EapMethodInnerAuthPrivate
+{
+public:
+ bool showAdvancedSettings;
+ QRegExpValidator *altSubjectValidator;
+ QRegExpValidator *serversValidator;
+};
PeapWidget::PeapWidget(Knm::Connection* connection, QWidget * parent)
-: EapMethodInnerAuth(connection, parent)
+: EapMethodInnerAuth(connection, *new PeapWidgetPrivate(), parent)
{
- Q_D(EapMethodInnerAuth);
+ Q_D(PeapWidget);
setupUi(this);
+ d->altSubjectValidator = new \
QRegExpValidator(QRegExp(QLatin1String("^(DNS:[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_.-]+|EMAIL:[a-zA-Z0-9._-]+@[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_.-]+|URI:[a-zA-Z0-9._-]+:.+)$")), \
this); + d->serversValidator = new \
QRegExpValidator(QRegExp(QLatin1String("^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_.-]+$")), this); \
+ + ListValidator *altSubjectValidator = new ListValidator(this);
+ altSubjectValidator->setInnerValidator(d->altSubjectValidator);
+ leAltSubjectMatches->setValidator(altSubjectValidator);
+
+ ListValidator *serversValidator = new ListValidator(this);
+ serversValidator->setInnerValidator(d->serversValidator);
+ leConnectToTheseServers->setValidator(d->serversValidator);
+
+ KNetworkManagerServicePrefs::self()->readConfig();
+ d->showAdvancedSettings = \
KNetworkManagerServicePrefs::self()->showAdvancedSettings(); + if \
(d->showAdvancedSettings) { + lblConnectToTheseServers->hide();
+ leConnectToTheseServers->hide();
+ connectToTheseServersMoreBtn->hide();
+ connect(altSubjectMatchesMoreBtn, SIGNAL(clicked()), this, \
SLOT(showAltSubjectMatchesEditor())); + } else {
+ lblSubjectMatch->hide();
+ leSubjectMatch->hide();
+ lblAltSubjectMatches->hide();
+ leAltSubjectMatches->hide();
+ altSubjectMatchesMoreBtn->hide();
+ connect(connectToTheseServersMoreBtn, SIGNAL(clicked()), this, \
SLOT(showServersEditor())); + }
+
d->innerAuth->registerEapMethod(Knm::Security8021xSetting::EnumPhase2auth::mschapv2, \
new EapMethodSimple(EapMethodSimple::MsChapV2, connection, d->innerAuth), \
i18nc("MSCHAPv2 inner auth method", "MSCHAPv2"));
d->innerAuth->registerEapMethod(Knm::Security8021xSetting::EnumPhase2auth::md5, \
new EapMethodSimple(EapMethodSimple::MD5, connection, d->innerAuth), i18nc("MD5 \
inner auth method", "MD5"));
d->innerAuth->registerEapMethod(Knm::Security8021xSetting::EnumPhase2auth::gtc, \
new EapMethodSimple(EapMethodSimple::GTC, connection, d->innerAuth), i18nc("GTC \
inner auth method", "GTC"));
- gridLayout->addWidget(d->innerAuth, 4, 0, 2, 2);
+ formLayout->addRow(d->innerAuth);
kurCaCert->setMode(KFile::LocalOnly);
}
@@ -57,7 +95,7 @@ bool PeapWidget::validate() const
void PeapWidget::readConfig()
{
- Q_D(EapMethodInnerAuth);
+ Q_D(PeapWidget);
leAnonIdentity->setText(d->setting->anonymousidentity());
@@ -75,6 +113,19 @@ void PeapWidget::readConfig()
if (d->setting->phase2auth() != Knm::Security8021xSetting::EnumPhase2auth::none) \
{ d->innerAuth->setCurrentEapMethod(d->setting->phase2auth());
}
+
+ leSubjectMatch->setText(d->setting->subjectmatch());
+ QStringList altsubjectmatches = d->setting->altsubjectmatches();
+ leAltSubjectMatches->setText(altsubjectmatches.join(QLatin1String(", ")));
+ if (!d->showAdvancedSettings) {
+ QStringList servers;
+ foreach (const QString &match, altsubjectmatches) {
+ if (match.startsWith(QLatin1String("DNS:")))
+ servers.append(match.right(match.length()-4));
+ }
+ leConnectToTheseServers->setText(servers.join(QLatin1String(", ")));
+ }
+
d->innerAuth->readConfig();
if (d->setting->phase1peapver() == \
Knm::Security8021xSetting::EnumPhase1peapver::zero) @@ -85,7 +136,7 @@ void \
PeapWidget::readConfig()
void PeapWidget::writeConfig()
{
- Q_D(EapMethodInnerAuth);
+ Q_D(PeapWidget);
// make the Setting PEAP
d->setting->setEapFlags(Knm::Security8021xSetting::peap);
@@ -105,6 +156,17 @@ void PeapWidget::writeConfig()
}
}
+ QStringList altsubjectmatches = leAltSubjectMatches->text().remove(QLatin1Char(' \
')).split(QLatin1Char(','), QString::SkipEmptyParts); + if \
(!d->showAdvancedSettings) { + foreach (const QString &match, \
leConnectToTheseServers->text().remove(QLatin1Char(' ')).split(QLatin1Char(','), \
QString::SkipEmptyParts)) { + QString tempstr = QLatin1String("DNS:") + \
match; + if (!altsubjectmatches.contains(tempstr))
+ altsubjectmatches.append(tempstr);
+ }
+ }
+ d->setting->setSubjectmatch(leSubjectMatch->text());
+ d->setting->setAltsubjectmatches(altsubjectmatches);
+
d->innerAuth->writeConfig();
d->setting->setPhase1peapver(cboPeapVersion->currentIndex());
@@ -112,8 +174,32 @@ void PeapWidget::writeConfig()
void PeapWidget::readSecrets()
{
- Q_D(EapMethodInnerAuth);
+ Q_D(PeapWidget);
d->innerAuth->readSecrets();
}
+void PeapWidget::showAltSubjectMatchesEditor()
+{
+ Q_D(PeapWidget);
+ EditListDialog editor;
+ editor.setItems(leAltSubjectMatches->text().remove(QLatin1Char(' \
')).split(QLatin1Char(','), QString::SkipEmptyParts)); + \
editor.setCaption(i18n("Alternative Subject Matches")); + \
editor.setValidator(d->altSubjectValidator); + if (editor.exec() == \
QDialog::Accepted) { + \
leAltSubjectMatches->setText(editor.items().join(QLatin1String(", "))); + }
+}
+
+void PeapWidget::showServersEditor()
+{
+ Q_D(PeapWidget);
+ EditListDialog editor;
+ editor.setItems(leConnectToTheseServers->text().remove(QLatin1Char(' \
')).split(QLatin1Char(','), QString::SkipEmptyParts)); + \
editor.setCaption(i18n("Connect to these Servers")); + \
editor.setValidator(d->serversValidator); + if (editor.exec() == \
QDialog::Accepted) { + \
leConnectToTheseServers->setText(editor.items().join(QLatin1String(", "))); + }
+}
+
// vim: sw=4 sts=4 et tw=100
diff --git a/libs/ui/security/peapwidget.h b/libs/ui/security/peapwidget.h
index 51ad781..95244e6 100644
--- a/libs/ui/security/peapwidget.h
+++ b/libs/ui/security/peapwidget.h
@@ -7,7 +7,7 @@ modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License or (at your option) version 3 or any later version
accepted by the membership of KDE e.V. (or its successor approved
-by the membership of KDE e.V.), which shall act as a proxy
+by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
@@ -25,12 +25,12 @@ along with this program. If not, see \
<http://www.gnu.org/licenses/>. #include "eapmethodinnerauth.h"
#include "ui_eapmethodpeapbase.h"
-#include <KSharedConfig>
+class PeapWidgetPrivate;
class PeapWidget : public EapMethodInnerAuth, public Ui_EapMethodPeapBase
{
Q_OBJECT
-Q_DECLARE_PRIVATE(EapMethodInnerAuth)
+Q_DECLARE_PRIVATE(PeapWidget)
public:
PeapWidget(Knm::Connection* connection, QWidget * parent = 0 );
virtual ~PeapWidget();
@@ -40,7 +40,9 @@ public:
void readConfig();
void writeConfig();
void readSecrets();
-
+private Q_SLOTS:
+ void showAltSubjectMatchesEditor();
+ void showServersEditor();
};
#endif
diff --git a/libs/ui/security/tlswidget.cpp b/libs/ui/security/tlswidget.cpp
index 799128e..b341333 100644
--- a/libs/ui/security/tlswidget.cpp
+++ b/libs/ui/security/tlswidget.cpp
@@ -21,8 +21,12 @@ along with this program. If not, see \
<http://www.gnu.org/licenses/>.
#include "tlswidget.h"
-#include "connection.h"
-#include "settings/802-1x.h"
+#include "editlistdialog.h"
+#include "listvalidator.h"
+
+#include <connection.h>
+#include <settings/802-1x.h>
+#include <knmserviceprefs.h>
#include "eapmethod_p.h"
@@ -35,12 +39,43 @@ public:
}
bool inner;
+ bool showAdvancedSettings;
+ QRegExpValidator *altSubjectValidator;
+ QRegExpValidator *serversValidator;
};
TlsWidget::TlsWidget(bool isInnerMethod, Knm::Connection* connection, QWidget * \
parent) : EapMethod(*new TlsWidgetPrivate(isInnerMethod), connection, parent)
{
+ Q_D(TlsWidget);
setupUi(this);
+ d->altSubjectValidator = new \
QRegExpValidator(QRegExp(QLatin1String("^(DNS:[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_.-]+|EMAIL:[a-zA-Z0-9._-]+@[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_.-]+|URI:[a-zA-Z0-9._-]+:.+)$")), \
this); + d->serversValidator = new \
QRegExpValidator(QRegExp(QLatin1String("^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_.-]+$")), this); \
+ + ListValidator *altSubjectValidator = new ListValidator(this);
+ altSubjectValidator->setInnerValidator(d->altSubjectValidator);
+ leAltSubjectMatches->setValidator(altSubjectValidator);
+
+ ListValidator *serversValidator = new ListValidator(this);
+ serversValidator->setInnerValidator(d->serversValidator);
+ leConnectToTheseServers->setValidator(d->serversValidator);
+
+ KNetworkManagerServicePrefs::self()->readConfig();
+ d->showAdvancedSettings = \
KNetworkManagerServicePrefs::self()->showAdvancedSettings(); + if \
(d->showAdvancedSettings) { + lblConnectToTheseServers->hide();
+ leConnectToTheseServers->hide();
+ connectToTheseServersMoreBtn->hide();
+ connect(altSubjectMatchesMoreBtn, SIGNAL(clicked()), this, \
SLOT(showAltSubjectMatchesEditor())); + } else {
+ lblSubjectMatch->hide();
+ leSubjectMatch->hide();
+ lblAltSubjectMatches->hide();
+ leAltSubjectMatches->hide();
+ altSubjectMatchesMoreBtn->hide();
+ connect(connectToTheseServersMoreBtn, SIGNAL(clicked()), this, \
SLOT(showServersEditor())); + }
+
connect(cmbPrivateKeyPasswordStorage, SIGNAL(currentIndexChanged(int)), this, \
SLOT(privateKeyPasswordStorageChanged(int))); }
@@ -89,6 +124,25 @@ void TlsWidget::readConfig()
}
if (!value.isEmpty())
kurPrivateKey->setUrl(value);
+
+ QStringList altsubjectmatches;
+ if (d->inner) {
+ leSubjectMatch->setText(d->setting->phase2subjectmatch());
+ altsubjectmatches = d->setting->phase2altsubjectmatches();
+ }
+ else {
+ leSubjectMatch->setText(d->setting->subjectmatch());
+ altsubjectmatches = d->setting->altsubjectmatches();
+ }
+ leAltSubjectMatches->setText(altsubjectmatches.join(QLatin1String(", ")));
+ if (!d->showAdvancedSettings) {
+ QStringList servers;
+ foreach (const QString &match, altsubjectmatches) {
+ if (match.startsWith(QLatin1String("DNS:")))
+ servers.append(match.right(match.length()-4));
+ }
+ leConnectToTheseServers->setText(servers.join(QLatin1String(", ")));
+ }
}
void TlsWidget::writeConfig()
@@ -160,6 +214,22 @@ void TlsWidget::writeConfig()
d->inner ? \
d->setting->setPhase2privatekeypasswordflags(Knm::Setting::NotRequired) : \
d->setting->setPrivatekeypasswordflags(Knm::Setting::NotRequired); break;
}
+
+ QStringList altsubjectmatches = leAltSubjectMatches->text().remove(QLatin1Char(' \
')).split(QLatin1Char(','), QString::SkipEmptyParts); + if \
(!d->showAdvancedSettings) { + foreach (const QString &match, \
leConnectToTheseServers->text().remove(QLatin1Char(' ')).split(QLatin1Char(','), \
QString::SkipEmptyParts)) { + QString tempstr = QLatin1String("DNS:") + \
match; + if (!altsubjectmatches.contains(tempstr))
+ altsubjectmatches.append(tempstr);
+ }
+ }
+ if (d->inner) {
+ d->setting->setPhase2subjectmatch(leSubjectMatch->text());
+ d->setting->setPhase2altsubjectmatches(altsubjectmatches);
+ } else {
+ d->setting->setSubjectmatch(leSubjectMatch->text());
+ d->setting->setAltsubjectmatches(altsubjectmatches);
+ }
}
void TlsWidget::readSecrets()
@@ -196,4 +266,28 @@ void TlsWidget::privateKeyPasswordStorageChanged(int type)
}
}
+void TlsWidget::showAltSubjectMatchesEditor()
+{
+ Q_D(TlsWidget);
+ EditListDialog editor;
+ editor.setItems(leAltSubjectMatches->text().remove(QLatin1Char(' \
')).split(QLatin1Char(','), QString::SkipEmptyParts)); + \
editor.setCaption(i18n("Alternative Subject Matches")); + \
editor.setValidator(d->altSubjectValidator); + if (editor.exec() == \
QDialog::Accepted) { + \
leAltSubjectMatches->setText(editor.items().join(QLatin1String(", "))); + }
+}
+
+void TlsWidget::showServersEditor()
+{
+ Q_D(TlsWidget);
+ EditListDialog editor;
+ editor.setItems(leConnectToTheseServers->text().remove(QLatin1Char(' \
')).split(QLatin1Char(','), QString::SkipEmptyParts)); + \
editor.setCaption(i18n("Connect to these Servers")); + \
editor.setValidator(d->serversValidator); + if (editor.exec() == \
QDialog::Accepted) { + \
leConnectToTheseServers->setText(editor.items().join(QLatin1String(", "))); + }
+}
+
// vim: sw=4 sts=4 et tw=100
diff --git a/libs/ui/security/tlswidget.h b/libs/ui/security/tlswidget.h
index 4fbbe0e..640ab1a 100644
--- a/libs/ui/security/tlswidget.h
+++ b/libs/ui/security/tlswidget.h
@@ -52,6 +52,8 @@ public Q_SLOTS:
void setShowPasswords(bool b = true);
private Q_SLOTS:
void privateKeyPasswordStorageChanged(int);
+ void showAltSubjectMatchesEditor();
+ void showServersEditor();
};
#endif
diff --git a/libs/ui/security/ttlswidget.cpp b/libs/ui/security/ttlswidget.cpp
index feca8ad..600a23c 100644
--- a/libs/ui/security/ttlswidget.cpp
+++ b/libs/ui/security/ttlswidget.cpp
@@ -21,21 +21,58 @@ along with this program. If not, see \
<http://www.gnu.org/licenses/>.
#include "ttlswidget.h"
-#include <nm-setting-8021x.h>
-
#include <connection.h>
+#include <settings/802-1x.h>
+#include <knmserviceprefs.h>
#include "eapmethodstack.h"
#include "eapmethodsimple.h"
#include "eapmethodinnerauth_p.h"
-#include "settings/802-1x.h"
+
+#include "editlistdialog.h"
+#include "listvalidator.h"
+
+class TtlsWidgetPrivate : public EapMethodInnerAuthPrivate
+{
+public:
+ bool showAdvancedSettings;
+ QRegExpValidator *altSubjectValidator;
+ QRegExpValidator *serversValidator;
+};
TtlsWidget::TtlsWidget(Knm::Connection* connection, QWidget * parent)
-: EapMethodInnerAuth(connection, parent)
+: EapMethodInnerAuth(connection, *new TtlsWidgetPrivate(), parent)
{
- Q_D(EapMethodInnerAuth);
+ Q_D(TtlsWidget);
setupUi(this);
+ d->altSubjectValidator = new \
QRegExpValidator(QRegExp(QLatin1String("^(DNS:[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_.-]+|EMAIL:[a-zA-Z0-9._-]+@[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_.-]+|URI:[a-zA-Z0-9._-]+:.+)$")), \
this); + d->serversValidator = new \
QRegExpValidator(QRegExp(QLatin1String("^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_.-]+$")), this); \
+ + ListValidator *altSubjectValidator = new ListValidator(this);
+ altSubjectValidator->setInnerValidator(d->altSubjectValidator);
+ leAltSubjectMatches->setValidator(altSubjectValidator);
+
+ ListValidator *serversValidator = new ListValidator(this);
+ serversValidator->setInnerValidator(d->serversValidator);
+ leConnectToTheseServers->setValidator(d->serversValidator);
+
+ KNetworkManagerServicePrefs::self()->readConfig();
+ d->showAdvancedSettings = \
KNetworkManagerServicePrefs::self()->showAdvancedSettings(); + if \
(d->showAdvancedSettings) { + lblConnectToTheseServers->hide();
+ leConnectToTheseServers->hide();
+ connectToTheseServersMoreBtn->hide();
+ connect(altSubjectMatchesMoreBtn, SIGNAL(clicked()), this, \
SLOT(showAltSubjectMatchesEditor())); + } else {
+ lblSubjectMatch->hide();
+ leSubjectMatch->hide();
+ lblAltSubjectMatches->hide();
+ leAltSubjectMatches->hide();
+ altSubjectMatchesMoreBtn->hide();
+ connect(connectToTheseServersMoreBtn, SIGNAL(clicked()), this, \
SLOT(showServersEditor())); + }
+
d->innerAuth->registerEapMethod(Knm::Security8021xSetting::EnumPhase2auth::pap,
new EapMethodSimple(EapMethodSimple::Pap, connection, d->innerAuth),
i18nc("PAP inner auth method", "PAP"));
@@ -48,7 +85,7 @@ TtlsWidget::TtlsWidget(Knm::Connection* connection, QWidget * \
parent)
d->innerAuth->registerEapMethod(Knm::Security8021xSetting::EnumPhase2auth::chap,
new EapMethodSimple(EapMethodSimple::Chap, connection, d->innerAuth),
i18nc("CHAP inner auth method", "CHAP"));
- gridLayout->addWidget(d->innerAuth, 3, 0, 2, 2);
+ formLayout->addRow(d->innerAuth);
}
TtlsWidget::~TtlsWidget()
@@ -62,7 +99,7 @@ bool TtlsWidget::validate() const
void TtlsWidget::readConfig()
{
- Q_D(EapMethodInnerAuth);
+ Q_D(TtlsWidget);
leAnonIdentity->setText(d->setting->anonymousidentity());
if (d->setting->useSystemCaCerts()) {
@@ -81,12 +118,25 @@ void TtlsWidget::readConfig()
} else {
d->innerAuth->setCurrentEapMethod(d->setting->phase2auth());
}
+
+ leSubjectMatch->setText(d->setting->subjectmatch());
+ QStringList altsubjectmatches = d->setting->altsubjectmatches();
+ leAltSubjectMatches->setText(altsubjectmatches.join(QLatin1String(", ")));
+ if (!d->showAdvancedSettings) {
+ QStringList servers;
+ foreach (const QString &match, altsubjectmatches) {
+ if (match.startsWith(QLatin1String("DNS:")))
+ servers.append(match.right(match.length()-4));
+ }
+ leConnectToTheseServers->setText(servers.join(QLatin1String(", ")));
+ }
+
d->innerAuth->readConfig();
}
void TtlsWidget::writeConfig()
{
- Q_D(EapMethodInnerAuth);
+ Q_D(TtlsWidget);
// make the Setting TTLS
d->setting->setEapFlags(Knm::Security8021xSetting::ttls);
// TTLS specific config
@@ -104,14 +154,48 @@ void TtlsWidget::writeConfig()
d->setting->setCacert(url.path());
}
+ QStringList altsubjectmatches = leAltSubjectMatches->text().remove(QLatin1Char(' \
')).split(QLatin1Char(','), QString::SkipEmptyParts); + if \
(!d->showAdvancedSettings) { + foreach (const QString &match, \
leConnectToTheseServers->text().remove(QLatin1Char(' ')).split(QLatin1Char(','), \
QString::SkipEmptyParts)) { + QString tempstr = QLatin1String("DNS:") + \
match; + if (!altsubjectmatches.contains(tempstr))
+ altsubjectmatches.append(tempstr);
+ }
+ }
+ d->setting->setSubjectmatch(leSubjectMatch->text());
+ d->setting->setAltsubjectmatches(altsubjectmatches);
+
d->innerAuth->writeConfig();
}
void TtlsWidget::readSecrets()
{
- Q_D(EapMethodInnerAuth);
+ Q_D(TtlsWidget);
d->innerAuth->readSecrets();
}
+void TtlsWidget::showAltSubjectMatchesEditor()
+{
+ Q_D(TtlsWidget);
+ EditListDialog editor;
+ editor.setItems(leAltSubjectMatches->text().remove(QLatin1Char(' \
')).split(QLatin1Char(','), QString::SkipEmptyParts)); + \
editor.setCaption(i18n("Alternative Subject Matches")); + \
editor.setValidator(d->altSubjectValidator); + if (editor.exec() == \
QDialog::Accepted) { + \
leAltSubjectMatches->setText(editor.items().join(QLatin1String(", "))); + }
+}
+
+void TtlsWidget::showServersEditor()
+{
+ Q_D(TtlsWidget);
+ EditListDialog editor;
+ editor.setItems(leConnectToTheseServers->text().remove(QLatin1Char(' \
')).split(QLatin1Char(','), QString::SkipEmptyParts)); + \
editor.setCaption(i18n("Connect to these Servers")); + \
editor.setValidator(d->serversValidator); + if (editor.exec() == \
QDialog::Accepted) { + \
leConnectToTheseServers->setText(editor.items().join(QLatin1String(", "))); + }
+}
// vim: sw=4 sts=4 et tw=100
diff --git a/libs/ui/security/ttlswidget.h b/libs/ui/security/ttlswidget.h
index b1a9049..d0bf074 100644
--- a/libs/ui/security/ttlswidget.h
+++ b/libs/ui/security/ttlswidget.h
@@ -7,7 +7,7 @@ modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License or (at your option) version 3 or any later version
accepted by the membership of KDE e.V. (or its successor approved
-by the membership of KDE e.V.), which shall act as a proxy
+by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
@@ -30,7 +30,7 @@ class TtlsWidgetPrivate;
class TtlsWidget : public EapMethodInnerAuth, public Ui_EapMethodTtlsBase
{
Q_OBJECT
-Q_DECLARE_PRIVATE(EapMethodInnerAuth)
+Q_DECLARE_PRIVATE(TtlsWidget)
public:
TtlsWidget(Knm::Connection* connection, QWidget * parent = 0);
virtual ~TtlsWidget();
@@ -40,6 +40,9 @@ public:
void readConfig();
void writeConfig();
void readSecrets();
+private Q_SLOTS:
+ void showAltSubjectMatchesEditor();
+ void showServersEditor();
};
#endif
diff --git a/plasma_nm_version.h b/plasma_nm_version.h
index fa0a29e..d654892 100644
--- a/plasma_nm_version.h
+++ b/plasma_nm_version.h
@@ -1,4 +1,4 @@
#ifndef PLASMA_NM_VERSION_H
#define PLASMA_NM_VERSION_H
-static const char * plasmaNmVersion = "nm09-20110822";
+static const char * plasmaNmVersion = "(no branch)-20110823";
#endif
diff --git a/settings/config/othersettings.ui b/settings/config/othersettings.ui
index d6fd752..733fa33 100644
--- a/settings/config/othersettings.ui
+++ b/settings/config/othersettings.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>436</width>
- <height>148</height>
+ <height>180</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
@@ -118,21 +118,21 @@
</item>
</widget>
</item>
- <item row="5" column="0">
+ <item row="6" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string><b>Events</b></string>
</property>
</widget>
</item>
- <item row="6" column="2">
+ <item row="7" column="2">
<widget class="QPushButton" name="notificationsButton">
<property name="text">
<string>Configure Notifications...</string>
</property>
</widget>
</item>
- <item row="7" column="1">
+ <item row="8" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -145,8 +145,31 @@
</property>
</spacer>
</item>
- <item row="8" column="0">
- <widget class="QLabel" name="lblVersion">
+ <item row="9" column="0">
+ <widget class="QLabel" name="lblVersion"/>
+ </item>
+ <item row="5" column="0" colspan="2">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Display settings as:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="2">
+ <widget class="QComboBox" name="kcfg_ShowAdvancedSettings">
+ <item>
+ <property name="text">
+ <string>Basic</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Advanced</string>
+ </property>
+ </item>
</widget>
</item>
</layout>
diff --git a/solidcontrolfuture/solid/CMakeLists.txt \
b/solidcontrolfuture/solid/CMakeLists.txt index f55d670..c6407de 100644
--- a/solidcontrolfuture/solid/CMakeLists.txt
+++ b/solidcontrolfuture/solid/CMakeLists.txt
@@ -1,9 +1,9 @@
include(MacroEnsureVersion)
macro_optional_find_package(NetworkManager)
-
+
set(HAVE_NETWORKMANAGER FALSE)
if(NETWORKMANAGER_FOUND)
- macro_ensure_version("0.8.996" ${NETWORKMANAGER_VERSION} NM_0_9)
+ macro_ensure_version("0.9.0" ${NETWORKMANAGER_VERSION} NM_0_9)
if (NM_0_9)
message(STATUS "Will build networkmanager-0.9")
set(HAVE_NETWORKMANAGER TRUE)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic