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:
parent
6b1e766cf0
commit
bfa3d78fca
|
@ -27,6 +27,7 @@ copy_extensions = copy
|
||||||
x509_extensions = v3_x509
|
x509_extensions = v3_x509
|
||||||
|
|
||||||
[ policy_match ]
|
[ policy_match ]
|
||||||
|
localityName = match
|
||||||
countryName = match
|
countryName = match
|
||||||
stateOrProvinceName = match
|
stateOrProvinceName = match
|
||||||
organizationName = match
|
organizationName = match
|
||||||
|
|
|
@ -178,10 +178,10 @@ get_field_from_line ()
|
||||||
|
|
||||||
line="$1"
|
line="$1"
|
||||||
field="$2"
|
field="$2"
|
||||||
result="${line#*$field=}"
|
result="$(echo ${line} | sed -r "s/.*${field} *= *//")"
|
||||||
if [ "$result" != "$line" ]
|
if [ "$result" != "$line" ]
|
||||||
then
|
then
|
||||||
echo "${result%%/*}"
|
echo "${result%%,*}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue