From bba0b479d5578a04c5160a4c6ec98af90a1f421a Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 21 Sep 2024 10:27:54 +0200 Subject: [PATCH] Fix cats_import - compare the client certificate email address directly instead of trying to match DN parts - improve handling of IP addresses --- www/cats/cats_import.php | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/www/cats/cats_import.php b/www/cats/cats_import.php index feb92d4..7e56ba0 100644 --- a/www/cats/cats_import.php +++ b/www/cats/cats_import.php @@ -1,6 +1,6 @@ 0 -) $access = TRUE; +$ssl_client_email = (isset($_SERVER['SSL_CLIENT_S_DN_Email']))?$_SERVER['SSL_CLIENT_S_DN_Email']:UNDEFINED; + +// Access only from cats.cacert.org with a client certificate for cats@cacert.org +$access = in_array($remote_addr, $allowed_ip_addresses) && ($https == 'on') && ($ssl_client_email == $expected_client_address); if ($access !== TRUE) { echo 'UNAUTHORIZED ACCESS
'."\r\n";