mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-08-09 18:11:36 +00:00
global-functions: $CertificateAvailable: accept name in unit (OU)
This commit is contained in:
parent
245162c426
commit
928dd8213c
1 changed files with 4 additions and 4 deletions
|
|
@ -133,23 +133,23 @@
|
|||
:local CertSettings [ /certificate/settings/get ];
|
||||
:if ((($CertSettings->"builtin-trust-store") ~ $UseFor || \
|
||||
($CertSettings->"builtin-trust-store") = "all") && \
|
||||
[ :len [ /certificate/builtin/find where common-name=$CommonName ] ] > 0) do={
|
||||
[ :len [ /certificate/builtin/find where common-name=$CommonName or unit=$CommonName ] ] > 0) do={
|
||||
:return true;
|
||||
}
|
||||
|
||||
:if ([ :len [ /certificate/find where common-name=$CommonName ] ] = 0) do={
|
||||
:if ([ :len [ /certificate/find where common-name=$CommonName or unit=$CommonName ] ] = 0) do={
|
||||
$LogPrint info $0 ("Certificate with CommonName '" . $CommonName . "' not available.");
|
||||
:if ([ $CertificateDownload $CommonName ] = false) do={
|
||||
:return false;
|
||||
}
|
||||
}
|
||||
|
||||
:if ([ :len [ /certificate/find where common-name=$CommonName ] ] > 1) do={
|
||||
:if ([ :len [ /certificate/find where common-name=$CommonName or unit=$CommonName ] ] > 1) do={
|
||||
$LogPrint info $0 ("There are " . $CertCount . " Certificates with CommonName '" . $CommonName . "'. Should be ok.");
|
||||
:return true;
|
||||
}
|
||||
|
||||
:local CertVal [ /certificate/get [ find where common-name=$CommonName ] ];
|
||||
:local CertVal [ /certificate/get [ find where common-name=$CommonName or unit=$CommonName ] ];
|
||||
:while (($CertVal->"akid") != "" && ($CertVal->"akid") != ($CertVal->"skid")) do={
|
||||
:if ([ :len [ /certificate/find where skid=($CertVal->"akid") ] ] = 0) do={
|
||||
:local IssuerCN ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue