From 002b450c40a832d0d8f400df2f7ed27d12c49c81 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 11 Dec 2024 16:15:31 +0100 Subject: [PATCH] cleanup - fix some php notices, closes https://github.com/opnsense/core/issues/8125 --- src/etc/inc/certs.inc | 6 +++++- src/opnsense/mvc/app/library/OPNsense/Auth/Base.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/etc/inc/certs.inc b/src/etc/inc/certs.inc index a424a9d2a..fef4d987a 100644 --- a/src/etc/inc/certs.inc +++ b/src/etc/inc/certs.inc @@ -40,7 +40,8 @@ function &lookup_ca($refid) } } - return false; + $false = false; + return $false; } function &lookup_ca_by_subject($subject) @@ -94,6 +95,9 @@ function ca_chain_array(&$cert) if ($cert['caref']) { $chain = array(); $crt = lookup_ca($cert['caref']); + if (!$crt) { + return false; + } $chain[] = $crt; while ($crt) { $caref = isset($crt['caref']) ? $crt['caref'] : false; diff --git a/src/opnsense/mvc/app/library/OPNsense/Auth/Base.php b/src/opnsense/mvc/app/library/OPNsense/Auth/Base.php index 6e23fffed..fef7ed1b9 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Auth/Base.php +++ b/src/opnsense/mvc/app/library/OPNsense/Auth/Base.php @@ -284,7 +284,7 @@ abstract class Base $timeleft = $expected_time - ((microtime(true) - $tstart) * 1000000); if (!$result && $timeleft > 0) { - usleep($timeleft); + usleep((int)$timeleft); } return $result;