From c1bf84e15d16a7260f31b47234a329705d162eda Mon Sep 17 00:00:00 2001 From: Nils Freydank Date: Sat, 16 Dec 2017 13:21:00 +0100 Subject: kde-plasma/plasma-nm: Add EAP-PWD support. Wrt upstream bug https://bugs.kde.org/show_bug.cgi?id=387685. Closes: https://github.com/gentoo/gentoo/pull/6565 Package-Manager: Portage-2.3.18, Repoman-2.3.6 --- .../plasma-nm/files/plasma-nm-add_EAP-PWD.patch | 201 +++++++++++++++++++++ kde-plasma/plasma-nm/plasma-nm-5.11.4-r1.ebuild | 67 +++++++ 2 files changed, 268 insertions(+) create mode 100644 kde-plasma/plasma-nm/files/plasma-nm-add_EAP-PWD.patch create mode 100644 kde-plasma/plasma-nm/plasma-nm-5.11.4-r1.ebuild (limited to 'kde-plasma') diff --git a/kde-plasma/plasma-nm/files/plasma-nm-add_EAP-PWD.patch b/kde-plasma/plasma-nm/files/plasma-nm-add_EAP-PWD.patch new file mode 100644 index 000000000000..896a8144d52d --- /dev/null +++ b/kde-plasma/plasma-nm/files/plasma-nm-add_EAP-PWD.patch @@ -0,0 +1,201 @@ +From b98333458ca1edd1cafb2a5b83d45f46faf14103 Mon Sep 17 00:00:00 2001 +From: Jan Grulich +Date: Wed, 13 Dec 2017 08:51:06 +0100 +Subject: 802-1x: Add support for EAP-PWD + +BUG:387685 +--- + libs/editor/settings/security802-1x.cpp | 49 +++++++++++++++++++++++++++++---- + libs/editor/settings/ui/802-1x.ui | 49 +++++++++++++++++++++++++++++---- + 3 files changed, 88 insertions(+), 12 deletions(-) + +diff --git a/libs/editor/settings/security802-1x.cpp b/libs/editor/settings/security802-1x.cpp +index d6405bf..461a38c 100644 +--- a/libs/editor/settings/security802-1x.cpp ++++ b/libs/editor/settings/security802-1x.cpp +@@ -40,6 +40,7 @@ Security8021x::Security8021x(const NetworkManager::Setting::Ptr &setting, bool w + m_ui->leapPassword->setPasswordOptionsEnabled(true); + m_ui->md5Password->setPasswordOptionsEnabled(true); + m_ui->peapPassword->setPasswordOptionsEnabled(true); ++ m_ui->pwdPassword->setPasswordOptionsEnabled(true); + m_ui->tlsPrivateKeyPassword->setPasswordOptionsEnabled(true); + m_ui->ttlsPassword->setPasswordOptionsEnabled(true); + +@@ -49,18 +50,20 @@ Security8021x::Security8021x(const NetworkManager::Setting::Ptr &setting, bool w + + m_ui->auth->setItemData(0, NetworkManager::Security8021xSetting::EapMethodTls); + m_ui->auth->setItemData(1, NetworkManager::Security8021xSetting::EapMethodLeap); +- m_ui->auth->setItemData(2, NetworkManager::Security8021xSetting::EapMethodFast); +- m_ui->auth->setItemData(3, NetworkManager::Security8021xSetting::EapMethodTtls); +- m_ui->auth->setItemData(4, NetworkManager::Security8021xSetting::EapMethodPeap); ++ m_ui->auth->setItemData(2, NetworkManager::Security8021xSetting::EapMethodPwd); ++ m_ui->auth->setItemData(3, NetworkManager::Security8021xSetting::EapMethodFast); ++ m_ui->auth->setItemData(4, NetworkManager::Security8021xSetting::EapMethodTtls); ++ m_ui->auth->setItemData(5, NetworkManager::Security8021xSetting::EapMethodPeap); + } else { + m_ui->auth->removeItem(2); // LEAP + m_ui->stackedWidget->removeWidget(m_ui->leapPage); + + m_ui->auth->setItemData(0, NetworkManager::Security8021xSetting::EapMethodMd5); + m_ui->auth->setItemData(1, NetworkManager::Security8021xSetting::EapMethodTls); +- m_ui->auth->setItemData(2, NetworkManager::Security8021xSetting::EapMethodFast); +- m_ui->auth->setItemData(3, NetworkManager::Security8021xSetting::EapMethodTtls); +- m_ui->auth->setItemData(4, NetworkManager::Security8021xSetting::EapMethodPeap); ++ m_ui->auth->setItemData(2, NetworkManager::Security8021xSetting::EapMethodPwd); ++ m_ui->auth->setItemData(3, NetworkManager::Security8021xSetting::EapMethodFast); ++ m_ui->auth->setItemData(4, NetworkManager::Security8021xSetting::EapMethodTtls); ++ m_ui->auth->setItemData(5, NetworkManager::Security8021xSetting::EapMethodPeap); + } + + // Set PEAP authentication as default +@@ -88,6 +91,8 @@ Security8021x::Security8021x(const NetworkManager::Setting::Ptr &setting, bool w + connect(m_ui->leapPassword, &PasswordField::passwordOptionChanged, this, &Security8021x::slotWidgetChanged); + connect(m_ui->fastAllowPacProvisioning, &QCheckBox::stateChanged, this, &Security8021x::slotWidgetChanged); + connect(m_ui->pacFile, &KUrlRequester::textChanged, this, &Security8021x::slotWidgetChanged); ++ connect(m_ui->pwdUsername, &KLineEdit::textChanged, this, &Security8021x::slotWidgetChanged); ++ connect(m_ui->pwdPassword, &PasswordField::textChanged, this, &Security8021x::slotWidgetChanged); + connect(m_ui->fastUsername, &KLineEdit::textChanged, this, &Security8021x::slotWidgetChanged); + connect(m_ui->fastPassword, &PasswordField::textChanged, this, &Security8021x::slotWidgetChanged); + connect(m_ui->fastPassword, &PasswordField::passwordOptionChanged, this, &Security8021x::slotWidgetChanged); +@@ -175,6 +180,18 @@ void Security8021x::loadConfig(const NetworkManager::Setting::Ptr &setting) + } else { + m_ui->leapPassword->setPasswordOption(PasswordField::AlwaysAsk); + } ++ ++ } else if (eapMethods.contains(NetworkManager::Security8021xSetting::EapMethodPwd)) { ++ m_ui->auth->setCurrentIndex(m_ui->auth->findData(NetworkManager::Security8021xSetting::EapMethodPwd)); ++ m_ui->pwdUsername->setText(securitySetting->identity()); ++ ++ if (securitySetting->passwordFlags().testFlag(NetworkManager::Setting::None)) { ++ m_ui->pwdPassword->setPasswordOption(PasswordField::StoreForAllUsers); ++ } else if (securitySetting->passwordFlags().testFlag(NetworkManager::Setting::AgentOwned)) { ++ m_ui->pwdPassword->setPasswordOption(PasswordField::StoreForUser); ++ } else { ++ m_ui->pwdPassword->setPasswordOption(PasswordField::AlwaysAsk); ++ } + } else if (eapMethods.contains(NetworkManager::Security8021xSetting::EapMethodFast)) { + m_ui->auth->setCurrentIndex(m_ui->auth->findData(NetworkManager::Security8021xSetting::EapMethodFast)); + m_ui->fastAnonIdentity->setText(securitySetting->anonymousIdentity()); +@@ -256,6 +273,8 @@ void Security8021x::loadSecrets(const NetworkManager::Setting::Ptr &setting) + m_ui->leapPassword->setText(securitySetting->password()); + } else if (eapMethods.contains(NetworkManager::Security8021xSetting::EapMethodFast)) { + m_ui->fastPassword->setText(securitySetting->password()); ++ } else if (eapMethods.contains(NetworkManager::Security8021xSetting::EapMethodPwd)) { ++ m_ui->pwdPassword->setText(securitySetting->password()); + } else if (eapMethods.contains(NetworkManager::Security8021xSetting::EapMethodTtls)) { + m_ui->ttlsPassword->setText(securitySetting->password()); + } else if (eapMethods.contains(NetworkManager::Security8021xSetting::EapMethodPeap)) { +@@ -366,6 +385,22 @@ QVariantMap Security8021x::setting() const + } else { + setting.setPasswordFlags(NetworkManager::Setting::NotSaved); + } ++ } else if (method == NetworkManager::Security8021xSetting::EapMethodPwd) { ++ if (!m_ui->pwdUsername->text().isEmpty()) { ++ setting.setIdentity(m_ui->pwdUsername->text()); ++ } ++ ++ if (m_ui->pwdPassword->passwordOption() == PasswordField::StoreForAllUsers) { ++ setting.setPasswordFlags(NetworkManager::Setting::None); ++ } else if (m_ui->pwdPassword->passwordOption() == PasswordField::StoreForUser) { ++ setting.setPasswordFlags(NetworkManager::Setting::AgentOwned); ++ } else { ++ setting.setPasswordFlags(NetworkManager::Setting::NotSaved); ++ } ++ ++ if (!m_ui->pwdPassword->text().isEmpty()) { ++ setting.setPassword(m_ui->pwdPassword->text()); ++ } + } else if (method == NetworkManager::Security8021xSetting::EapMethodFast) { + if (!m_ui->fastAnonIdentity->text().isEmpty()) { + setting.setAnonymousIdentity(m_ui->fastAnonIdentity->text()); +@@ -580,6 +615,8 @@ bool Security8021x::isValid() const + // TODO Validate other certificates?? + } else if (method == NetworkManager::Security8021xSetting::EapMethodLeap) { + return !m_ui->leapUsername->text().isEmpty() && (!m_ui->leapPassword->text().isEmpty() || m_ui->leapPassword->passwordOption() == PasswordField::AlwaysAsk); ++ } else if (method == NetworkManager::Security8021xSetting::EapMethodPwd) { ++ return !m_ui->pwdUsername->text().isEmpty() && (!m_ui->pwdPassword->text().isEmpty() || m_ui->pwdPassword->passwordOption() == PasswordField::AlwaysAsk); + } else if (method == NetworkManager::Security8021xSetting::EapMethodFast) { + if (!m_ui->fastAllowPacProvisioning->isChecked() && !m_ui->pacFile->url().isValid()) { + return false; +diff --git a/libs/editor/settings/ui/802-1x.ui b/libs/editor/settings/ui/802-1x.ui +index aaa46fa..202cdf8 100644 +--- a/libs/editor/settings/ui/802-1x.ui ++++ b/libs/editor/settings/ui/802-1x.ui +@@ -50,6 +50,11 @@ + + + ++ PWD ++ ++ ++ ++ + FAST + + +@@ -298,6 +303,40 @@ + + + ++ ++ ++ ++ ++ ++ Username: ++ ++ ++ md5UserName ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ Password: ++ ++ ++ md5Password ++ ++ ++ ++ ++ ++ ++ true ++ ++ ++ ++ ++ + + + +@@ -696,16 +735,16 @@ +
kcombobox.h
+ + +- KUrlRequester +- QWidget +-
kurlrequester.h
+-
+- + KLineEdit + QLineEdit +
klineedit.h
+
+ ++ KUrlRequester ++ QWidget ++
kurlrequester.h
++
++ + PasswordField + QLineEdit +
passwordfield.h
+-- +cgit v0.11.2 + diff --git a/kde-plasma/plasma-nm/plasma-nm-5.11.4-r1.ebuild b/kde-plasma/plasma-nm/plasma-nm-5.11.4-r1.ebuild new file mode 100644 index 000000000000..506a3897b4f8 --- /dev/null +++ b/kde-plasma/plasma-nm/plasma-nm-5.11.4-r1.ebuild @@ -0,0 +1,67 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit kde5 + +DESCRIPTION="KDE Plasma applet for NetworkManager" +LICENSE="GPL-2 LGPL-2.1" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="modemmanager openconnect teamd" + +PATCHES=( "${FILESDIR}"/${PN}-add_EAP-PWD.patch ) + +DEPEND=" + $(add_frameworks_dep kcompletion) + $(add_frameworks_dep kconfig) + $(add_frameworks_dep kconfigwidgets) + $(add_frameworks_dep kcoreaddons) + $(add_frameworks_dep kdbusaddons) + $(add_frameworks_dep kdeclarative) + $(add_frameworks_dep kdelibs4support) + $(add_frameworks_dep ki18n) + $(add_frameworks_dep kiconthemes) + $(add_frameworks_dep kio) + $(add_frameworks_dep kitemviews) + $(add_frameworks_dep knotifications) + $(add_frameworks_dep kservice) + $(add_frameworks_dep kwallet) + $(add_frameworks_dep kwidgetsaddons) + $(add_frameworks_dep kwindowsystem) + $(add_frameworks_dep kxmlgui) + $(add_frameworks_dep networkmanager-qt 'teamd=') + $(add_frameworks_dep plasma) + $(add_frameworks_dep solid) + $(add_qt_dep qtdbus) + $(add_qt_dep qtdeclarative) + $(add_qt_dep qtgui) + $(add_qt_dep qtnetwork) + $(add_qt_dep qtwidgets) + >=app-crypt/qca-2.1.1:2[qt5] + >=net-misc/networkmanager-0.9.10.0[teamd=] + modemmanager? ( + $(add_frameworks_dep modemmanager-qt) + $(add_qt_dep qtxml) + net-misc/mobile-broadband-provider-info + ) + openconnect? ( + $(add_qt_dep qtxml) + net-misc/networkmanager-openconnect + net-vpn/openconnect:= + ) +" +RDEPEND="${DEPEND} + $(add_plasma_dep plasma-workspace) + !kde-plasma/plasma-nm:4 +" + +src_configure() { + local mycmakeargs=( + $(cmake-utils_use_find_package modemmanager ModemManager) + $(cmake-utils_use_find_package modemmanager KF5ModemManagerQt) + $(cmake-utils_use_find_package openconnect OpenConnect) + ) + + kde5_src_configure +} -- cgit v1.2.3-65-gdbad