From: Michael Tremer Date: Thu, 1 Mar 2018 19:58:11 +0000 (+0000) Subject: vpnmain.cgi: Fix reading common names from certificates X-Git-Tag: v2.19-core120~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=568a227bd318c743225d90c8d93559d04ac72a8f;p=people%2Fstevee%2Fipfire-2.x.git vpnmain.cgi: Fix reading common names from certificates OpenSSL has changed the output of the subject lines of certificates. Signed-off-by: Michael Tremer --- diff --git a/config/rootfiles/core/120/filelists/files b/config/rootfiles/core/120/filelists/files index 180cf0b4d5..848d69a97b 100644 --- a/config/rootfiles/core/120/filelists/files +++ b/config/rootfiles/core/120/filelists/files @@ -4,6 +4,7 @@ etc/sysctl.conf etc/fcron.daily/openvpn-crl-updater etc/rc.d/init.d/dhcp srv/web/ipfire/cgi-bin/ovpnmain.cgi +srv/web/ipfire/cgi-bin/vpnmain.cgi usr/lib/python2.7/lib-dynload/_hashlib.so usr/lib/python2.7/lib-dynload/_ssl.so var/ipfire/langs diff --git a/html/cgi-bin/vpnmain.cgi b/html/cgi-bin/vpnmain.cgi index 2a0351ea04..a52b4d64d9 100644 --- a/html/cgi-bin/vpnmain.cgi +++ b/html/cgi-bin/vpnmain.cgi @@ -199,10 +199,10 @@ sub callssl ($) { sub getCNfromcert ($) { #&General::log("ipsec", "Extracting name from $_[0]..."); my $temp = `/usr/bin/openssl x509 -text -in $_[0]`; - $temp =~ /Subject:.*CN=(.*)[\n]/; + $temp =~ /Subject:.*CN = (.*)[\n]/; $temp = $1; $temp =~ s+/Email+, E+; - $temp =~ s/ ST=/ S=/; + $temp =~ s/ ST = / S = /; $temp =~ s/,//g; $temp =~ s/\'//g; return $temp; @@ -216,7 +216,7 @@ sub getsubjectfromcert ($) { $temp =~ /Subject: (.*)[\n]/; $temp = $1; $temp =~ s+/Email+, E+; - $temp =~ s/ ST=/ S=/; + $temp =~ s/ ST = / S = /; return $temp; } ###