From patchwork Tue Jun 19 01:10:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Kapfer X-Patchwork-Id: 1819 Return-Path: Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.i.ipfire.org (Postfix) with ESMTP id 30D00602CB for ; Mon, 18 Jun 2018 17:10:41 +0200 (CEST) Received: from mail01.i.ipfire.org (localhost [127.0.0.1]) by mail01.ipfire.org (Postfix) with ESMTP id CDD0D108B897; Mon, 18 Jun 2018 16:10:40 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201801; t=1529334641; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:list-id: list-unsubscribe:list-subscribe:list-post; bh=S3aGIRHFxzZsOU+1D6XEaJGSuigz8fUchm3BIk0pT7M=; b=GLQKtRKUGsaP4x6y/60GWR1670yjrULdTqzfIDu6au0oDdusAB0NHmhs4RLXMvIxFwnuA5 A/F6OITY67AxYX78QCX9s2skhAEVRnUj8br/qW8OQIDSLhEzuj0lKWrh/bWhNAkT1afhSq Uiz2tD1BEpdjrL0R3JHBzYmUhy1J/BeBNk2SMJRFBVjCL/T2gphCbw/kOHLVAKQd2u/t7K /cgzPvCWxnwffWI+nkV1MSnuWRoAQftmMnGjo1jIdpCN+dDzdmlpjcZb22RydqdaDSqhRL AYychmEfmZ/2YaX3iVFgiuBP4CUNQaevED3JUZQkUJK5gAz3zefNPcCqBabCfQ== Received: from localhost.localdomain (i59F4AD79.versanet.de [89.244.173.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id A140E10910AF; Mon, 18 Jun 2018 16:10:38 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201801; t=1529334638; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=S3aGIRHFxzZsOU+1D6XEaJGSuigz8fUchm3BIk0pT7M=; b=Qqtcmfj5ECtahFZ6TTA78c/+fb0T7LuEKaQVs4Oy+GOC1Nrk3zZJsOYWPo45TAwu0SpE/O qz4HJViv1K5Ic8aHwreg7vWyehOFa8Sz8Ncg8xJbvt2FeG50pbeJzfrwv9stzpGUoc+hQb Hux8daGRJKExSliDxmGfP1ycjoe1VB8HNzNFQ8WOFh1SlyjyfmfXRojfrd1Jr/+NFnEz1p aWuH65bMSPibrRf9k6nq4c/M8EUBbgFW8N59gmmV1CdrqFLAMZHt0hDgSzPaiyk4wb56KL bQNtX8WYiD9376pJ1QBsI7w1YJuv++6Wnopr+CQf81CKKWpd6p6u3vit4s5tKg== From: Erik Kapfer To: development@lists.ipfire.org Subject: [PATCH] OpenVPN: Fix upload check for root and host certificate Date: Mon, 18 Jun 2018 17:10:37 +0200 Message-Id: <1529334637-31019-1-git-send-email-erik.kapfer@ipfire.org> X-Mailer: git-send-email 2.7.4 Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=ummeegge smtp.mailfrom=erik.kapfer@ipfire.org X-Spamd-Result: default: False [-2.10 / 11.00]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; BAYES_HAM(-3.00)[100.00%]; ARC_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_ZERO(0.00)[0]; ASN(0.00)[asn:8881, ipnet:89.244.160.0/20, country:DE]; FROM_HAS_DN(0.00)[] X-Spam-Status: No, score=-2.10 X-Rspamd-Server: mail01.i.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 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" Fix for #11766 . Since the new OpenSSL output differs in the 'Subject' section, the regex needed to be adapted. Old and new output should now be possible. Signed-off-by: Erik Kapfer --- html/cgi-bin/ovpnmain.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index b3122a4..947cbe9 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -4045,7 +4045,7 @@ if ($cgiparams{'TYPE'} eq 'net') { } my $temp = `/usr/bin/openssl x509 -text -in ${General::swroot}/ovpn/certs/$cgiparams{'NAME'}cert.pem`; - $temp =~ /Subject:.*CN=(.*)[\n]/; + $temp =~ /Subject:.*CN\s?=\s?(.*)[\n]/; $temp = $1; $temp =~ s+/Email+, E+; $temp =~ s/ ST=/ S=/; @@ -4099,7 +4099,7 @@ if ($cgiparams{'TYPE'} eq 'net') { } my $temp = `/usr/bin/openssl x509 -text -in ${General::swroot}/ovpn/certs/$cgiparams{'NAME'}cert.pem`; - $temp =~ /Subject:.*CN=(.*)[\n]/; + $temp =~ /Subject:.*CN\s?=\s?(.*)[\n]/; $temp = $1; $temp =~ s+/Email+, E+; $temp =~ s/ ST=/ S=/;