genprotimg/samples/check_hostkeydoc: set LC_ALL=C for the sort command

Set `LC_ALL=C` for the `sort` command to get a stable sort order. See
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sort.html for
details on the effect of LC_* on `sort`. Adapt the default issuer
accordingly.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2024-03-15 12:03:46 +00:00
committed by Steffen Eiden
parent d14e7593cc
commit 173fd7cdca

View File

@@ -121,7 +121,7 @@ canonical_dn()
OUTPUT=$4
openssl $OBJTYPE -in $OBJ -$DNTYPE -noout -nameopt multiline \
| sort | grep -v $DNTYPE= > $OUTPUT
| LC_ALL=C sort | grep -v $DNTYPE= > $OUTPUT
}
default_issuer()
@@ -130,8 +130,8 @@ default_issuer()
commonName = International Business Machines Corporation
countryName = US
localityName = Poughkeepsie
organizationalUnitName = Key Signing Service
organizationName = International Business Machines Corporation
organizationalUnitName = Key Signing Service
stateOrProvinceName = New York
EOF
}