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
7b3d786e
Commit
7b3d786e
authored
Jan 05, 2021
by
Jan Grulich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Strongswan: insert certificates into configuration only when they are set
parent
58f1b7b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
vpn/strongswan/strongswanwidget.cpp
vpn/strongswan/strongswanwidget.cpp
+21
-6
No files found.
vpn/strongswan/strongswanwidget.cpp
View file @
7b3d786e
...
...
@@ -124,19 +124,34 @@ QVariantMap StrongswanSettingWidget::setting() const
if
(
!
d
->
ui
.
leGateway
->
text
().
isEmpty
())
{
data
.
insert
(
NM_STRONGSWAN_GATEWAY
,
d
->
ui
.
leGateway
->
text
());
}
data
.
insert
(
NM_STRONGSWAN_CERTIFICATE
,
d
->
ui
.
leGatewayCertificate
->
url
().
toLocalFile
());
const
QString
certificate
=
d
->
ui
.
leGatewayCertificate
->
url
().
toLocalFile
();
if
(
!
certificate
.
isEmpty
())
{
data
.
insert
(
NM_STRONGSWAN_CERTIFICATE
,
certificate
);
}
// Authentication
switch
(
d
->
ui
.
cmbMethod
->
currentIndex
())
{
case
StrongswanSettingWidgetPrivate
::
PrivateKey
:
case
StrongswanSettingWidgetPrivate
::
PrivateKey
:
{
data
.
insert
(
NM_STRONGSWAN_METHOD
,
NM_STRONGSWAN_AUTH_KEY
);
data
.
insert
(
NM_STRONGSWAN_USERCERT
,
d
->
ui
.
leAuthPrivatekeyCertificate
->
url
().
toLocalFile
());
data
.
insert
(
NM_STRONGSWAN_USERKEY
,
d
->
ui
.
leAuthPrivatekeyKey
->
url
().
toLocalFile
());
const
QString
userPrivateCertificate
=
d
->
ui
.
leAuthPrivatekeyCertificate
->
url
().
toLocalFile
();
if
(
!
userPrivateCertificate
.
isEmpty
())
{
data
.
insert
(
NM_STRONGSWAN_USERCERT
,
userPrivateCertificate
);
}
const
QString
userKey
=
d
->
ui
.
leAuthPrivatekeyKey
->
url
().
toLocalFile
();
if
(
!
userKey
.
isEmpty
())
{
data
.
insert
(
NM_STRONGSWAN_USERKEY
,
userKey
);
}
break
;
case
StrongswanSettingWidgetPrivate
::
SshAgent
:
}
case
StrongswanSettingWidgetPrivate
::
SshAgent
:
{
data
.
insert
(
NM_STRONGSWAN_METHOD
,
NM_STRONGSWAN_AUTH_AGENT
);
data
.
insert
(
NM_STRONGSWAN_USERCERT
,
d
->
ui
.
leAuthSshCertificate
->
url
().
toLocalFile
());
const
QString
userSshCertificate
=
d
->
ui
.
leAuthSshCertificate
->
url
().
toLocalFile
();
if
(
!
userSshCertificate
.
isEmpty
())
{
data
.
insert
(
NM_STRONGSWAN_USERCERT
,
userSshCertificate
);
}
break
;
}
case
StrongswanSettingWidgetPrivate
::
Smartcard
:
data
.
insert
(
NM_STRONGSWAN_METHOD
,
NM_STRONGSWAN_AUTH_SMARTCARD
);
break
;
...
...
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