Commit 212fd9aa authored by Ad Schellevis's avatar Ad Schellevis

(ipsec) add mobike switch, change leftsendcert to always. for...

(ipsec) add mobike switch, change leftsendcert to always. for https://github.com/opnsense/core/issues/1393
parent ee0e0eae
...@@ -884,12 +884,9 @@ EOD; ...@@ -884,12 +884,9 @@ EOD;
if (isset($ph1ent['disabled'])) { if (isset($ph1ent['disabled'])) {
continue; continue;
} }
$conn_params = "";
if ($ph1ent['mode'] == "aggressive") { $aggressive = $ph1ent['mode'] == "aggressive" ? "yes" : "no";
$aggressive = "yes"; $mobike = !empty($ph1ent['mobike']) ? "mobike = no" : " mobike = yes";
} else {
$aggressive = "no";
}
$ep = ipsec_get_phase1_src($ph1ent); $ep = ipsec_get_phase1_src($ph1ent);
if (empty($ep)) { if (empty($ep)) {
...@@ -991,6 +988,7 @@ EOD; ...@@ -991,6 +988,7 @@ EOD;
} }
if (!empty($ph1ent['certref'])) { if (!empty($ph1ent['certref'])) {
$authentication .= "\n\tleftcert = {$certpath}/cert-{$ph1ent['ikeid']}.crt"; $authentication .= "\n\tleftcert = {$certpath}/cert-{$ph1ent['ikeid']}.crt";
$authentication .= "\n\tleftsendcert = always";
} }
if (!empty($ph1ent['caref'])) { if (!empty($ph1ent['caref'])) {
$ca = lookup_ca($ph1ent['caref']); $ca = lookup_ca($ph1ent['caref']);
...@@ -1177,6 +1175,7 @@ conn con<<connectionId>> ...@@ -1177,6 +1175,7 @@ conn con<<connectionId>>
{$reauth} {$reauth}
{$rekey} {$rekey}
{$forceencaps} {$forceencaps}
{$mobike}
installpolicy = yes installpolicy = yes
{$tunneltype} {$tunneltype}
{$dpdline} {$dpdline}
......
...@@ -86,7 +86,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -86,7 +86,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$phase1_fields = "mode,protocol,myid_type,myid_data,peerid_type,peerid_data $phase1_fields = "mode,protocol,myid_type,myid_data,peerid_type,peerid_data
,encryption-algorithm,hash-algorithm,dhgroup,lifetime,authentication_method,descr,nat_traversal ,encryption-algorithm,hash-algorithm,dhgroup,lifetime,authentication_method,descr,nat_traversal
,interface,iketype,dpd_delay,dpd_maxfail,remote-gateway,pre-shared-key,certref ,interface,iketype,dpd_delay,dpd_maxfail,remote-gateway,pre-shared-key,certref
,caref,reauth_enable,rekey_enable,auto,tunnel_isolation,authservers"; ,caref,reauth_enable,rekey_enable,auto,tunnel_isolation,authservers,mobike";
if (isset($p1index) && isset($config['ipsec']['phase1'][$p1index])) { if (isset($p1index) && isset($config['ipsec']['phase1'][$p1index])) {
// 1-on-1 copy // 1-on-1 copy
foreach (explode(",", $phase1_fields) as $fieldname) { foreach (explode(",", $phase1_fields) as $fieldname) {
...@@ -353,7 +353,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -353,7 +353,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$copy_fields = "ikeid,iketype,interface,mode,protocol,myid_type,myid_data $copy_fields = "ikeid,iketype,interface,mode,protocol,myid_type,myid_data
,peerid_type,peerid_data,encryption-algorithm,hash-algorithm,dhgroup ,peerid_type,peerid_data,encryption-algorithm,hash-algorithm,dhgroup
,lifetime,pre-shared-key,certref,caref,authentication_method,descr ,lifetime,pre-shared-key,certref,caref,authentication_method,descr
,nat_traversal,auto"; ,nat_traversal,auto,mobike";
foreach (explode(",",$copy_fields) as $fieldname) { foreach (explode(",",$copy_fields) as $fieldname) {
$fieldname = trim($fieldname); $fieldname = trim($fieldname);
...@@ -1016,6 +1016,15 @@ endforeach; ?> ...@@ -1016,6 +1016,15 @@ endforeach; ?>
</div> </div>
</td> </td>
</tr> </tr>
<tr>
<td><a id="help_for_mobike" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Disable MOBIKE"); ?></td>
<td>
<input name="mobike" type="checkbox" id="mobike" <?=!empty($pconfig['mobike']) ? "checked=\"checked\"":"";?> />
<div class="hidden" for="help_for_mobike">
<?=gettext("Disables the IKEv2 MOBIKE protocol defined by RFC 4555");?>
</div>
</td>
</tr>
<tr> <tr>
<td><a id="help_for_dpd_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Dead Peer Detection"); ?></td> <td><a id="help_for_dpd_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Dead Peer Detection"); ?></td>
<td> <td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment