Branch Coverage

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


line true false branch
63 0 426 unless defined $prms{'Protocol'} and $prms{'Protocol'} =~ m[^dns(/txt)?$]s
67 2 424 unless defined $prms{'Selector'} and length $prms{'Selector'}
70 0 424 unless defined $prms{'Domain'} and length $prms{'Domain'}
72 2 422 unless $prms{'Callbacks'}
76 5 364 unless (@resp)
84 0 364 unless $rr->type eq "TXT"
87 364 0 if ($rr->can('txtdata')) { }
100 0 364 unless $strn
127 340 21 if (my $v = $self->get_tag("v"))
128 1 339 unless ($v eq "DKIM1")
137 335 25 if (my $k = $self->get_tag("k"))
138 1 334 unless ($k eq "rsa" or $k eq "ed25519")
145 0 359 unless (defined $p)
148 1 358 if ($p eq "")
151 0 358 unless ($p =~ m[^[A-Za-z0-9\+/\=]+$])
160 1 357 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 335 if (my $s = $self->get_tag("s"))
179 15 11 unless $_ eq "*"
1 21 unless (grep {$_ eq "email" unless $_ eq "*";} @list)
208 1 352 if ($g eq "" and $empty_g_means_wildcard)
214 58 295 if ($identity =~ /^(.*)\@([^\@]*)$/) { }
224 352 1 if (defined $ends) { }
229 3 349 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 347 if ($self->subdomain_flag)
258 1 1 unless (lc $domain_part eq lc $self->{'Domain'})
275 14 341 if (my $h = $self->get_tag("h"))
277 2 12 unless (grep {$_ eq $hash_algorithm;} @list)
299 0 354 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 333 unless defined $k_tag
329 0 358 unless $self->data
332 354 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 713 if @_
364 44 669 if (defined $g) { }
375 0 0 if @_
384 0 3793 if @_
390 3793 0 if defined $p
397 0 349 if @_
416 0 0 unless $self->data
427 0 0 if (grep {$_ eq "y";} @flaglist)
444 0 342 unless ($rsa_pub)
445 0 0 $@ ne '' ? :
455 271 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 342 3 if $k_tag eq "rsa"
506 3 0 if $k_tag eq "ed25519"