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
41157c89
Commit
41157c89
authored
Jul 22, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ipsec) add left=%any option + some minor validation cleanups
parent
dfaf2321
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
32 deletions
+19
-32
ipsec.inc
src/etc/inc/ipsec.inc
+3
-1
vpn_ipsec_phase1.php
src/www/vpn_ipsec_phase1.php
+16
-31
No files found.
src/etc/inc/ipsec.inc
View file @
41157c89
...
...
@@ -86,7 +86,9 @@ $p2_pfskeygroups = array(
*/
function
ipsec_get_phase1_src
(
&
$ph1ent
)
{
if
(
!
empty
(
$ph1ent
[
'interface'
]))
{
if
(
!
is_ipaddr
(
$ph1ent
[
'interface'
]))
{
if
(
$ph1ent
[
'interface'
]
==
'any'
)
{
return
'%any'
;
}
elseif
(
!
is_ipaddr
(
$ph1ent
[
'interface'
]))
{
if
(
strpos
(
$ph1ent
[
'interface'
],
'_vip'
)
!==
false
)
{
// if this is a vip, set the interface to $ph1ent['interface']
$if
=
$ph1ent
[
'interface'
];
...
...
src/www/vpn_ipsec_phase1.php
View file @
41157c89
...
...
@@ -247,48 +247,30 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
if
(
$pconfig
[
'myid_type'
]
==
"address"
and
$pconfig
[
'myid_data'
]
==
""
)
{
if
(
$pconfig
[
'interface'
]
==
'any'
&&
$pconfig
[
'myid_type'
]
==
"myaddress"
)
{
$input_errors
[]
=
gettext
(
"Please select an identifier (My Identifier) other then 'any' when selecting 'Any' interface"
);
}
elseif
(
$pconfig
[
'myid_type'
]
==
"address"
&&
$pconfig
[
'myid_data'
]
==
""
)
{
$input_errors
[]
=
gettext
(
"Please enter an address for 'My Identifier'"
);
}
if
(
$pconfig
[
'myid_type'
]
==
"keyid tag"
and
$pconfig
[
'myid_data'
]
==
""
)
{
}
elseif
(
$pconfig
[
'myid_type'
]
==
"keyid tag"
&&
$pconfig
[
'myid_data'
]
==
""
)
{
$input_errors
[]
=
gettext
(
"Please enter a keyid tag for 'My Identifier'"
);
}
if
(
$pconfig
[
'myid_type'
]
==
"fqdn"
and
$pconfig
[
'myid_data'
]
==
""
)
{
}
elseif
(
$pconfig
[
'myid_type'
]
==
"fqdn"
&&
$pconfig
[
'myid_data'
]
==
""
)
{
$input_errors
[]
=
gettext
(
"Please enter a fully qualified domain name for 'My Identifier'"
);
}
if
(
$pconfig
[
'myid_type'
]
==
"user_fqdn"
and
$pconfig
[
'myid_data'
]
==
""
)
{
}
elseif
(
$pconfig
[
'myid_type'
]
==
"user_fqdn"
&&
$pconfig
[
'myid_data'
]
==
""
)
{
$input_errors
[]
=
gettext
(
"Please enter a user and fully qualified domain name for 'My Identifier'"
);
}
if
(
$pconfig
[
'myid_type'
]
==
"dyn_dns"
and
$pconfig
[
'myid_data'
]
==
""
)
{
}
elseif
(
$pconfig
[
'myid_type'
]
==
"dyn_dns"
&&
$pconfig
[
'myid_data'
]
==
""
)
{
$input_errors
[]
=
gettext
(
"Please enter a dynamic domain name for 'My Identifier'"
);
}
if
(((
$pconfig
[
'myid_type'
]
==
"address"
)
&&
!
is_ipaddr
(
$pconfig
[
'myid_data'
])))
{
}
elseif
(((
$pconfig
[
'myid_type'
]
==
"address"
)
&&
!
is_ipaddr
(
$pconfig
[
'myid_data'
])))
{
$input_errors
[]
=
gettext
(
"A valid IP address for 'My identifier' must be specified."
);
}
if
(((
$pconfig
[
'myid_type'
]
==
"fqdn"
)
&&
!
is_domain
(
$pconfig
[
'myid_data'
])))
{
}
elseif
(((
$pconfig
[
'myid_type'
]
==
"fqdn"
)
&&
!
is_domain
(
$pconfig
[
'myid_data'
])))
{
$input_errors
[]
=
gettext
(
"A valid domain name for 'My identifier' must be specified."
);
}
if
(
$pconfig
[
'myid_type'
]
==
"fqdn"
)
{
if
(
is_domain
(
$pconfig
[
'myid_data'
])
==
false
)
{
$input_errors
[]
=
gettext
(
"A valid FQDN for 'My identifier' must be specified."
);
}
}
if
(
$pconfig
[
'myid_type'
]
==
"user_fqdn"
)
{
}
elseif
(
$pconfig
[
'myid_type'
]
==
"fqdn"
&&
!
is_domain
(
$pconfig
[
'myid_data'
]))
{
$input_errors
[]
=
gettext
(
"A valid FQDN for 'My identifier' must be specified."
);
}
elseif
(
$pconfig
[
'myid_type'
]
==
"user_fqdn"
)
{
$user_fqdn
=
explode
(
"@"
,
$pconfig
[
'myid_data'
]);
if
(
is_domain
(
$user_fqdn
[
1
])
==
false
)
{
$input_errors
[]
=
gettext
(
"A valid User FQDN in the form of user@my.domain.com for 'My identifier' must be specified."
);
}
}
if
(
$pconfig
[
'myid_type'
]
==
"dyn_dns"
)
{
}
elseif
(
$pconfig
[
'myid_type'
]
==
"dyn_dns"
)
{
if
(
is_domain
(
$pconfig
[
'myid_data'
])
==
false
)
{
$input_errors
[]
=
gettext
(
"A valid Dynamic DNS address for 'My identifier' must be specified."
);
}
...
...
@@ -620,6 +602,9 @@ include("head.inc");
</option>
<?php
endforeach
;
?>
<option
value=
"any"
<?=
$pconfig
[
'interface'
]
==
"any"
?
"selected=
\"
selected
\"
"
:
""
?>
>
<?=
gettext
(
"Any"
);
?>
</option>
</select>
<div
class=
"hidden"
for=
"help_for_interface"
>
<?=
gettext
(
"Select the interface for the local endpoint of this phase1 entry."
);
?>
...
...
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