Branch Coverage

blib/lib/Mail/DKIM/Verifier.pm
Criterion Covered Total %
branch 63 88 71.5


line true false branch
60 64 583 if (lc $field_name eq "dkim-signature")
66 1 63 unless (eval { do { local $SIG{'__DIE__'}; my $signature = "Mail::DKIM::Signature"->parse($line); $self->add_signature($signature); 1 } })
78 17 630 if (lc $field_name eq "domainkey-signature")
84 0 17 unless (eval { do { local $SIG{'__DIE__'}; my $signature = "Mail::DKIM::DkSignature"->parse($line); $self->add_signature($signature); 1 } })
99 0 80 unless @_ == 1
104 0 80 if @{$self->{'signatures'};} > $MAX_SIGNATURES_TO_PROCESS
108 13 67 unless ($self->check_signature($signature))
125 52 15 if ($algorithm->wants_pre_signature_headers)
141 0 80 unless @_ == 1
144 1 79 unless ($signature->check_version)
147 1 0 if (defined $signature->version) { }
157 2 77 unless ($signature->algorithm and $signature->get_algorithm_class($signature->algorithm))
162 2 0 if (defined $signature->algorithm)
168 4 73 if ($self->{'Strict'})
169 2 2 if ($signature->algorithm eq "rsa-sha1")
171 2 0 if (defined $signature->algorithm)
178 2 73 unless ($signature->check_canonicalization)
182 2 0 if (defined $signature->canonicalization)
189 4 69 unless ($signature->check_protocol)
193 0 4 !defined($signature->protocol) ? :
199 2 67 unless ($signature->check_expiration)
206 0 67 unless (defined $signature->domain)
213 0 67 if ($signature->domain eq "")
220 0 67 unless (defined $signature->selector)
232 0 56 unless @_ == 2
257 5 49 if $@
259 7 49 unless (eval { do { local $SIG{'__DIE__'}; $@ = undef; $result = $public_key->check_hash_algorithm($signature->hash_algorithm); my $empty_g_means_wildcard = $signature->isa("Mail::DKIM::DkSignature"); $result &&= $public_key->check_granularity($signature->identity, $empty_g_means_wildcard); die $@ if $@; 1 } })
275 67 0 if (defined $i and $i =~ /\@([^\@]*)$/)
282 0 67 unless @_ == 2
299 1 74 if (@{$self->{'signatures'};} == 0 and not defined $self->{'signature_reject_reason'})
316 12 62 if (@{$self->{'algorithms'};} == 0 and @{$self->{'signatures'};} > 0)
332 3 64 unless (check_signature_identity($signature))
340 8 56 unless (eval { do { $pkey = $signature->get_public_key; 1 } })
347 7 49 unless ($self->check_public_key($signature, $pkey))
353 1 26 if ($keysize < 1024 and $self->{'Strict'})
363 38 8 $algorithm->verify ? :
366 2 46 unless (eval { do { $result = $algorithm->verify ? "pass" : "fail"; $details = $algorithm->{'verification_details'} || $@; 1 } })
370 2 0 if ($E =~ /(OpenSSL error: .*?) at /) { }
0 0 elsif ($E =~ /^(panic:.*?) at /) { }
400 64 3 if (not $self->{'result'} or $result eq "pass")
413 0 0 unless $self->{'headers_by_name'}{'from'}
466 0 0 $sender_policy ? :
0 0 $author_policy ? :
477 0 4 if @_