Branch Coverage

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


line true false branch
63 0 0 if $line eq '-----BEGIN PGP SIGNATURE-----'
64 0 0 if $line =~ /^---/ .. $line eq ''
66 0 0 unless defined $file
76 0 0 unless (-r $Module::Signature::SIGNATURE)
81 0 0 unless (my $sigtext = _read_sigfile($Module::Signature::SIGNATURE))
86 0 0 unless (my($cipher_map) = _cipher_map($sigtext))
91 0 0 unless (defined(my $plaintext = _mkdigest($cipher_map)))
98 0 0 if ($rv == 0) { }
0 0 elsif ($rv == -3) { }
0 0 elsif ($rv == -4) { }
101 0 0 if (@{$mani;} or @{$file;}) { }
106 0 0 if $Module::Signature::Verbose
126 0 0 if $signature ne $Module::Signature::SIGNATURE
128 0 0 if ($Module::Signature::AutoKeyRetrieve and not $Module::Signature::CanKeyRetrieve)
129 0 0 unless (defined $Module::Signature::CanKeyRetrieve)
135 0 0 $sock ? :
136 0 0 if $sock
141 0 0 if (my $version = _has_gpg()) { }
0 0 elsif (eval { do { require Crypt::OpenPGP; 1 } }) { }
154 0 0 unless my $gpg = _which_gpg()
155 0 0 unless `$gpg --version` =~ /GnuPG.*?(\S+)\s*$/m
167 0 0 if (_legacy_extutils()) { }
169 0 0 if (_public_maniskip()) { }
176 0 0 unless $skip
178 0 0 if ($ok ||= !(-e 'MANIFEST.SKIP') && _default_skip(@_))
190 0 0 unless $skip
222 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 /^\.#/
233 0 0 if $which_gpg
237 0 0 if ($version and $version =~ /GnuPG/)
247 0 0 if defined &Win32::GetShortPathName and $Module::Signature::SIGNATURE =~ m[[^-\w.:~\\/]]
258 0 0 $Module::Signature::Verbose ? :
259 0 0 $Module::Signature::AutoKeyRetrieve && $version ge '1.0.7' ? :
0 0 $Module::Signature::KeyServer ? :
269 0 0 if ($Module::Signature::Verbose) { }
279 0 0 if ($?) { }
0 0 elsif ($output =~ /((?: +[\dA-F]{4}){10,})/) { }
287 0 0 if $? and $Module::Signature::AutoKeyRetrieve
288 0 0 !$? ? :
294 0 0 if $version ge '1.2.0'
303 0 0 $Module::Signature::KeyServer ? :
306 0 0 unless my $rv = $pgp->handle('Data', $sigtext)
309 0 0 if not $rv->{'Validity'} and $Module::Signature::AutoKeyRetrieve
311 0 0 if ($rv->{'Validity'}) { }
313 0 0 if $Module::Signature::Verbose
320 0 0 $rv->{'Validity'} ? :
329 0 0 unless open D, "< $sigfile"
331 0 0 if ($] >= 5.006 and readline(D) =~ /\r/) { }
333 0 0 unless open D, '<', $sigfile
337 0 0 unless open D, "< $sigfile"
344 0 0 if (1 .. $_ eq $begin)
345 0 0 if (not $found and /signed via the Module::Signature module, version ([0-9\.]+)\./)
347 0 0 if (eval { do { require version; 'version'->parse($1) < 'version'->parse('0.82') } })
356 0 0 if $_ eq $end
370 0 0 if $str1 eq $str2
372 0 0 if (eval { do { require Text::Diff; 1 } }) { }
379 0 0 unless open S, "< $Module::Signature::SIGNATURE"
380 0 0 unless open D, "| diff -u --strip-trailing-cr $Module::Signature::SIGNATURE -"
383 0 0 if 1 .. /^-----BEGIN PGP SIGNED MESSAGE-----/
384 0 0 if /^Hash: / .. /^$/
385 0 0 if 1 .. /^-----BEGIN PGP SIGNATURE/
386 0 0 if print D $str2, "-----BEGIN PGP SIGNATURE-----\n", $_
402 0 0 if (@{$mani;} or @{$file;})
407 0 0 if (not $overwrite and -e $Module::Signature::SIGNATURE and -t STDIN)
410 0 0 unless readline(STDIN) =~ /[Yy]/
413 0 0 if (my $version = _has_gpg()) { }
0 0 elsif (eval { do { require Crypt::OpenPGP; 1 } }) { }
430 0 0 if -e $sigfile and -d $sigfile || !(-w $sigfile)
437 0 0 if $Module::Signature::AUTHOR
438 0 0 unless open D, "| $gpg $set_key --clearsign --openpgp --personal-digest-preferences RIPEMD160 >> $sigfile.tmp"
443 0 0 unless (-e "$sigfile.tmp" and -s "$sigfile.tmp")
448 0 0 unless open D, "< $sigfile.tmp"
450 0 0 unless (open S, "> $sigfile")
470 0 0 if (/key ID ([0-9A-F]+)$/) { }
0 0 elsif (/signature from "(.+)"$/) { }
479 0 0 if (defined $key_id and defined $key_name)
482 0 0 if (/^\(\d+\)/) { }
0 0 elsif ($found_name) { }
485 0 0 if (/key \Q$key_id\E/)
491 0 0 if (/\Q$key_name\E/)
497 0 0 unless ($found_key)
511 0 0 unless my $ring = 'Crypt::OpenPGP::KeyRing'->new('Filename', $pgp->{'cfg'}->get('SecRing'))
515 0 0 if $Module::Signature::AUTHOR
518 0 0 if ($uid) { }
519 0 0 unless $kb = $ring->find_keyblock_by_uid($uid)
523 0 0 unless $kb = $ring->find_keyblock_by_index(-1)
529 0 0 if $Module::Signature::Debug
531 0 0 unless my $signature = $pgp->sign('Data', $plaintext, 'Detach', 0, 'Clearsign', 1, 'Armour', 1, 'Key', $cert, 'PassphraseCallback', \&Crypt::OpenPGP::_default_passphrase_cb)
541 0 0 unless open D, "> $sigfile"
549 0 0 unless ($server->find_keyblock_by_keyid($cert->key_id))
569 0 0 unless my $digest = _mkdigest_files(@_)
573 0 0 if $file eq $Module::Signature::SIGNATURE
587 0 0 unless my($base, $variant) = $algorithm =~ /^([_a-zA-Z]+)([0-9]+)$/g
598 0 0 if eval { do { warn "Unknown cipher: $algorithm, please install Digest::$base, Digest::$base$variant, or Digest::${base}::PurePerl\n" } }
600 0 0 unless (my $obj = eval { do { 'Digest'->new($algorithm) } } || eval { do { require "Digest/$base.pm"; "Digest::$base"->new($variant) } } || eval { do { require "Digest/$algorithm.pm"; "Digest::$algorithm"->new } } || eval { do { require "Digest/$base/PurePerl.pm"; "Digest::${base}::PurePerl"->new($variant) } } || eval { do { require "Digest/$algorithm/PurePerl.pm"; "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" } } })
614 0 0 if $file eq $Module::Signature::SIGNATURE
616 0 0 if ($verify_map) { }
617 0 0 if (my $vmf = $verify_map->{$file}) { }
619 0 0 if ($this_cipher eq $Module::Signature::Cipher) { }
632 0 0 if $Module::Signature::Debug
633 0 0 if ($dosnames)
638 0 0 if (exists $found->{$file}) { }
639 0 0 if $Module::Signature::Verbose
643 0 0 unless open F, "< $file"
644 0 0 if ($Module::Signature::LegacySigFile) { }
645 0 0 if (-B $file) { }
657 0 0 if (not length $eol) { }
661 0 0 if (grep /[\015\012]/, @lines) { }
664 0 0 $eol eq "\n" ? :
670 0 0 if ($verify_digest) { }
671 0 0 if ($this_hexdigest eq $verify_digest)
681 0 0 -B $file ? :