diff options
author | beck <> | 2020-07-16 01:50:25 +0000 |
---|---|---|
committer | beck <> | 2020-07-16 01:50:25 +0000 |
commit | f9151c76d47b4d5c6c4e171b7c4d485a6ff5dd12 (patch) | |
tree | a3f4140bc01fb5cbf8b6afaf6afc7de54a44a56f /src | |
parent | 988294b5e54162f8627973358143019ee7053938 (diff) | |
download | openbsd-f9151c76d47b4d5c6c4e171b7c4d485a6ff5dd12.tar.gz openbsd-f9151c76d47b4d5c6c4e171b7c4d485a6ff5dd12.tar.bz2 openbsd-f9151c76d47b4d5c6c4e171b7c4d485a6ff5dd12.zip |
Fix perl bugs that had me printing the wrong cert number for errors
Diffstat (limited to 'src')
-rwxr-xr-x | src/regress/lib/libcrypto/x509/bettertls/check.perl | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/regress/lib/libcrypto/x509/bettertls/check.perl b/src/regress/lib/libcrypto/x509/bettertls/check.perl index cdf5bde808..a845db387e 100755 --- a/src/regress/lib/libcrypto/x509/bettertls/check.perl +++ b/src/regress/lib/libcrypto/x509/bettertls/check.perl | |||
@@ -1,6 +1,6 @@ | |||
1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl |
2 | 2 | ||
3 | # $OpenBSD: check.perl,v 1.2 2020/07/15 03:49:59 beck Exp $ | 3 | # $OpenBSD: check.perl,v 1.3 2020/07/16 01:50:25 beck Exp $ |
4 | # | 4 | # |
5 | # Copyright (c) 2020 Bob Beck <beck@openbsd.org> | 5 | # Copyright (c) 2020 Bob Beck <beck@openbsd.org> |
6 | # | 6 | # |
@@ -25,7 +25,7 @@ if ($num_args != 3) { | |||
25 | 25 | ||
26 | my $expected_file=$ARGV[0]; | 26 | my $expected_file=$ARGV[0]; |
27 | my $known_file=$ARGV[1]; | 27 | my $known_file=$ARGV[1]; |
28 | my $output_file=$ARGV[1]; | 28 | my $output_file=$ARGV[2]; |
29 | 29 | ||
30 | open (OUT, "<$output_file") || die "can't open $output_file"; | 30 | open (OUT, "<$output_file") || die "can't open $output_file"; |
31 | open (KNOWN, "<$known_file") || die "can't open $known_file"; | 31 | open (KNOWN, "<$known_file") || die "can't open $known_file"; |
@@ -72,25 +72,26 @@ my $id; | |||
72 | my $regressions = 0; | 72 | my $regressions = 0; |
73 | my $known = 0; | 73 | my $known = 0; |
74 | for ($id = 0; $id < $i; $id++) { | 74 | for ($id = 0; $id < $i; $id++) { |
75 | my $cert = $id + 1; | ||
75 | my $ipknown = ($outip[$id] eq $knownip[$id]); | 76 | my $ipknown = ($outip[$id] eq $knownip[$id]); |
76 | my $dnsknown = ($outdns[$id] eq $knowndns[$id]); | 77 | my $dnsknown = ($outdns[$id] eq $knowndns[$id]); |
77 | if ($expecteddns[$id] ne $outdns[$id] && $expecteddns[$id] !~ /WEAK/) { | 78 | if ($expecteddns[$id] ne $outdns[$id] && $expecteddns[$id] !~ /WEAK/) { |
78 | print STDERR "$id DNS expected $expecteddns[$id] known $knowndns[$id] result $outdns[$id]"; | 79 | print STDERR "$cert DNS expected $expecteddns[$id] known $knowndns[$id] result $outdns[$id]"; |
79 | if ($dnsknown) { | 80 | if ($dnsknown) { |
80 | print " (known failure)\n"; | 81 | print STDERR " (known failure)\n"; |
81 | $known++; | 82 | $known++; |
82 | } else { | 83 | } else { |
83 | print " (REGRESSED)\n"; | 84 | print STDERR " (REGRESSED)\n"; |
84 | $regressions++; | 85 | $regressions++; |
85 | } | 86 | } |
86 | } | 87 | } |
87 | if ($expectedip[$id] ne $outip[$id] && $expectedip[$id] !~ /WEAK/) { | 88 | if ($expectedip[$id] ne $outip[$id] && $expectedip[$id] !~ /WEAK/) { |
88 | print "$id IP expected $expectedip[$id] known $knownip[$id] result $outip[$id]"; | 89 | print STDERR "$cert IP expected $expectedip[$id] known $knownip[$id] result $outip[$id]"; |
89 | if ($ipknown) { | 90 | if ($ipknown) { |
90 | print " (known failure)\n"; | 91 | print STDERR " (known failure)\n"; |
91 | $known++; | 92 | $known++; |
92 | } else { | 93 | } else { |
93 | print " (REGRESSED)\n"; | 94 | print STDERR " (REGRESSED)\n"; |
94 | $regressions++; | 95 | $regressions++; |
95 | } | 96 | } |
96 | } | 97 | } |