diff options
author | Matthew Grooms <mgrooms@pfsense.org> | 2008-08-24 00:23:26 +0000 |
---|---|---|
committer | Matthew Grooms <mgrooms@pfsense.org> | 2008-08-24 00:23:26 +0000 |
commit | 4e2af46423137a1fa9abccd153d983ca336b6634 (patch) | |
tree | 14f58cc6032716bafdae7ca6e9fd82827b0bf3ca /usr/local/www/vpn_ipsec_phase1.php | |
parent | f7ccb37657c67bb5146faa4017b969bcc9f00d46 (diff) | |
download | pfsense-4e2af46423137a1fa9abccd153d983ca336b6634.zip pfsense-4e2af46423137a1fa9abccd153d983ca336b6634.tar.gz |
Only read ipsec phase1 configuration values that are relvent for the
configured authentication method. This silences harmless php warnings.
Reported by Scott Ullrich.
Diffstat (limited to 'usr/local/www/vpn_ipsec_phase1.php')
-rw-r--r-- | usr/local/www/vpn_ipsec_phase1.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr/local/www/vpn_ipsec_phase1.php b/usr/local/www/vpn_ipsec_phase1.php index a085494..f081b45 100644 --- a/usr/local/www/vpn_ipsec_phase1.php +++ b/usr/local/www/vpn_ipsec_phase1.php @@ -82,10 +82,15 @@ if (isset($p1index) && $a_phase1[$p1index]) $pconfig['dhgroup'] = $a_phase1[$p1index]['dhgroup']; $pconfig['lifetime'] = $a_phase1[$p1index]['lifetime']; $pconfig['authentication_method'] = $a_phase1[$p1index]['authentication_method']; - $pconfig['pskey'] = $a_phase1[$p1index]['pre-shared-key']; - $pconfig['cert'] = base64_decode($a_phase1[$p1index]['cert']); - $pconfig['peercert'] = base64_decode($a_phase1[$p1index]['peercert']); - $pconfig['privatekey'] = base64_decode($a_phase1[$p1index]['private-key']); + + if (($pconfig['authentication_method'] == "pre_shared_key")|| + ($pconfig['authentication_method'] == "xauth_psk_server")) { + $pconfig['pskey'] = $a_phase1[$p1index]['pre-shared-key']; + } else { + $pconfig['cert'] = base64_decode($a_phase1[$p1index]['cert']); + $pconfig['peercert'] = base64_decode($a_phase1[$p1index]['peercert']); + $pconfig['privatekey'] = base64_decode($a_phase1[$p1index]['private-key']); + } $pconfig['descr'] = $a_phase1[$p1index]['descr']; $pconfig['nat_traversal'] = $a_phase1[$p1index]['nat_traversal']; |