mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-22 00:42:59 +02:00
vpnmain.cgi: Fix reading common names from certificates
OpenSSL has changed the output of the subject lines of certificates. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
###
|
||||
|
||||
Reference in New Issue
Block a user