]> git.ipfire.org Git - people/teissler/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)
committerTimo Eissler <timo.eissler@ipfire.org>
Tue, 14 Jun 2022 19:11:06 +0000 (21:11 +0200)
Signed-off-by: Timo Eissler <timo.eissler@ipfire.org>
html/cgi-bin/ovpnmain.cgi

index a69d7268f5e618fc7bc14e2e9e10716eaa3f14d6..83ab27c9396faa0969e56f2911182634ab6a1673 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] = '';