From e75ac87668ff10ae07ad1be38bc92999817aba0d Mon Sep 17 00:00:00 2001 From: sthen <> Date: Fri, 1 Nov 2024 11:19:13 +0000 Subject: 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@ --- src/lib/libcrypto/format-pem.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/lib') 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 @@ #!/usr/bin/perl -# $OpenBSD: format-pem.pl,v 1.6 2022/07/03 15:02:04 sthen Exp $ +# $OpenBSD: format-pem.pl,v 1.7 2024/11/01 11:19:13 sthen Exp $ # # Copyright (c) 2016 Stuart Henderson # @@ -115,9 +115,9 @@ while(<>) { close $tmp; chomp $rcsid; print $rcsid; -foreach my $o (sort{lc($a) cmp lc($b)} keys %ca) { +foreach my $o (sort{$a cmp $b} keys %ca) { print "\n### $o\n\n"; - foreach my $subj (sort{lc($a) cmp lc($b)} keys %{ $ca{$o} }) { + foreach my $subj (sort{$a cmp $b} keys %{ $ca{$o} }) { if ($ca{$o}{$subj}{'valid'} == 1) { print "=== $subj\n"; print $ca{$o}{$subj}{'info'}; @@ -127,9 +127,9 @@ foreach my $o (sort{lc($a) cmp lc($b)} keys %ca) { } # print a visual summary at the end -foreach my $o (sort{lc($a) cmp lc($b)} keys %ca) { +foreach my $o (sort{$a cmp $b} keys %ca) { print STDERR "\n$o\n"; - foreach my $subj (sort{lc($a) cmp lc($b)} keys %{ $ca{$o} }) { + foreach my $subj (sort{$a cmp $b} keys %{ $ca{$o} }) { print STDERR " $subj\n"; } } -- cgit v1.2.3-55-g6feb