From: Gergely Nagy Date: Tue, 5 Jan 2021 11:49:55 +0000 (+0100) Subject: mk-ca-bundle.pl: deterministic output when using -t X-Git-Tag: curl-7_75_0~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56b32b5d7570c7eb4275bfe513af6a758f1dfe94;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/mk-ca-bundle.pl b/lib/mk-ca-bundle.pl index 5ed53fe0d4..8c92c44318 100755 --- a/lib/mk-ca-bundle.pl +++ b/lib/mk-ca-bundle.pl @@ -545,7 +545,7 @@ while () { 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";