Check for variations of textually encoded cert.

Specifically, account for 'BEGIN X509 CERTIFICATE' and 'BEGIN TRUSTED
CERTIFICATE' markers.
This commit is contained in:
Arzhan Kinzhalin
2017-12-22 18:40:44 +00:00
parent fbf8e0e1af
commit a089fed478
+1 -1
View File
@@ -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
}