From patchwork Thu Jul 27 13:57:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 7029 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RBXQS2CGhz3wkQ for ; Thu, 27 Jul 2023 13:57:36 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RBXQQ1PkqzyQ; Thu, 27 Jul 2023 13:57:34 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RBXQQ0Fqxz2yb5; Thu, 27 Jul 2023 13:57:34 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4RBXQN0mj0z2xWB for ; Thu, 27 Jul 2023 13:57:32 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4RBXQK3C6szSr; Thu, 27 Jul 2023 13:57:29 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1690466251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=PzrJHf8nkwkRZGPmHTCnPDlAq4eFfp4fz0m+a9E2MIY=; b=A9cZMqQeoBI+z6Bh9SWHWccZAAnF5bRjjAa2nA8AF6BOqV/97XTuACPngMcGoqJJHyidfs 7xdi/JzmhvfxxuDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1690466251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=PzrJHf8nkwkRZGPmHTCnPDlAq4eFfp4fz0m+a9E2MIY=; b=JCfKL4AN4WzlVtN7r8pte4hVOB3b0j1q07NNfoDwlghOIYeUK62at6A0z73iTmBvtnRTe3 b0YobeTa3ijHzSErWY5cp++hX2zF2tgVbdr3jwW4voyiDDuCbxQR1+qnG1n7hTps9A1M92 ADP7NtVnILRe3qcT/320Hyl9JqMJ64TfL5iyl5EqNAweJL4rXnQCoiZclj3Q/KS6g/3dXt luFF3+fCadJ7dN18g3guDDwhSIyiDmrRdosbpI5qF5zYGz7P3uyBXi226JrApmQkrXuDxC T05G4ua0K/lZIt29mDplwQTNCfhHH44aS+AnsZXUShx5mk0sT4TkZyq+A53SvA== From: Adolf Belka 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 Message-ID: <20230727135725.7053-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - 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 Signed-off-by: Adolf Belka --- 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 = "$Lang::tr{'capsopen'}";