From 8b52f4530274cc41b0fb9af14662ec41c8f925f1 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 12 Jan 2018 15:09:27 -0800 Subject: [PATCH] There can be a space after CN and before = https://www.virtualmin.com/node/53623 --- webmin/webmin-lib.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/webmin/webmin-lib.pl b/webmin/webmin-lib.pl index 1c8ae26bb..834961cbf 100755 --- a/webmin/webmin-lib.pl +++ b/webmin/webmin-lib.pl @@ -1822,25 +1822,25 @@ local $_; open(OUT, "openssl x509 -in ".quotemeta($_[0])." -issuer -subject -enddate -text |"); while() { s/\r|\n//g; - if (/subject=.*CN=([^\/]+)/) { + if (/subject=.*CN\s*=\s*([^\/]+)/) { $rv{'cn'} = $1; } - if (/subject=.*O=([^\/]+)/) { + if (/subject=.*O\s*=\s*([^\/]+)/) { $rv{'o'} = $1; } - if (/subject=.*Email=([^\/]+)/) { + if (/subject=.*Email\s*=\s*([^\/]+)/) { $rv{'email'} = $1; } - if (/issuer=.*CN=([^\/]+)/) { + if (/issuer=.*CN\s*=\s*([^\/]+)/) { $rv{'issuer_cn'} = $1; } - if (/issuer=.*O=([^\/]+)/) { + if (/issuer=.*O\s*=\s*([^\/]+)/) { $rv{'issuer_o'} = $1; } - if (/issuer=.*Email=([^\/]+)/) { + if (/issuer=.*Email\s*=\s*([^\/]+)/) { $rv{'issuer_email'} = $1; } - if (/notAfter=(.*)/) { + if (/notAfter\s*=\s*(.*)/) { $rv{'notafter'} = $1; } if (/Subject\s+Alternative\s+Name/i) {