diff options
| author | sthen <> | 2024-11-01 11:19:13 +0000 |
|---|---|---|
| committer | sthen <> | 2024-11-01 11:19:13 +0000 |
| commit | e75ac87668ff10ae07ad1be38bc92999817aba0d (patch) | |
| tree | 192fc64477fa4e50849efd107a7e1be1b45c9fad /src | |
| parent | c7ead12e498f83b128e3ce45ca75c6c111d249bd (diff) | |
| download | openbsd-e75ac87668ff10ae07ad1be38bc92999817aba0d.tar.gz openbsd-e75ac87668ff10ae07ad1be38bc92999817aba0d.tar.bz2 openbsd-e75ac87668ff10ae07ad1be38bc92999817aba0d.zip | |
Don't lowercase cert subjects when sorting; combined with perl foreach over
a hash returning entries in random order, the order of "COMODO CA Limited"
and "Comodo CA Limited" was switching randomly.
This results in a bigger change of sort order now, but means that future
changes will then be in a repeatable order.
ok tb@
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/format-pem.pl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/format-pem.pl b/src/lib/libcrypto/format-pem.pl index 0202403204..5a96fe5b1d 100644 --- a/src/lib/libcrypto/format-pem.pl +++ b/src/lib/libcrypto/format-pem.pl | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl |
| 2 | # $OpenBSD: format-pem.pl,v 1.6 2022/07/03 15:02:04 sthen Exp $ | 2 | # $OpenBSD: format-pem.pl,v 1.7 2024/11/01 11:19:13 sthen Exp $ |
| 3 | # | 3 | # |
| 4 | # Copyright (c) 2016 Stuart Henderson <sthen@openbsd.org> | 4 | # Copyright (c) 2016 Stuart Henderson <sthen@openbsd.org> |
| 5 | # | 5 | # |
| @@ -115,9 +115,9 @@ while(<>) { | |||
| 115 | close $tmp; | 115 | close $tmp; |
| 116 | chomp $rcsid; | 116 | chomp $rcsid; |
| 117 | print $rcsid; | 117 | print $rcsid; |
| 118 | foreach my $o (sort{lc($a) cmp lc($b)} keys %ca) { | 118 | foreach my $o (sort{$a cmp $b} keys %ca) { |
| 119 | print "\n### $o\n\n"; | 119 | print "\n### $o\n\n"; |
| 120 | foreach my $subj (sort{lc($a) cmp lc($b)} keys %{ $ca{$o} }) { | 120 | foreach my $subj (sort{$a cmp $b} keys %{ $ca{$o} }) { |
| 121 | if ($ca{$o}{$subj}{'valid'} == 1) { | 121 | if ($ca{$o}{$subj}{'valid'} == 1) { |
| 122 | print "=== $subj\n"; | 122 | print "=== $subj\n"; |
| 123 | print $ca{$o}{$subj}{'info'}; | 123 | print $ca{$o}{$subj}{'info'}; |
| @@ -127,9 +127,9 @@ foreach my $o (sort{lc($a) cmp lc($b)} keys %ca) { | |||
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | # print a visual summary at the end | 129 | # print a visual summary at the end |
| 130 | foreach my $o (sort{lc($a) cmp lc($b)} keys %ca) { | 130 | foreach my $o (sort{$a cmp $b} keys %ca) { |
| 131 | print STDERR "\n$o\n"; | 131 | print STDERR "\n$o\n"; |
| 132 | foreach my $subj (sort{lc($a) cmp lc($b)} keys %{ $ca{$o} }) { | 132 | foreach my $subj (sort{$a cmp $b} keys %{ $ca{$o} }) { |
| 133 | print STDERR " $subj\n"; | 133 | print STDERR " $subj\n"; |
| 134 | } | 134 | } |
| 135 | } | 135 | } |
