summaryrefslogtreecommitdiffstats
path: root/usr/local/www/vpn_openvpn_client.php
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2009-05-08 13:40:07 -0400
committerjim-p <jim@pingle.org>2009-05-08 13:40:07 -0400
commit89e6e210158ca4ca24d2ddbc02ccab72175875a5 (patch)
tree31a1f299e9c68ebf607460d20e08f8d2dc17f2ac /usr/local/www/vpn_openvpn_client.php
parent98c0c87ae42c54147077f12a05d9eab506e8d053 (diff)
downloadpfsense-89e6e210158ca4ca24d2ddbc02ccab72175875a5.zip
pfsense-89e6e210158ca4ca24d2ddbc02ccab72175875a5.tar.gz
Fix OpenVPN automatic shared key generation.
Diffstat (limited to 'usr/local/www/vpn_openvpn_client.php')
-rw-r--r--usr/local/www/vpn_openvpn_client.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php
index 5dd6c9a..0aef437 100644
--- a/usr/local/www/vpn_openvpn_client.php
+++ b/usr/local/www/vpn_openvpn_client.php
@@ -158,6 +158,9 @@ if ($_POST) {
if ($result = openvpn_validate_cidr($pconfig['remote_network'], 'Remote network'))
$input_errors[] = $result;
+ if ($pconfig['autokey_enable'])
+ $pconfig['shared_key'] = openvpn_create_key();
+
if (!$tls_mode && !$pconfig['autokey_enable'])
if (!strstr($pconfig['shared_key'], "-----BEGIN OpenVPN Static key V1-----") ||
!strstr($pconfig['shared_key'], "-----END OpenVPN Static key V1-----"))
@@ -168,7 +171,7 @@ if ($_POST) {
!strstr($pconfig['tls'], "-----END OpenVPN Static key V1-----"))
$input_errors[] = "The field 'TLS Authentication Key' does not appear to be valid";
- if (!$tls_mode) {
+ if (!$tls_mode && !$pconfig['autokey_enable']) {
$reqdfields = array('shared_key');
$reqdfieldsn = array('Shared key');
} else {
@@ -211,8 +214,6 @@ if ($_POST) {
$client['tls'] = base64_encode($pconfig['tls']);
}
} else {
- if ($pconfig['autokey_enable'])
- $pconfig['shared_key'] = openvpn_create_key();
$client['shared_key'] = base64_encode($pconfig['shared_key']);
}
$client['crypto'] = $pconfig['crypto'];
OpenPOWER on IntegriCloud