Branch Coverage

blib/lib/Module/Signature.pm
Criterion Covered Total %
branch 0 224 0.0


line true false branch
66 0 0 if $line eq "-----BEGIN PGP SIGNATURE-----"
67 0 0 if $line =~ /^---/ .. $line eq ""
68 0 0 if $line eq ""
70 0 0 unless defined $file
80 0 0 unless (-r $Module::Signature::SIGNATURE)
85 0 0 unless (my $sigtext = _read_sigfile($Module::Signature::SIGNATURE))
90 0 0 unless (my($cipher_map) = _cipher_map($sigtext))
95 0 0 unless (defined(my $plaintext = _mkdigest($cipher_map)))
102 0 0 if ($rv == 0) { }
0 0 elsif ($rv == -3) { }
0 0 elsif ($rv == -4) { }
105 0 0 if (@{$mani;} or @{$file;}) { }
110 0 0 if $Module::Signature::Verbose
130 0 0 if $signature ne $Module::Signature::SIGNATURE
132 0 0 if ($Module::Signature::AutoKeyRetrieve and not $Module::Signature::CanKeyRetrieve)
133 0 0 unless (defined $Module::Signature::CanKeyRetrieve)
139 0 0 $sock ? :
140 0 0 if $sock
145 0 0 if (my $version = _has_gpg()) { }
0 0 elsif (eval { do { require Crypt::OpenPGP; 1 } }) { }
158 0 0 unless my $gpg = _which_gpg()
159 0 0 unless `$gpg --version` =~ /GnuPG.*?(\S+)\s*$/m
171 0 0 if (_legacy_extutils()) { }
173 0 0 if (_public_maniskip()) { }
180 0 0 unless $skip
182 0 0 if ($ok ||= !(-e 'MANIFEST.SKIP') && _default_skip(@_))
194 0 0 unless $skip
226 0 0 if /\bRCS\b/ or /\bCVS\b/ or /\B\.svn\b/ or /,v$/ or /^MANIFEST\.bak/ or /^Makefile$/ or m[^blib/] or /^MakeMaker-\d/ or /^pm_to_blib/ or /^blibdirs/ or m[^_build/] or /^Build$/ or /^pmfiles\.dat/ or /^MYMETA\./ or /~$/ or /\.old$/ or /\#$/ or /^\.#/
237 0 0 if $which_gpg
241 0 0 if ($version and $version =~ /GnuPG/)
251 0 0 if defined &Win32::GetShortPathName and $Module::Signature::SIGNATURE =~ m[[^-\w.:~\\/]]
262 0 0 $Module::Signature::Verbose ? :
263 0 0 $Module::Signature::AutoKeyRetrieve && $version ge '1.0.7' ? :
0 0 $Module::Signature::KeyServer ? :
273 0 0 if ($Module::Signature::Verbose) { }
283 0 0 if ($?) { }
0 0 elsif ($output =~ /((?: +[\dA-F]{4}){10,})/) { }
291 0 0 if $? and $Module::Signature::AutoKeyRetrieve
292 0 0 !$? ? :
298 0 0 if $version ge "1.2.0"
307 0 0 $Module::Signature::KeyServer ? :
310 0 0 unless my $rv = $pgp->handle("Data", $sigtext)
313 0 0 if not $rv->{'Validity'} and $Module::Signature::AutoKeyRetrieve
315 0 0 if ($rv->{'Validity'}) { }
317 0 0 if $Module::Signature::Verbose
324 0 0 $rv->{'Validity'} ? :
333 0 0 unless open $sigfile_fh, "<", $sigfile
335 0 0 if ($] >= 5.006 and readline($sigfile_fh) =~ /\r/) { }
337 0 0 unless open $sigfile_fh, "<", $sigfile
341 0 0 unless open $sigfile_fh, "<", $sigfile
348 0 0 if (1 .. $_ eq $begin)
349 0 0 if (not $found and /signed via the Module::Signature module, version ([0-9\.]+)\./)
351 0 0 if (eval { do { require version; "version"->parse($1) < "version"->parse("0.82") } })
360 0 0 if $_ eq $end
374 0 0 if $str1 eq $str2
376 0 0 if (eval { do { require Text::Diff; 1 } }) { }
384 0 0 unless open $signature_fh, "<", $Module::Signature::SIGNATURE
385 0 0 unless open $diff_fh, "|-", "diff -u --strip-trailing-cr $Module::Signature::SIGNATURE -"
388 0 0 if 1 .. /^-----BEGIN PGP SIGNED MESSAGE-----/
389 0 0 if /^Hash: / .. /^$/
390 0 0 if 1 .. /^-----BEGIN PGP SIGNATURE/
391 0 0 if print $diff_fh $str2, "-----BEGIN PGP SIGNATURE-----\n", $_
407 0 0 if (@{$mani;} or @{$file;})
412 0 0 if (not $overwrite and -e $Module::Signature::SIGNATURE and IO::Interactive::is_interactive())
415 0 0 unless readline(STDIN) =~ /[Yy]/
418 0 0 if (my $version = _has_gpg()) { }
0 0 elsif (eval { do { require Crypt::OpenPGP; 1 } }) { }
435 0 0 if -e $sigfile and -d $sigfile || !(-w $sigfile)
442 0 0 if $Module::Signature::AUTHOR
443 0 0 unless open $gpg_fh, "|-", "$gpg $set_key --clearsign --openpgp --personal-digest-preferences RIPEMD160 >> $sigfile.tmp"
448 0 0 unless (-e "$sigfile.tmp" and -s "$sigfile.tmp")
454 0 0 unless open $sigfile_tmp_fh, "<", "$sigfile.tmp"
457 0 0 unless (open $sigfile_fh, ">", $sigfile)
477 0 0 if (/key ID ([0-9A-F]+)$/) { }
0 0 elsif (/signature from "(.+)"$/) { }
486 0 0 if (defined $key_id and defined $key_name)
489 0 0 if (/^\(\d+\)/) { }
0 0 elsif ($found_name) { }
492 0 0 if (/key \Q$key_id\E/)
498 0 0 if (/\Q$key_name\E/)
504 0 0 unless ($found_key)
518 0 0 unless my $ring = "Crypt::OpenPGP::KeyRing"->new("Filename", $pgp->{'cfg'}->get("SecRing"))
522 0 0 if $Module::Signature::AUTHOR
525 0 0 if ($uid) { }
526 0 0 unless $kb = $ring->find_keyblock_by_uid($uid)
530 0 0 unless $kb = $ring->find_keyblock_by_index(-1)
536 0 0 if $Module::Signature::Debug
538 0 0 unless my $signature = $pgp->sign("Data", $plaintext, "Detach", 0, "Clearsign", 1, "Armour", 1, "Key", $cert, "PassphraseCallback", \&Crypt::OpenPGP::_default_passphrase_cb)
548 0 0 unless open $sigfile_fh, ">", $sigfile
556 0 0 unless ($server->find_keyblock_by_keyid($cert->key_id))
576 0 0 unless my $digest = _mkdigest_files(@_)
580 0 0 if $file eq $Module::Signature::SIGNATURE
594 0 0 unless my($base, $variant) = $algorithm =~ /^([_a-zA-Z]+)([0-9]+)$/g
609 0 0 if eval { do { warn "Unknown cipher: $algorithm, please install Digest::$base, Digest::$base$variant, or Digest::${base}::PurePerl\n" } }
611 0 0 unless (my $obj = eval { do { 'Digest'->new($algorithm) } } || eval { do { my $module = "Digest/$base.pm"; require $module; ("Digest::$base")->new($variant) } } || eval { do { my $module = "Digest/$algorithm.pm"; require $module; ("Digest::$algorithm")->new } } || eval { do { my $module = "Digest/$base/PurePerl.pm"; require $module; ("Digest::${base}::PurePerl")->new($variant) } } || eval { do { my $module = "Digest/$algorithm/PurePerl.pm"; require $module; ("Digest::${algorithm}::PurePerl")->new } } or do { return if eval { do { warn "Unknown cipher: $algorithm, please install Digest::$base, Digest::$base$variant, or Digest::${base}::PurePerl\n" } } })
625 0 0 if $file eq $Module::Signature::SIGNATURE
627 0 0 if ($verify_map) { }
628 0 0 if (my $vmf = $verify_map->{$file}) { }
630 0 0 if ($this_cipher eq $Module::Signature::Cipher) { }
643 0 0 if $Module::Signature::Debug
644 0 0 if ($dosnames)
649 0 0 if (exists $found->{$file}) { }
650 0 0 if $Module::Signature::Verbose
654 0 0 unless open $file_fh, "<", $file
655 0 0 if ($Module::Signature::LegacySigFile) { }
656 0 0 if (-B $file) { }
668 0 0 if (not length $eol) { }
672 0 0 if (grep /[\015\012]/, @lines) { }
675 0 0 $eol eq "\n" ? :
681 0 0 if ($verify_digest) { }
682 0 0 if ($this_hexdigest eq $verify_digest)
692 0 0 -B $file ? :