From e36613608c18bc4bcbc11e2d8da47f6c8c53c454 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 7 Apr 2025 14:14:00 +0200 Subject: [PATCH] global-functions: $CertificateNameByCN: support matching by fingerprint and name --- global-functions.rsc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 30374aa..f73ea14 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -203,11 +203,12 @@ # name a certificate by its common-name :set CertificateNameByCN do={ - :local CommonName [ :tostr $1 ]; + :local Match [ :tostr $1 ]; :global CleanName; - :local Cert [ /certificate/find where common-name=$CommonName ]; + :local Cert [ /certificate/find where (common-name=$Match or fingerprint=$Match or name=$Match) ]; + :local CommonName [ /certificate/get $Cert common-name ]; /certificate/set $Cert name=[ $CleanName $CommonName ]; }