]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
mk-ca-bundle.pl: deterministic output when using -t
authorGergely Nagy <ngg@tresorit.com>
Tue, 5 Jan 2021 11:49:55 +0000 (12:49 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 5 Jan 2021 12:03:41 +0000 (13:03 +0100)
Printing trust purposes are now sorted, making the output deterministic
when running on the same input certdata.txt.

Closes #6413

lib/mk-ca-bundle.pl

index 5ed53fe0d410696ce903c64930defd9df03f4dc7..8c92c44318774e95762dc93d0f2713877a989e44 100755 (executable)
@@ -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";