Bladeren bron

Fix ssl_mgmt after openssl -text output change

The output of openssl x509 -text changed from lines like:

O=foo/OU=bar

to lines like:

O = foo, OU = bar

This commit adapts the code to that change. TODO: A machine readable
output ought to be used instead.
master
Thomas Preud'homme 1 jaar geleden
bovenliggende
commit
bfa3d78fca
2 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 1
    0
      ssl_mgmt/openssl.cnf.in
  2. 2
    2
      ssl_mgmt/ssl_mgmt

+ 1
- 0
ssl_mgmt/openssl.cnf.in Bestand weergeven

@@ -27,6 +27,7 @@ copy_extensions = copy
27 27
 x509_extensions = v3_x509
28 28
 
29 29
 [ policy_match ]
30
+localityName = match
30 31
 countryName = match
31 32
 stateOrProvinceName = match
32 33
 organizationName = match

+ 2
- 2
ssl_mgmt/ssl_mgmt Bestand weergeven

@@ -178,10 +178,10 @@ get_field_from_line ()
178 178
 
179 179
 	line="$1"
180 180
 	field="$2"
181
-	result="${line#*$field=}"
181
+	result="$(echo ${line} | sed -r "s/.*${field} *= *//")"
182 182
 	if [ "$result" != "$line" ]
183 183
 	then
184
-		echo "${result%%/*}"
184
+		echo "${result%%,*}"
185 185
 	fi
186 186
 }
187 187
 

Laden…
Annuleren
Opslaan