From a089fed478e2299ea1369b0268ea2c8a32627073 Mon Sep 17 00:00:00 2001 From: Arzhan Kinzhalin Date: Fri, 22 Dec 2017 18:40:44 +0000 Subject: [PATCH] Check for variations of textually encoded cert. Specifically, account for 'BEGIN X509 CERTIFICATE' and 'BEGIN TRUSTED CERTIFICATE' markers. --- clrtrust | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clrtrust b/clrtrust index 3e62e75..5a0e53c 100755 --- a/clrtrust +++ b/clrtrust @@ -54,7 +54,7 @@ is_single_cert() { # each certificate provided as input to clrtrust must contain single # certificate, so it can be used in CAPath. in other words, OpenSSL's bundle # certificates are not accepted. this function checks for that - t=$(cat "$1" | grep 'BEGIN CERTIFICATE' | wc -l) + t=$(cat "$1" | grep 'BEGIN \(X509 \|TRUSTED \|\)CERTIFICATE' | wc -l) test $t -eq 1 }