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.
This commit is contained in:
Thomas Preud'homme 2018-05-31 20:22:06 +01:00
parent 6b1e766cf0
commit bfa3d78fca
2 changed files with 3 additions and 2 deletions

View File

@ -27,6 +27,7 @@ copy_extensions = copy
x509_extensions = v3_x509
[ policy_match ]
localityName = match
countryName = match
stateOrProvinceName = match
organizationName = match

View File

@ -178,10 +178,10 @@ get_field_from_line ()
line="$1"
field="$2"
result="${line#*$field=}"
result="$(echo ${line} | sed -r "s/.*${field} *= *//")"
if [ "$result" != "$line" ]
then
echo "${result%%/*}"
echo "${result%%,*}"
fi
}