Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
f12e4e4b
Commit
f12e4e4b
authored
Jan 31, 2017
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't try to enable legacy Xauth and radius at the same time + fix bug with $ph1ent
parent
4f4791c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
32 deletions
+38
-32
ipsec.inc
src/etc/inc/ipsec.inc
+38
-32
No files found.
src/etc/inc/ipsec.inc
View file @
f12e4e4b
...
...
@@ -700,7 +700,44 @@ EOD;
}
$strongswan
.=
"
\t\t
}
\n
"
;
if
(
$a_client
[
'user_source'
]
!=
"none"
)
{
$disable_xauth
=
false
;
foreach
(
$a_phase1
as
$ph1ent
)
{
if
(
!
isset
(
$ph1ent
[
'disabled'
])
&&
isset
(
$ph1ent
[
'mobile'
]))
{
if
(
$ph1ent
[
'authentication_method'
]
==
"eap-radius"
)
{
$disable_xauth
=
true
;
// disable Xauth when radius is used.
$strongswan
.=
"
\t\t
eap-radius {\n"
;
$radius_servers
=
""
;
$radius_server_num
=
1
;
$radius_accounting_enabled
=
false
;
foreach
(
auth_get_authserver_list
()
as
$auth_server
)
{
if
(
in_array
(
$auth_server
[
'name'
],
explode
(
','
,
$ph1ent
[
'authservers'
])))
{
$radius_servers
.=
"
\t\t\t\t
server"
.
$radius_server_num
.
" {\n"
;
$radius_servers
.=
"
\t\t\t\t\t
address = "
.
$auth_server
[
'host'
]
.
"
\n
"
;
$radius_servers
.=
"
\t\t\t\t\t
secret = "
.
$auth_server
[
'radius_secret'
]
.
"
\n
"
;
$radius_servers
.=
"
\t\t\t\t\t
auth_port = "
.
$auth_server
[
'radius_auth_port'
]
.
"
\n
"
;
if
(
!
empty
(
$auth_server
[
'radius_acct_port'
]))
{
$radius_servers
.=
"
\t\t\t\t\t
acct_port = "
.
$auth_server
[
'radius_acct_port'
]
.
"
\n
"
;
}
$radius_servers
.=
"
\t\t\t\t
}
\n
"
;
if
(
!
empty
(
$auth_server
[
'radius_acct_port'
]))
{
$radius_accounting_enabled
=
true
;
}
$radius_server_num
+=
1
;
}
}
if
(
$radius_accounting_enabled
)
{
$strongswan
.=
"
\t\t\t
accounting = yes
\n
"
;
}
$strongswan
.=
"
\t\t\t
servers {\n"
;
$strongswan
.=
$radius_servers
;
$strongswan
.=
"
\t\t\t
}
\n
"
;
$strongswan
.=
"
\t\t
}
\n
"
;
break
;
// there can only be one mobile phase1, exit loop
}
}
}
if
(
$a_client
[
'user_source'
]
!=
"none"
&&
$disable_xauth
==
false
)
{
$strongswan
.=
"
\t\t
xauth-generic {\n"
;
$strongswan
.=
"
\t\t\t
script = /usr/local/etc/inc/ipsec.auth-user.php
\n
"
;
$strongswan
.=
"
\t\t\t
authcfg = "
;
...
...
@@ -719,37 +756,6 @@ EOD;
$strongswan
.=
"
\n
"
;
$strongswan
.=
"
\t\t
}
\n
"
;
}
if
(
$ph1ent
[
'authentication_method'
]
==
"eap-radius"
)
{
$strongswan
.=
"
\t\t
eap-radius {\n"
;
$radius_servers
=
""
;
$radius_server_num
=
1
;
$radius_accounting_enabled
=
false
;
foreach
(
auth_get_authserver_list
()
as
$auth_server
)
{
if
(
in_array
(
$auth_server
[
'name'
],
explode
(
','
,
$ph1ent
[
'authservers'
])))
{
$radius_servers
.=
"
\t\t\t\t
server"
.
$radius_server_num
.
" {\n"
;
$radius_servers
.=
"
\t\t\t\t\t
address = "
.
$auth_server
[
'host'
]
.
"
\n
"
;
$radius_servers
.=
"
\t\t\t\t\t
secret = "
.
$auth_server
[
'radius_secret'
]
.
"
\n
"
;
$radius_servers
.=
"
\t\t\t\t\t
auth_port = "
.
$auth_server
[
'radius_auth_port'
]
.
"
\n
"
;
if
(
!
empty
(
$auth_server
[
'radius_acct_port'
]))
{
$radius_servers
.=
"
\t\t\t\t\t
acct_port = "
.
$auth_server
[
'radius_acct_port'
]
.
"
\n
"
;
}
$radius_servers
.=
"
\t\t\t\t
}
\n
"
;
if
(
!
empty
(
$auth_server
[
'radius_acct_port'
]))
{
$radius_accounting_enabled
=
true
;
}
$radius_server_num
+=
1
;
}
}
if
(
$radius_accounting_enabled
)
{
$strongswan
.=
"
\t\t\t
accounting = yes
\n
"
;
}
$strongswan
.=
"
\t\t\t
servers {\n"
;
$strongswan
.=
$radius_servers
;
$strongswan
.=
"
\t\t\t
}
\n
"
;
$strongswan
.=
"
\t\t
}
\n
"
;
}
}
$strongswan
.=
"
\t
}
\n
}
\n
"
;
...
...
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