Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Plasma
Plasma applet for NetworkManager
Commits
ca024a44
Commit
ca024a44
authored
May 23, 2020
by
Andrius Štikonas
Committed by
Jan Grulich
Oct 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added new option to pick reported OS with openconnect
parent
c539786a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
5 deletions
+105
-5
vpn/openconnect/nm-openconnect-service.h
vpn/openconnect/nm-openconnect-service.h
+1
-0
vpn/openconnect/openconnectauth.cpp
vpn/openconnect/openconnectauth.cpp
+4
-0
vpn/openconnect/openconnectprop.ui
vpn/openconnect/openconnectprop.ui
+57
-5
vpn/openconnect/openconnectwidget.cpp
vpn/openconnect/openconnectwidget.cpp
+43
-0
No files found.
vpn/openconnect/nm-openconnect-service.h
View file @
ca024a44
...
...
@@ -45,6 +45,7 @@
#define NM_OPENCONNECT_KEY_CSD_WRAPPER "csd_wrapper"
#define NM_OPENCONNECT_KEY_TOKEN_MODE "stoken_source"
#define NM_OPENCONNECT_KEY_TOKEN_SECRET "stoken_string"
#define NM_OPENCONNECT_KEY_REPORTED_OS "reported_os"
#define NM_OPENCONNECT_USER "nm-openconnect"
...
...
vpn/openconnect/openconnectauth.cpp
View file @
ca024a44
...
...
@@ -218,6 +218,10 @@ void OpenconnectAuthWidget::readConfig()
const
QString
protocol
=
dataMap
[
NM_OPENCONNECT_KEY_PROTOCOL
];
openconnect_set_protocol
(
d
->
vpninfo
,
OC3DUP
(
protocol
==
"juniper"
?
"nc"
:
protocol
.
toUtf8
().
data
()));
}
if
(
!
dataMap
[
NM_OPENCONNECT_KEY_REPORTED_OS
].
isEmpty
())
{
const
QString
reportedOs
=
dataMap
[
NM_OPENCONNECT_KEY_REPORTED_OS
];
openconnect_set_reported_os
(
d
->
vpninfo
,
reportedOs
.
toUtf8
().
data
());
}
d
->
tokenMode
=
dataMap
[
NM_OPENCONNECT_KEY_TOKEN_MODE
].
toUtf8
();
}
...
...
vpn/openconnect/openconnectprop.ui
View file @
ca024a44
...
...
@@ -7,7 +7,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
418
</width>
<height>
48
8
</height>
<height>
51
8
</height>
</rect>
</property>
<property
name=
"sizePolicy"
>
...
...
@@ -75,7 +75,7 @@
<item
row=
"3"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"leProxy"
/>
</item>
<item
row=
"
5
"
column=
"0"
>
<item
row=
"
6
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
CSD Wrapper Script:
</string>
...
...
@@ -85,14 +85,14 @@
</property>
</widget>
</item>
<item
row=
"
4
"
column=
"0"
colspan=
"2"
>
<item
row=
"
5
"
column=
"0"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"chkAllowTrojan"
>
<property
name=
"text"
>
<string>
Allow Cisco Secure Desktop trojan
</string>
</property>
</widget>
</item>
<item
row=
"
5
"
column=
"1"
>
<item
row=
"
6
"
column=
"1"
>
<widget
class=
"KUrlRequester"
name=
"leCsdWrapperScript"
/>
</item>
<item
row=
"0"
column=
"0"
>
...
...
@@ -130,6 +130,58 @@
</item>
</widget>
</item>
<item
row=
"4"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_8"
>
<property
name=
"text"
>
<string>
Reported OS:
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"cmbReportedOs"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"MinimumExpanding"
vsizetype=
"MinimumExpanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<item>
<property
name=
"text"
>
<string/>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
GNU/Linux
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
GNU/Linux 64-bit
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Windows
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Mac OS X
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Android
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Apple iOS
</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
...
...
@@ -234,7 +286,7 @@
<customwidgets>
<customwidget>
<class>
KUrlRequester
</class>
<extends>
Q
Frame
</extends>
<extends>
Q
Widget
</extends>
<header>
kurlrequester.h
</header>
</customwidget>
</customwidgets>
...
...
vpn/openconnect/openconnectwidget.cpp
View file @
ca024a44
...
...
@@ -192,10 +192,28 @@ void OpenconnectSettingWidget::loadConfig(const NetworkManager::Setting::Ptr &se
cmbProtocolIndex
=
2
;
// paloAlto/GlobalProtect (gp)
}
int
cmbReportedOsIndex
;
if
(
dataMap
[
NM_OPENCONNECT_KEY_REPORTED_OS
]
==
QString
())
{
cmbReportedOsIndex
=
0
;
}
else
if
(
dataMap
[
NM_OPENCONNECT_KEY_REPORTED_OS
]
==
QLatin1String
(
"linux"
))
{
cmbReportedOsIndex
=
1
;
}
else
if
(
dataMap
[
NM_OPENCONNECT_KEY_REPORTED_OS
]
==
QLatin1String
(
"linux-64"
))
{
cmbReportedOsIndex
=
2
;
}
else
if
(
dataMap
[
NM_OPENCONNECT_KEY_REPORTED_OS
]
==
QLatin1String
(
"win"
))
{
cmbReportedOsIndex
=
3
;
}
else
if
(
dataMap
[
NM_OPENCONNECT_KEY_REPORTED_OS
]
==
QLatin1String
(
"mac-intel"
))
{
cmbReportedOsIndex
=
4
;
}
else
if
(
dataMap
[
NM_OPENCONNECT_KEY_REPORTED_OS
]
==
QLatin1String
(
"android"
))
{
cmbReportedOsIndex
=
5
;
}
else
{
cmbReportedOsIndex
=
6
;
// apple-ios
}
d
->
ui
.
cmbProtocol
->
setCurrentIndex
(
cmbProtocolIndex
);
d
->
ui
.
leGateway
->
setText
(
dataMap
[
NM_OPENCONNECT_KEY_GATEWAY
]);
d
->
ui
.
leCaCertificate
->
setUrl
(
QUrl
::
fromLocalFile
(
dataMap
[
NM_OPENCONNECT_KEY_CACERT
]));
d
->
ui
.
leProxy
->
setText
(
dataMap
[
NM_OPENCONNECT_KEY_PROXY
]);
d
->
ui
.
cmbReportedOs
->
setCurrentIndex
(
cmbReportedOsIndex
);
d
->
ui
.
chkAllowTrojan
->
setChecked
(
dataMap
[
NM_OPENCONNECT_KEY_CSD_ENABLE
]
==
"yes"
);
d
->
ui
.
leCsdWrapperScript
->
setUrl
(
QUrl
::
fromLocalFile
(
dataMap
[
NM_OPENCONNECT_KEY_CSD_WRAPPER
]));
d
->
ui
.
leUserCert
->
setUrl
(
QUrl
::
fromLocalFile
(
dataMap
[
NM_OPENCONNECT_KEY_USERCERT
]));
...
...
@@ -258,6 +276,30 @@ QVariantMap OpenconnectSettingWidget::setting() const
protocol
=
QLatin1String
(
"gp"
);
}
QString
reportedOs
;
switch
(
d
->
ui
.
cmbReportedOs
->
currentIndex
())
{
case
0
:
reportedOs
=
QString
();
break
;
case
1
:
reportedOs
=
QLatin1String
(
"linux"
);
break
;
case
2
:
reportedOs
=
QLatin1String
(
"linux-64"
);
break
;
case
3
:
reportedOs
=
QLatin1String
(
"win"
);
break
;
case
4
:
reportedOs
=
QLatin1String
(
"mac-intel"
);
break
;
case
5
:
reportedOs
=
QLatin1String
(
"android"
);
break
;
default:
reportedOs
=
QLatin1String
(
"apple-ios"
);
}
data
.
insert
(
NM_OPENCONNECT_KEY_PROTOCOL
,
protocol
);
data
.
insert
(
QLatin1String
(
NM_OPENCONNECT_KEY_GATEWAY
),
d
->
ui
.
leGateway
->
text
());
if
(
d
->
ui
.
leCaCertificate
->
url
().
isValid
())
{
...
...
@@ -266,6 +308,7 @@ QVariantMap OpenconnectSettingWidget::setting() const
if
(
!
d
->
ui
.
leProxy
->
text
().
isEmpty
())
{
data
.
insert
(
QLatin1String
(
NM_OPENCONNECT_KEY_PROXY
),
d
->
ui
.
leProxy
->
text
());
}
data
.
insert
(
NM_OPENCONNECT_KEY_REPORTED_OS
,
reportedOs
);
data
.
insert
(
QLatin1String
(
NM_OPENCONNECT_KEY_CSD_ENABLE
),
d
->
ui
.
chkAllowTrojan
->
isChecked
()
?
"yes"
:
"no"
);
if
(
d
->
ui
.
leCsdWrapperScript
->
url
().
isValid
())
{
data
.
insert
(
QLatin1String
(
NM_OPENCONNECT_KEY_CSD_WRAPPER
),
d
->
ui
.
leCsdWrapperScript
->
url
().
toLocalFile
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment