aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-03-10 23:16:39 +0100
committerGravatar Christian Hesse <mail@eworm.de>2021-03-10 23:16:39 +0100
commit44727842749c418165730b714ac87b2bc48265fa (patch)
tree3360555275311206c327c64f786da97b6e4f9e3a
parentb1647c760c202c79fc0d1f1be38914b6886fb91f (diff)
global-functions: $CertificateAvailable: use pre-test loop
This is required to test for root CA (without intermediate) directly.
-rw-r--r--global-functions4
1 files 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;
}