]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ovpnmain.cgi: Remove trailing newline from OTP secret
authorTimo Eissler <timo.eissler@ipfire.org>
Tue, 14 Jun 2022 18:56:12 +0000 (20:56 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 17 Jun 2022 10:22:31 +0000 (10:22 +0000)
Signed-off-by: Timo Eissler <timo.eissler@ipfire.org>
html/cgi-bin/ovpnmain.cgi

index 71c79ef471db4926017e3cb0845d25ce8dfdd570..f5ebc9dee24b4bfa6d971bb9f415e22c2df3d547 100644 (file)
@@ -4487,6 +4487,7 @@ if ($cgiparams{'TYPE'} eq 'net') {
        $confighash{$key}[43] = $cgiparams{'OTP_STATE'};
        if (($confighash{$key}[43] eq 'on') && ($confighash{$key}[44] eq '')) {
                my @otp_secret = &General::system_output("/usr/bin/openssl", "rand", "-hex", "20");
+      chomp($otp_secret[0]);
                $confighash{$key}[44] = $otp_secret[0];
        } elsif ($confighash{$key}[43] eq '') {
                $confighash{$key}[44] = '';