From 44727842749c418165730b714ac87b2bc48265fa Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 10 Mar 2021 23:16:39 +0100 Subject: global-functions: $CertificateAvailable: use pre-test loop This is required to test for root CA (without intermediate) directly. --- global-functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global-functions b/global-functions index 2f68148..042d89b 100644 --- a/global-functions +++ b/global-functions @@ -84,7 +84,7 @@ } :local CertVal [ / certificate get [ find where common-name=$CommonName ] ]; - :do { + :while (($CertVal->"akid") != "" && ($CertVal->"akid") != ($CertVal->"skid")) do={ :if ([ :len [ / certificate find where skid=($CertVal->"akid") ] ] = 0) do={ $LogPrintExit2 info $0 ("Certificate chain for \"" . $CommonName . \ "\" is incomplete, missing \"" . ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN") . "\".") false; @@ -93,7 +93,7 @@ } } :set CertVal [ / certificate get [ find where skid=($CertVal->"akid") ] ]; - } while=(($CertVal->"akid") != "" && ($CertVal->"akid") != ($CertVal->"skid")); + } :return true; } -- cgit v1.2.3-54-g00ecf