1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 08:38:49 -05:00

mk-ca-bundle.pl: deterministic output when using -t

Printing trust purposes are now sorted, making the output deterministic
when running on the same input certdata.txt.

Closes #6413
This commit is contained in:
Gergely Nagy 2021-01-05 12:49:55 +01:00 committed by Daniel Stenberg
parent eacfe36991
commit 56b32b5d75
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -545,7 +545,7 @@ while (<TXT>) {
print CRT @precert if($opt_m);
my $maxStringLength = length(decode('UTF-8', $caname, Encode::FB_CROAK | Encode::LEAVE_SRC));
if ($opt_t) {
foreach my $key (keys %trust_purposes_by_level) {
foreach my $key (sort keys %trust_purposes_by_level) {
my $string = $key . ": " . join(", ", @{$trust_purposes_by_level{$key}});
$maxStringLength = List::Util::max( length($string), $maxStringLength );
print CRT $string . "\n";