Branch Coverage

blib/lib/Mail/DKIM/PublicKey.pm
Criterion Covered Total %
branch 77 114 67.5


line true false branch
63 0 425 unless defined $prms{'Protocol'} and $prms{'Protocol'} =~ m[^dns(/txt)?$]s
67 2 423 unless defined $prms{'Selector'} and length $prms{'Selector'}
70 0 423 unless defined $prms{'Domain'} and length $prms{'Domain'}
72 2 421 unless $prms{'Callbacks'}
76 5 363 unless (@resp)
84 0 363 unless $rr->type eq "TXT"
87 363 0 if ('Net::DNS'->VERSION >= 0.69) { }
100 0 363 unless $strn
127 339 21 if (my $v = $self->get_tag("v"))
128 1 338 unless ($v eq "DKIM1")
137 334 25 if (my $k = $self->get_tag("k"))
138 1 333 unless ($k eq "rsa" or $k eq "ed25519")
145 0 358 unless (defined $p)
148 1 357 if ($p eq "")
151 0 357 unless ($p =~ m[^[A-Za-z0-9\+/\=]+$])
160 1 356 unless (eval { do { local $SIG{'__DIE__'}; $self->cork; 1 } })
164 0 1 if ($E =~ /(OpenSSL error: .*?) at /) { }
0 1 elsif ($E =~ /^(panic:.*?) at /) { }
1 0 elsif ($E =~ /^FATAL: (.*) at /) { }
177 22 334 if (my $s = $self->get_tag("s"))
179 15 11 unless $_ eq "*"
1 21 unless (grep {$_ eq "email" unless $_ eq "*";} @list)
208 1 351 if ($g eq "" and $empty_g_means_wildcard)
214 57 295 if ($identity =~ /^(.*)\@([^\@]*)$/) { }
224 351 1 if (defined $ends) { }
229 3 348 if (length $local_part < length($begins) + length($ends) or substr($local_part, 0, length $begins) ne $begins or length $ends and substr($local_part, -length($ends)) ne $ends)
246 1 0 if ($g eq "")
250 0 0 unless ($local_part eq $begins)
257 2 346 if ($self->subdomain_flag)
258 1 1 unless (lc $domain_part eq lc $self->{'Domain'})
275 14 340 if (my $h = $self->get_tag("h"))
277 2 12 unless (grep {$_ eq $hash_algorithm;} @list)
299 0 353 unless my $cork = "Crypt::OpenSSL::RSA"->new_public_key($cert)
312 0 4 unless my $cork = "Crypt::PK::Ed25519"->new
316 0 3 unless $cork->import_key_raw($keybin, "public")
327 25 332 unless defined $k_tag
329 0 357 unless $self->data
332 353 4 if $k_tag eq "rsa"
333 4 0 if $k_tag eq "ed25519"
347 0 0 unless (eval { do { local $SIG{'__DIE__'}; $rtrn = $self->cork->verify($prms{'Text'}, $prms{'Signature'}); 1 } })
360 0 711 if @_
364 44 667 if (defined $g) { }
375 0 0 if @_
384 0 3782 if @_
390 3782 0 if defined $p
397 0 348 if @_
416 0 0 unless $self->data
427 0 0 if (grep {$_ eq "y";} @flaglist)
444 0 341 unless ($rsa_pub)
445 0 0 $@ ne '' ? :
455 270 63 if $verify_result eq $expected
465 60 3 if (substr($verify_result, 0, $prefix_len) eq substr($expected, 0, $prefix_len))
482 0 3 unless ($ed)
483 0 0 $@ ne '' ? :
489 2 1 if $verify_result == 1
505 341 3 if $k_tag eq "rsa"
506 3 0 if $k_tag eq "ed25519"