mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
ovpn: Add ta.key check to main settings
Since Core 132 the 'TLS Channel Protection' is part of the global settings, the ta.key generation check should also be in the main section otherwise it won´t be created if not present. Signed-off-by: Erik Kapfer <ummeegge@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Arne Fitzenreiter
parent
ae04d0a311
commit
b21a6319cd
@@ -898,17 +898,6 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save-adv-options'}) {
|
||||
$errormessage = $Lang::tr{'invalid input for keepalive 1:2'};
|
||||
goto ADV_ERROR;
|
||||
}
|
||||
# Create ta.key for tls-auth if not presant
|
||||
if ($cgiparams{'TLSAUTH'} eq 'on') {
|
||||
if ( ! -e "${General::swroot}/ovpn/certs/ta.key") {
|
||||
system('/usr/sbin/openvpn', '--genkey', '--secret', "${General::swroot}/ovpn/certs/ta.key");
|
||||
if ($?) {
|
||||
$errormessage = "$Lang::tr{'openssl produced an error'}: $?";
|
||||
goto ADV_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&General::writehash("${General::swroot}/ovpn/settings", \%vpnsettings);
|
||||
&writeserverconf();#hier ok
|
||||
}
|
||||
@@ -1189,6 +1178,17 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'} && $cgiparams{'TYPE'} eq '' && $cg
|
||||
goto SETTINGS_ERROR;
|
||||
}
|
||||
|
||||
# Create ta.key for tls-auth if not presant
|
||||
if ($cgiparams{'TLSAUTH'} eq 'on') {
|
||||
if ( ! -e "${General::swroot}/ovpn/certs/ta.key") {
|
||||
system('/usr/sbin/openvpn', '--genkey', '--secret', "${General::swroot}/ovpn/certs/ta.key");
|
||||
if ($?) {
|
||||
$errormessage = "$Lang::tr{'openssl produced an error'}: $?";
|
||||
goto SETTINGS_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$vpnsettings{'ENABLED_BLUE'} = $cgiparams{'ENABLED_BLUE'};
|
||||
$vpnsettings{'ENABLED_ORANGE'} =$cgiparams{'ENABLED_ORANGE'};
|
||||
$vpnsettings{'ENABLED'} = $cgiparams{'ENABLED'};
|
||||
|
||||
Reference in New Issue
Block a user