From: Erik Kapfer Date: Mon, 18 Jun 2018 15:10:37 +0000 (+0200) Subject: OpenVPN: Fix upload check for root and host certificate X-Git-Tag: v2.21-core123~138 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=87ea30ff5669c0174af3a481f31aba9f868101c6;p=ipfire-2.x.git OpenVPN: Fix upload check for root and host certificate 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 Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index b3122a49c7..947cbe9e7c 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=/;