public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Adolf Belka <adolf.belka@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH] ovpnmain.cgi: Fixes bug#13190 - connection status shows disconnected for connected client
Date: Thu, 27 Jul 2023 15:57:25 +0200	[thread overview]
Message-ID: <20230727135725.7053-1-adolf.belka@ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]

- 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(a)ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka(a)ipfire.org>
---
 html/cgi-bin/ovpnmain.cgi | 1 -
 1 file changed, 1 deletion(-)

diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
index f734331fa..5afe54f55 100755
--- a/html/cgi-bin/ovpnmain.cgi
+++ b/html/cgi-bin/ovpnmain.cgi
@@ -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>";
-- 
2.41.0


                 reply	other threads:[~2023-07-27 13:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230727135725.7053-1-adolf.belka@ipfire.org \
    --to=adolf.belka@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox