mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-12-06 09:59:28 +00:00
global-functions: $CertificateAvailable: support new builtin-trust-store...
... which was introduced with RouterOS 7.21beta7.
This commit is contained in:
parent
3e17387d1e
commit
be77cf1ca5
1 changed files with 8 additions and 1 deletions
|
|
@ -106,11 +106,15 @@
|
|||
# check and download required certificate
|
||||
:set CertificateAvailable do={
|
||||
:local CommonName [ :tostr $1 ];
|
||||
:local UseFor [ :tostr $2 ];
|
||||
|
||||
:global CertificateDownload;
|
||||
:global EitherOr;
|
||||
:global LogPrint;
|
||||
:global ParseKeyValueStore;
|
||||
|
||||
:set UseFor [ $EitherOr $UseFor "undefined" ];
|
||||
|
||||
:if ([ /system/resource/get free-hdd-space ] < 8388608 && \
|
||||
[ /certificate/settings/get crl-download ] = true && \
|
||||
[ /certificate/settings/get crl-store ] = "system") do={
|
||||
|
|
@ -123,7 +127,10 @@
|
|||
:return false;
|
||||
}
|
||||
|
||||
:if (([ /certificate/settings/get ]->"builtin-trust-anchors") = "trusted" && \
|
||||
:local CertSettings [ /certificate/settings/get ];
|
||||
:if ((($CertSettings->"builtin-trust-anchors") = "trusted" || \
|
||||
($CertSettings->"builtin-trust-store") ~ $UseFor || \
|
||||
($CertSettings->"builtin-trust-store") = "all") && \
|
||||
[[ :parse (":return [ :len [ /certificate/builtin/find where common-name=\"" . $CommonName . "\" ] ]") ]] > 0) do={
|
||||
:return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue