]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ovpnmain.cgi: Fixes bug#13190 - connection status shows disconnected for connected...
authorAdolf Belka <adolf.belka@ipfire.org>
Thu, 27 Jul 2023 13:57:25 +0000 (15:57 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 31 Jul 2023 09:21:47 +0000 (09:21 +0000)
- If the certificate name has underscores in it then the status always shows as DISCONNECTED
   alothough the actual connection is working and can be used.
- The certificate with underscores works fine. RFC5280 accepts underscores in the name.
- The code for checking the status splits up the status message and takes the first part
   as the common name for the connection. Then there is a regex command which rerplaces
   any underscores in the status common name with spaces. This results in the connection
   with underscores in the certificate name never matching any status feedback common
   name as the underscores have been replaced by spaces.
- This has been tested to work with my vm test bed. With existing code the connection with
   underscores in the certificate name permanently showed DISCONNECTED. With the code change
   the connection shows as CONNECTED very quickly.

Fixes: Bug#13190
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/ovpnmain.cgi

index f734331faa64893bd66524d34fa2fd2076e06e9e..5afe54f5583d21aa17b58eece5d5b00212ff0613 100755 (executable)
@@ -5502,7 +5502,6 @@ END
                                if ($match[1] ne "Common Name") {
                                        $cn = $match[1];
                                }
-                               $cn =~ s/[_]/ /g;
                                if ($cn eq "$confighash{$key}[2]") {
                                        $col1="bgcolor='${Header::colourgreen}'";
                                        $active = "<b><font color='#FFFFFF'>$Lang::tr{'capsopen'}</font></b>";