Branch Coverage

blib/lib/Crypt/PK/DSA.pm
Criterion Covered Total %
branch 57 84 67.8


line true false branch
20 34 48 @_ > 0 ? :
25 5 3 if @_ == 2
26 1 2 if (@_ == 1 and ref $_[0] eq 'HASH') { }
2 0 elsif (@_ == 1 and ref $_[0] eq 'SCALAR') { }
28 0 1 unless my $p = $param->{'p'}
29 0 1 unless my $q = $param->{'q'}
30 0 1 unless my $g = $param->{'g'}
34 0 1 unless length $p
35 0 1 unless length $q
36 0 1 unless length $g
41 1 1 if ($data =~ /-----BEGIN DSA PARAMETERS-----\s*(.+)\s*-----END DSA PARAMETERS-----/s)
42 0 1 unless $data = pem_to_der($data)
52 1 10 ($type || '') eq 'public_x509' ? :
54 0 11 unless $key
55 5 6 if $type eq "private"
56 5 1 if $type eq "public"
57 1 0 if $type eq "public_x509"
62 0 83 unless $key
65 2 81 if (ref $key eq "HASH")
66 2 0 if ($key->{'p'} and $key->{'q'} and $key->{'g'} and $key->{'y'})
73 36 45 if (ref $key eq 'SCALAR') { }
45 0 elsif (-f $key) { }
82 0 81 unless $data
84 20 61 if ($data =~ /-----BEGIN (DSA PRIVATE|DSA PUBLIC|PRIVATE|ENCRYPTED PRIVATE|PUBLIC) KEY-----(.+?)-----END (DSA PRIVATE|DSA PUBLIC|PRIVATE|ENCRYPTED PRIVATE|PUBLIC) KEY-----/s) { }
0 61 elsif ($data =~ /-----BEGIN CERTIFICATE-----(.+?)-----END CERTIFICATE-----/s) { }
2 59 elsif ($data =~ /-----BEGIN OPENSSH PRIVATE KEY-----(.+?)-----END OPENSSH PRIVATE KEY-----/s) { }
1 58 elsif ($data =~ /---- BEGIN SSH2 PUBLIC KEY ----(.+?)---- END SSH2 PUBLIC KEY ----/s) { }
1 57 elsif ($data =~ /ssh-dss\s+(\S+)/) { }
99 1 0 if $typ and $p and $q and $g and $y and $typ eq "ssh-dss"
103 57 0 if $rv
113 1 1 unless ref $key
114 1 1 unless ref $key eq __PACKAGE__
121 1 0 unless ref $key
122 0 1 unless ref $key eq __PACKAGE__
129 1 0 unless ref $key
130 0 1 unless ref $key eq __PACKAGE__
137 1 0 unless ref $key
138 0 1 unless ref $key eq __PACKAGE__
145 1 0 unless ref $key
146 0 1 unless ref $key eq __PACKAGE__
153 1 0 unless ref $key
154 0 1 unless ref $key eq __PACKAGE__