Commit 999f0ad9 authored by Jan Grulich's avatar Jan Grulich

Update L2TP to NetworkManager-l2tp 1.8.0 features

Summary:
- Update to NetworkManager-l2tp 1.8.0 features which include:
  - NetworkManager-l2tp 1.8.0 user certificate support.
  - Machine certificate support.
  - Rename Gateway ID to Remote ID.
  - Phase 1 & Phase 2 Lifetime TimeEdits.
  - Use IP Compression CheckBox.
  - Disable PFS CheckBox.
- Synchronize nm-l2tp-service.h with NetworkManager-l2tp 1.8.0's nm-service-defines.h.
- Base new user certificate UI on openvpn UI.
- Delete l2tpauth.ui and replace with programmatically generated  l2tpauthwidget.
- Add user and machine private key / certificate password support to l2tpauthwidget.
- Detect if libreswan or strongswan is being used and change UI based on which one is detected, e.g. disable "Disable PFS" check box with strongswan, Phase 1 & Phase 2 Lifetime show default strongswan and libreswan values when unchecked.
- Disable IPSec settings button if libreswan or strongswan not detected.
- Remove visibility of PPP Authentication group box if user certificate authentication is selected.
- Support loading *SWAN Base64 encoded PSK, but for backwards compatibility use unencoded for saving settings.
- For backwards compatibility with older NetworkManager-l2tp use `NM_L2TP_KEY_IPSEC_GATEWAY_ID` instead of `NM_L2TP_KEY_IPSEC_REMOTE_ID` for saving connection settings.

Reviewers: jgrulich

Reviewed By: jgrulich

Subscribers: ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27764
parent 7de9e9cd
......@@ -8,7 +8,7 @@ set(l2tp_SRCS
l2tppppwidget.cpp
)
ki18n_wrap_ui(l2tp_SRCS l2tp.ui l2tpipsec.ui l2tpauth.ui l2tpppp.ui)
ki18n_wrap_ui(l2tp_SRCS l2tp.ui l2tpipsec.ui l2tpppp.ui)
add_library(plasmanetworkmanagement_l2tpui ${l2tp_SRCS})
......
......@@ -22,7 +22,6 @@
#include <NetworkManagerQt/VpnSetting>
#include "nm-l2tp-service.h"
#include "l2tp.h"
#include "l2tpwidget.h"
#include "l2tpauth.h"
......@@ -45,7 +44,7 @@ SettingWidget * L2tpUiPlugin::widget(const NetworkManager::VpnSetting::Ptr &sett
SettingWidget *L2tpUiPlugin::askUser(const NetworkManager::VpnSetting::Ptr &setting, QWidget * parent)
{
return new L2tpAuthDialog(setting, parent);
return new L2tpAuthWidget(setting, parent);
}
QString L2tpUiPlugin::suggestedFileName(const NetworkManager::ConnectionSettings::Ptr &connection) const
......
This diff is collapsed.
/*
Copyright 2013 Jan Grulich <jgrulich@redhat.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 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 defined in Section 6 of version 3 of the license.
This library is distributed in the hope that it will be useful,
Copyright 2011 Ilia Kats <ilia-kats@gmx.net>
Copyright 2013 Lukáš Tinkl <ltinkl@redhat.com>
Copyright 2020 Douglas Kosovic <doug@uq.edu.au>
This program is free software; you can redistribute it and/or
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
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "l2tpauth.h"
#include "ui_l2tpauth.h"
#include "nm-l2tp-service.h"
#include "passwordfield.h"
#include <QString>
#include <QFormLayout>
#include <QLabel>
#include <QCheckBox>
#include <KLocalizedString>
class L2tpAuthDialogPrivate
#include "nm-l2tp-service.h"
class L2tpAuthWidgetPrivate
{
public:
Ui_L2tpAuth ui;
NetworkManager::VpnSetting::Ptr setting;
QFormLayout *layout;
};
L2tpAuthDialog::L2tpAuthDialog(const NetworkManager::VpnSetting::Ptr &setting, QWidget * parent)
L2tpAuthWidget::L2tpAuthWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget * parent)
: SettingWidget(setting, parent)
, d_ptr(new L2tpAuthDialogPrivate)
, d_ptr(new L2tpAuthWidgetPrivate)
{
Q_D(L2tpAuthDialog);
d->ui.setupUi(this);
Q_D(L2tpAuthWidget);
d->setting = setting;
KAcceleratorManager::manage(this);
d->layout = new QFormLayout(this);
setLayout(d->layout);
readSecrets();
KAcceleratorManager::manage(this);
}
L2tpAuthDialog::~L2tpAuthDialog()
L2tpAuthWidget::~L2tpAuthWidget()
{
delete d_ptr;
}
void L2tpAuthDialog::readSecrets()
void L2tpAuthWidget::readSecrets()
{
Q_D(L2tpAuthDialog);
const NMStringMap data = d->setting->data();
Q_D(L2tpAuthWidget);
const NMStringMap secrets = d->setting->secrets();
QString user = data.value(NM_L2TP_KEY_USER);
if (!user.isEmpty()) {
d->ui.leUserName->setText(user);
const NMStringMap dataMap = d->setting->data();
const QString userAType = dataMap[NM_L2TP_KEY_USER_AUTH_TYPE];
const QString machineAType = dataMap[NM_L2TP_KEY_MACHINE_AUTH_TYPE];
QLabel *label;
PasswordField *lineEdit;
NetworkManager::Setting::SecretFlags passType = (NetworkManager::Setting::SecretFlags)dataMap[NM_L2TP_KEY_PASSWORD"-flags"].toInt();
NetworkManager::Setting::SecretFlags userCertType = (NetworkManager::Setting::SecretFlags)dataMap[NM_L2TP_KEY_USER_CERTPASS"-flags"].toInt();
NetworkManager::Setting::SecretFlags machineCertType = (NetworkManager::Setting::SecretFlags)dataMap[NM_L2TP_KEY_MACHINE_CERTPASS"-flags"].toInt();
if ((userAType.isEmpty() || userAType == QLatin1String(NM_L2TP_AUTHTYPE_PASSWORD)) && !(passType.testFlag(NetworkManager::Setting::NotRequired))) {
label = new QLabel(this);
label->setText(i18n("User Password:"));
lineEdit = new PasswordField(this);
lineEdit->setPasswordModeEnabled(true);
lineEdit->setProperty("nm_secrets_key", QLatin1String(NM_L2TP_KEY_PASSWORD));
lineEdit->setText(secrets.value(QLatin1String(NM_L2TP_KEY_PASSWORD)));
d->layout->addRow(label, lineEdit);
} else if (userAType == QLatin1String(NM_L2TP_AUTHTYPE_TLS) && !(userCertType.testFlag(NetworkManager::Setting::NotRequired))) {
label = new QLabel(this);
label->setText(i18n("User Certificate Password:"));
lineEdit = new PasswordField(this);
lineEdit->setPasswordModeEnabled(true);
lineEdit->setProperty("nm_secrets_key", QLatin1String(NM_L2TP_KEY_USER_CERTPASS));
lineEdit->setText(secrets.value(QLatin1String(NM_L2TP_KEY_USER_CERTPASS)));
d->layout->addRow(label, lineEdit);
}
bool haveUserPassword = true;
if (!((NetworkManager::Setting::SecretFlags)data.value(NM_L2TP_KEY_PASSWORD"-flags").toInt()).testFlag(NetworkManager::Setting::NotRequired)) {
d->ui.leUserPassword->setText(secrets.value(QLatin1String(NM_L2TP_KEY_PASSWORD)));
} else {
d->ui.userNameLabel->setVisible(false);
d->ui.leUserName->setVisible(false);
d->ui.userPasswordLabel->setVisible(false);
d->ui.leUserPassword->setVisible(false);
haveUserPassword = false;
if (machineAType == QLatin1String(NM_L2TP_AUTHTYPE_TLS)) {
if (!(machineCertType.testFlag(NetworkManager::Setting::NotRequired))) {
label = new QLabel(this);
label->setText(i18n("Machine Certificate Password:"));
lineEdit = new PasswordField(this);
lineEdit->setPasswordModeEnabled(true);
lineEdit->setProperty("nm_secrets_key", QLatin1String(NM_L2TP_KEY_MACHINE_CERTPASS));
lineEdit->setText(secrets.value(QLatin1String(NM_L2TP_KEY_MACHINE_CERTPASS)));
d->layout->addRow(label, lineEdit);
}
}
if (haveUserPassword && d->ui.leUserPassword->text().isEmpty()) {
d->ui.leUserPassword->setFocus(Qt::OtherFocusReason);
for (int i = 0; i < d->layout->rowCount(); i++) {
PasswordField *le = qobject_cast<PasswordField*>(d->layout->itemAt(i, QFormLayout::FieldRole)->widget());
if (le && le->text().isEmpty()) {
le->setFocus(Qt::OtherFocusReason);
break;
}
}
}
QVariantMap L2tpAuthDialog::setting() const
QVariantMap L2tpAuthWidget::setting() const
{
Q_D(const L2tpAuthDialog);
Q_D(const L2tpAuthWidget);
NMStringMap secrets;
QVariantMap result;
if (!d->ui.leUserPassword->text().isEmpty()) {
secrets.insert(NM_L2TP_KEY_PASSWORD, d->ui.leUserPassword->text());
QVariantMap secretData;
for (int i = 0; i < d->layout->rowCount(); i++) {
PasswordField *le = qobject_cast<PasswordField*>(d->layout->itemAt(i, QFormLayout::FieldRole)->widget());
if (le && !le->text().isEmpty()) {
const QString key = le->property("nm_secrets_key").toString();
secrets.insert(key, le->text());
}
}
result.insert("secrets", QVariant::fromValue<NMStringMap>(secrets));
return result;
secretData.insert("secrets", QVariant::fromValue<NMStringMap>(secrets));
return secretData;
}
/*
Copyright 2013 Jan Grulich <jgrulich@redhat.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 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 defined in Section 6 of version 3 of the license.
This library is distributed in the hope that it will be useful,
Copyright 2011 Ilia Kats <ilia-kats@gmx.net>
Copyright 2013 Lukáš Tinkl <ltinkl@redhat.com>
This program is free software; you can redistribute it and/or
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
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PLASMA_NM_L2TP_AUTH_H
......@@ -25,20 +26,20 @@
#include "settingwidget.h"
class L2tpAuthDialogPrivate;
class L2tpAuthWidgetPrivate;
class L2tpAuthDialog : public SettingWidget
class L2tpAuthWidget : public SettingWidget
{
Q_OBJECT
Q_DECLARE_PRIVATE(L2tpAuthDialog)
Q_DECLARE_PRIVATE(L2tpAuthWidget)
public:
explicit L2tpAuthDialog(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr);
~L2tpAuthDialog() override;
explicit L2tpAuthWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr);
~L2tpAuthWidget() override;
virtual void readSecrets();
QVariantMap setting() const override;
private:
L2tpAuthDialogPrivate *const d_ptr;
L2tpAuthWidgetPrivate *const d_ptr;
};
#endif // PLASMA_NM_L2TP_AUTH_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>L2tpAuth</class>
<widget class="QWidget" name="L2tpAuth">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>378</width>
<height>133</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="userNameLabel">
<property name="text">
<string>Username:</string>
</property>
<property name="buddy">
<cstring>leUserName</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="leUserName">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Set the name used for authenticating the local system to the peer to &lt;name&gt;.</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="userPasswordLabel">
<property name="text">
<string>User Password:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>leUserPassword</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="PasswordField" name="leUserPassword">
<property name="toolTip">
<string>Password passed to PPPD when prompted for it.</string>
</property>
<property name="passwordModeEnabled" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>PasswordField</class>
<extends>QLineEdit</extends>
<header>passwordfield.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
This diff is collapsed.
This diff is collapsed.
/*
Copyright 2013 Jan Grulich <jgrulich@redhat.com>
Copyright 2020 Douglas Kosovic <doug@uq.edu.au>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -33,15 +34,29 @@ class L2tpIpsecWidget;
class L2tpIpsecWidget : public QDialog
{
Q_OBJECT
enum AuthType {PSK = 0, TLS};
enum IpsecDaemonType {NoIpsecDaemon, Libreswan, Strongswan, Openswan, UnknownIpsecDaemon};
public:
explicit L2tpIpsecWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr);
~L2tpIpsecWidget() override;
NMStringMap setting() const;
NMStringMap secrets() const;
static bool hasIpsecDaemon();
private Q_SLOTS:
void updateStartDirUrl(const QUrl &);
void setDefaultIkelifetime(bool isChecked);
void setDefaultSalifetime(bool isChecked);
void resizeStackedWidget(int currentIndex);
private:
void loadConfig(const NetworkManager::VpnSetting::Ptr &setting);
Ui::L2tpIpsecWidget * m_ui;
static IpsecDaemonType m_ipsecDaemonType;
};
#endif // PLASMA_NM_L2TP_IPSEC_WIDGET_H
/*
Copyright 2013 Jan Grulich <jgrulich@redhat.com>
Copyright 2020 Douglas Kosovic <doug@uq.edu.au>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -25,9 +26,10 @@
#include <KLocalizedString>
#include <KAcceleratorManager>
L2tpPPPWidget::L2tpPPPWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent)
L2tpPPPWidget::L2tpPPPWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent, bool need_peer_eap)
: QDialog(parent)
, m_ui(new Ui::L2tpPppWidget)
, m_need_peer_eap(need_peer_eap)
{
m_ui->setupUi(this);
......@@ -45,28 +47,34 @@ L2tpPPPWidget::~L2tpPPPWidget()
void L2tpPPPWidget::loadConfig(const NetworkManager::VpnSetting::Ptr &setting)
{
const QString yesString = QLatin1String("yes");
// General settings
const NMStringMap dataMap = setting->data();
// Authentication options
const QString yesString = QLatin1String("yes");
bool refuse_pap = (dataMap[NM_L2TP_KEY_REFUSE_PAP] == yesString);
bool refuse_chap = (dataMap[NM_L2TP_KEY_REFUSE_CHAP] == yesString);
bool refuse_mschap = (dataMap[NM_L2TP_KEY_REFUSE_MSCHAP] == yesString);
bool refuse_mschapv2 = (dataMap[NM_L2TP_KEY_REFUSE_MSCHAPV2] == yesString);
bool refuse_eap = (dataMap[NM_L2TP_KEY_REFUSE_EAP] == yesString);
QListWidgetItem * item = nullptr;
item = m_ui->listWidget->item(0); // PAP
item->setCheckState(refuse_pap ? Qt::Unchecked : Qt::Checked);
item = m_ui->listWidget->item(1); // CHAP
item->setCheckState(refuse_chap ? Qt::Unchecked : Qt::Checked);
item = m_ui->listWidget->item(2); // MSCHAP
item->setCheckState(refuse_mschap ? Qt::Unchecked : Qt::Checked);
item = m_ui->listWidget->item(3); // MSCHAPv2
item->setCheckState(refuse_mschapv2 ? Qt::Unchecked : Qt::Checked);
item = m_ui->listWidget->item(4); // EAP
item->setCheckState(refuse_eap ? Qt::Unchecked : Qt::Checked);
if (m_need_peer_eap) {
m_ui->grp_authenfication->setVisible(false);
resize(width(), sizeHint().height());
} else {
// Authentication options
const bool refuse_pap = (dataMap[NM_L2TP_KEY_REFUSE_PAP] == yesString);
const bool refuse_chap = (dataMap[NM_L2TP_KEY_REFUSE_CHAP] == yesString);
const bool refuse_mschap = (dataMap[NM_L2TP_KEY_REFUSE_MSCHAP] == yesString);
const bool refuse_mschapv2 = (dataMap[NM_L2TP_KEY_REFUSE_MSCHAPV2] == yesString);
const bool refuse_eap = (dataMap[NM_L2TP_KEY_REFUSE_EAP] == yesString);
QListWidgetItem * item = nullptr;
item = m_ui->listWidget->item(0); // PAP
item->setCheckState(refuse_pap ? Qt::Unchecked : Qt::Checked);
item = m_ui->listWidget->item(1); // CHAP
item->setCheckState(refuse_chap ? Qt::Unchecked : Qt::Checked);
item = m_ui->listWidget->item(2); // MSCHAP
item->setCheckState(refuse_mschap ? Qt::Unchecked : Qt::Checked);
item = m_ui->listWidget->item(3); // MSCHAPv2
item->setCheckState(refuse_mschapv2 ? Qt::Unchecked : Qt::Checked);
item = m_ui->listWidget->item(4); // EAP
item->setCheckState(refuse_eap ? Qt::Unchecked : Qt::Checked);
}
// Cryptography and compression
const bool mppe = (dataMap[NM_L2TP_KEY_REQUIRE_MPPE] == yesString);
......@@ -117,29 +125,30 @@ void L2tpPPPWidget::loadConfig(const NetworkManager::VpnSetting::Ptr &setting)
NMStringMap L2tpPPPWidget::setting() const
{
NMStringMap result;
QListWidgetItem * item = nullptr;
item = m_ui->listWidget->item(0); // PAP
const QString yesString = QLatin1String("yes");
if (item->checkState() == Qt::Unchecked) {
result.insert(NM_L2TP_KEY_REFUSE_PAP, yesString);
}
item = m_ui->listWidget->item(1); // CHAP
if (item->checkState() == Qt::Unchecked) {
result.insert(NM_L2TP_KEY_REFUSE_CHAP, yesString);
}
item = m_ui->listWidget->item(2); // MSCHAP
if (item->checkState() == Qt::Unchecked) {
result.insert(NM_L2TP_KEY_REFUSE_MSCHAP, yesString);
}
item = m_ui->listWidget->item(3); // MSCHAPv2
if (item->checkState() == Qt::Unchecked) {
result.insert(NM_L2TP_KEY_REFUSE_MSCHAPV2, yesString);
}
item = m_ui->listWidget->item(4); // EAP
if (item->checkState() == Qt::Unchecked) {
result.insert(NM_L2TP_KEY_REFUSE_EAP, yesString);
if (!m_need_peer_eap) {
QListWidgetItem * item = nullptr;
item = m_ui->listWidget->item(0); // PAP
if (item->checkState() == Qt::Unchecked) {
result.insert(NM_L2TP_KEY_REFUSE_PAP, yesString);
}
item = m_ui->listWidget->item(1); // CHAP
if (item->checkState() == Qt::Unchecked) {
result.insert(NM_L2TP_KEY_REFUSE_CHAP, yesString);
}
item = m_ui->listWidget->item(2); // MSCHAP
if (item->checkState() == Qt::Unchecked) {
result.insert(NM_L2TP_KEY_REFUSE_MSCHAP, yesString);
}
item = m_ui->listWidget->item(3); // MSCHAPv2
if (item->checkState() == Qt::Unchecked) {
result.insert(NM_L2TP_KEY_REFUSE_MSCHAPV2, yesString);
}
item = m_ui->listWidget->item(4); // EAP
if (item->checkState() == Qt::Unchecked) {
result.insert(NM_L2TP_KEY_REFUSE_EAP, yesString);
}
}
// Cryptography and compression
......
/*
Copyright 2013 Jan Grulich <jgrulich@redhat.com>
Copyright 2020 Douglas Kosovic <doug@uq.edu.au>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -34,7 +35,7 @@ class L2tpPPPWidget : public QDialog
{
Q_OBJECT
public:
explicit L2tpPPPWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr);
explicit L2tpPPPWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr, bool need_peer_eap = false);
~L2tpPPPWidget() override;
NMStringMap setting() const;
......@@ -42,6 +43,7 @@ public:
private:
void loadConfig(const NetworkManager::VpnSetting::Ptr &setting);
Ui::L2tpPppWidget * m_ui;
bool m_need_peer_eap;
};
#endif // PLASMA_NM_L2TP_PPP_WIDGET_H
This diff is collapsed.
/*
Copyright 2013 Jan Grulich <jgrulich@redhat.com>
Copyright 2020 Douglas Kosovic <doug@uq.edu.au>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -33,6 +34,9 @@ class L2tpWidget;
class L2tpWidget : public SettingWidget
{
Q_OBJECT
enum AuthType {Password = 0, TLS};
public:
explicit L2tpWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget* parent = nullptr, Qt::WindowFlags f = {});
~L2tpWidget() override;
......@@ -45,10 +49,9 @@ public:
bool isValid() const override;
private Q_SLOTS:
void userPasswordTypeChanged(int index);
void updateStartDirUrl(const QUrl &);
void showIpsec();
void showPpp();
void certStateChanged();
private:
Ui::L2tpWidget * m_ui;
......
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
// SPDX-License-Identifier: GPL-2.0+
/* nm-l2tp-service - L2TP VPN integration with NetworkManager
*
* Dan Williams <dcbw@redhat.com>
*
* This program is free software; you can redistribute it and/or 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) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright 2008, 2014 Red Hat, Inc.
*/
......@@ -34,15 +20,16 @@
#define NM_DBUS_PATH_L2TP_PPP "/org/freedesktop/NetworkManager/l2tp/ppp"
#define NM_L2TP_KEY_GATEWAY "gateway"
#define NM_L2TP_KEY_USER_AUTH_TYPE "user-auth-type"
#define NM_L2TP_KEY_USER "user"
#define NM_L2TP_KEY_PASSWORD "password"
#define NM_L2TP_KEY_USE_CERT "use-cert"
#define NM_L2TP_KEY_CERT_PUB "cert-pub"
#define NM_L2TP_KEY_CERT_CA "cert-ca"
#define NM_L2TP_KEY_CERT_KEY "cert-key"
#define NM_L2TP_KEY_DOMAIN "domain"
#define NM_L2TP_KEY_USER_CA "user-ca"
#define NM_L2TP_KEY_USER_CERT "user-cert"
#define NM_L2TP_KEY_USER_KEY "user-key"
#define NM_L2TP_KEY_USER_CERTPASS "user-certpass"
#define NM_L2TP_KEY_MTU "mtu"
#define NM_L2TP_KEY_MRU "mru"
#define NM_L2TP_KEY_DOMAIN "domain"
#define NM_L2TP_KEY_REFUSE_EAP "refuse-eap"
#define NM_L2TP_KEY_REFUSE_PAP "refuse-pap"
#define NM_L2TP_KEY_REFUSE_CHAP "refuse-chap"
......@@ -60,13 +47,30 @@
#define NM_L2TP_KEY_LCP_ECHO_FAILURE "lcp-echo-failure"
#define NM_L2TP_KEY_LCP_ECHO_INTERVAL "lcp-echo-interval"
#define NM_L2TP_KEY_UNIT_NUM "unit"
#define NM_L2TP_KEY_MACHINE_AUTH_TYPE "machine-auth-type"
#define NM_L2TP_KEY_MACHINE_CA "machine-ca"
#define NM_L2TP_KEY_MACHINE_CERT "machine-cert"
#define NM_L2TP_KEY_MACHINE_KEY "machine-key"
#define NM_L2TP_KEY_MACHINE_CERTPASS "machine-certpass"
#define NM_L2TP_KEY_IPSEC_ENABLE "ipsec-enabled"
#define NM_L2TP_KEY_IPSEC_GATEWAY_ID "ipsec-gateway-id"
#define NM_L2TP_KEY_IPSEC_GROUP_NAME "ipsec-group-name"
#define NM_L2TP_KEY_IPSEC_REMOTE_ID "ipsec-remote-id"
#define NM_L2TP_KEY_IPSEC_GATEWAY_ID "ipsec-gateway-id" /* deprecated, use ipsec-remote-id */
#define NM_L2TP_KEY_IPSEC_PSK "ipsec-psk"
#define NM_L2TP_KEY_IPSEC_IKE "ipsec-ike"
#define NM_L2TP_KEY_IPSEC_ESP "ipsec-esp"
#define NM_L2TP_KEY_IPSEC_IKELIFETIME "ipsec-ikelifetime"
#define NM_L2TP_KEY_IPSEC_SALIFETIME "ipsec-salifetime"
#define NM_L2TP_KEY_IPSEC_FORCEENCAPS "ipsec-forceencaps"
#define NM_L2TP_KEY_IPSEC_IPCOMP "ipsec-ipcomp"
#define NM_L2TP_KEY_IPSEC_IKEV2 "ipsec-ikev2"
#define NM_L2TP_KEY_IPSEC_PFS "ipsec-pfs"
/* Internal auth-dialog -> service token indicating that no secrets are required
* for the connection if X.509 private keys are used with no password protection.
*/
#define NM_L2TP_KEY_NOSECRET "no-secret"
#define NM_L2TP_AUTHTYPE_PASSWORD "password"
#define NM_L2TP_AUTHTYPE_TLS "tls"
#define NM_L2TP_AUTHTYPE_PSK "psk"
#endif /* NM_L2TP_SERVICE_DEFINES_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment