Commit ae582a06 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) partial fix for vpn_ipsec_phase2.php

When changing an existing Phase 1 entry, the value for "Hash algorithm" will always be shown as "MD5" in the edit-screen, although it is configured to something else (i.e. AES).
parent 3d3c5465
...@@ -84,7 +84,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -84,7 +84,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['interface'] = "wan"; $pconfig['interface'] = "wan";
$pconfig['iketype'] = "ikev1"; $pconfig['iketype'] = "ikev1";
$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,halgo,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"; ,caref,reauth_enable,rekey_enable";
if (isset($p1index) && isset($config['ipsec']['phase1'][$p1index])) { if (isset($p1index) && isset($config['ipsec']['phase1'][$p1index])) {
...@@ -128,7 +128,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -128,7 +128,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['peerid_type'] = "peeraddress"; $pconfig['peerid_type'] = "peeraddress";
$pconfig['authentication_method'] = "pre_shared_key"; $pconfig['authentication_method'] = "pre_shared_key";
$pconfig['encryption-algorithm'] = array("name" => "3des") ; $pconfig['encryption-algorithm'] = array("name" => "3des") ;
$pconfig['halgo'] = "sha1"; $pconfig['hash-algorithm'] = "sha1";
$pconfig['dhgroup'] = "2"; $pconfig['dhgroup'] = "2";
$pconfig['lifetime'] = "28800"; $pconfig['lifetime'] = "28800";
$pconfig['nat_traversal'] = "on"; $pconfig['nat_traversal'] = "on";
...@@ -908,7 +908,7 @@ endforeach; ?> ...@@ -908,7 +908,7 @@ endforeach; ?>
<tr> <tr>
<td><a id="help_for_halgo" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Hash algorithm"); ?></td> <td><a id="help_for_halgo" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Hash algorithm"); ?></td>
<td> <td>
<select name="halgo" class="formselect"> <select name="hash-algorithm" class="formselect">
<?php <?php
$p1_halgos = array( $p1_halgos = array(
'md5' => 'MD5', 'md5' => 'MD5',
...@@ -920,7 +920,7 @@ endforeach; ?> ...@@ -920,7 +920,7 @@ endforeach; ?>
); );
foreach ($p1_halgos as $algo => $algoname) : foreach ($p1_halgos as $algo => $algoname) :
?> ?>
<option value="<?=$algo;?>" <?= $algo == $pconfig['halgo'] ? "selected=\"selected\"" : "";?>> <option value="<?=$algo;?>" <?= $algo == $pconfig['hash-algorithm'] ? "selected=\"selected\"" : "";?>>
<?=$algoname;?> <?=$algoname;?>
</option> </option>
<?php endforeach; <?php endforeach;
......
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