|
Lines 54-59
Link Here
|
| 54 |
$debug++ |
54 |
$debug++ |
| 55 |
if defined $ENV{'WITH_DEBUG'} |
55 |
if defined $ENV{'WITH_DEBUG'} |
| 56 |
and $ENV{'WITH_DEBUG'} !~ m/(?i)^(no|0|false|)$/; |
56 |
and $ENV{'WITH_DEBUG'} !~ m/(?i)^(no|0|false|)$/; |
|
|
57 |
my $dups = 1; |
| 58 |
$dups = 0 |
| 59 |
if defined $ENV{'WITH_NODUPS'} |
| 60 |
and $ENV{'WITH_NODUPS'} !~ m/(?i)^(no|0|false|)$/; |
| 57 |
|
61 |
|
| 58 |
my %certs; |
62 |
my %certs; |
| 59 |
my %trusts; |
63 |
my %trusts; |
|
Lines 201-218
Link Here
|
| 201 |
} |
205 |
} |
| 202 |
} |
206 |
} |
| 203 |
|
207 |
|
| 204 |
print "## Untrusted certificates omitted from this bundle: $untrusted\n\n"; |
208 |
print "## Untrusted certificates omitted from this bundle: $untrusted\n"; |
| 205 |
print STDERR "## Untrusted certificates omitted from this bundle: $untrusted\n"; |
209 |
print STDERR "## Untrusted certificates omitted from this bundle: $untrusted\n"; |
|
|
210 |
print "## Ingnoring duplicate certificates\n\n" if ( ! $dups ); |
| 211 |
print STDERR "## Ingnoring duplicate certificates\n\n" if ( ! $dups ); |
| 206 |
|
212 |
|
| 207 |
my $certcount = 0; |
213 |
my $certcount = 0; |
| 208 |
foreach my $it (sort {uc($a) cmp uc($b)} keys %certs) { |
214 |
my (%seensubjects); |
|
|
215 |
foreach my $it (sort { |
| 216 |
my ($a1,$a2) = split("\0", $a); |
| 217 |
my ($b1,$b2) = split("\0", $b); |
| 218 |
uc($a1) cmp uc($b1) and $b2 == $a2 |
| 219 |
} keys %certs) { |
| 209 |
if (!exists($trusts{$it})) { |
220 |
if (!exists($trusts{$it})) { |
| 210 |
die "Found certificate without trust block,\naborting"; |
221 |
die "Found certificate without trust block,\naborting"; |
| 211 |
} |
222 |
} |
| 212 |
printcert("", $certs{$it}); |
223 |
my ($subject, $serial) = split("\0", $it); |
| 213 |
print "\n\n\n"; |
224 |
if ( $dups == 1 or ! exists $seensubjects{$subject} ) { |
| 214 |
$certcount++; |
225 |
$seensubjects{$subject} = 1; |
| 215 |
print STDERR "Trusting $certcount: ".printlabel($it)."\n" if $debug; |
226 |
printcert("", $certs{$it}); |
|
|
227 |
print "\n\n\n"; |
| 228 |
$certcount++; |
| 229 |
print STDERR "Trusting $certcount: ".printlabel($it)."\n" if $debug; |
| 230 |
} |
| 216 |
} |
231 |
} |
| 217 |
|
232 |
|
| 218 |
if ($certcount < 25) { |
233 |
if ($certcount < 25) { |