Add 'any' option for peer ID, for mobile IPsec scenarios where you can't or don't want to check peer ID.

Conflicts:
	usr/local/www/vpn_ipsec_phase1.php
This commit is contained in:
Chris Buechler 2015-07-25 16:58:37 -05:00
parent f674922ee9
commit b099481141
3 changed files with 7 additions and 2 deletions

View File

@ -54,6 +54,7 @@ $my_identifier_list = array(
global $peer_identifier_list;
$peer_identifier_list = array(
'any' => array('desc' => gettext('Any'), 'mobile' => true),
'peeraddress' => array('desc' => gettext('Peer IP address'), 'mobile' => false),
'address' => array('desc' => gettext('IP address'), 'mobile' => false),
'fqdn' => array('desc' => gettext('Distinguished name'), 'mobile' => true),

View File

@ -862,7 +862,9 @@ EOD;
// Only specify peer ID if we are not dealing with mobile PSK
} else {
list ($peerid_type, $peerid_data) = ipsec_find_id($ph1ent, 'peer', $rgmap);
if ($peerid_type != 'address' && $peerid_type != 'keyid' && $peerid_type != 'asn1dn') {
if ($peerid_type == 'any') {
$peerid_spec = '';
} elseif ($peerid_type != 'address' && $peerid_type != 'keyid' && $peerid_type != 'asn1dn') {
$peerid_spec = "{$peerid_type}:{$peerid_data}";
} elseif ($peerid_type == "asn1dn") {
/* asn1dn needs double quotes */

View File

@ -529,7 +529,9 @@ function peeridsel_change() {
value = document.iform.peerid_type.options[index].value;
if (value == 'peeraddress') {
document.getElementById('peerid_data').style.visibility = 'hidden';
} else {
} else if (value == 'any') {
document.getElementById('peerid_data').style.visibility = 'hidden';
} else {
document.getElementById('peerid_data').style.visibility = 'visible';
}
}