Branch Coverage

blib/lib/Net/SSH/Perl/Packet.pm
Criterion Covered Total %
branch 36 142 25.3


line true false branch
29 5 5 unless ($pack->{'data'})
30 0 5 $ssh->protocol == &PROTOCOL_SSH2() ? :
32 5 0 if ($pack->{'type'})
45 4 4 if (my $packet = $class->read_poll($ssh))
52 0 4 if $len == 0
53 0 4 unless (defined $len)
54 0 0 if $! == 11 or $! == 11
70 0 9 if ($ssh->protocol == &PROTOCOL_SSH2()) { }
78 4 5 unless $packet
81 0 5 if ($ssh->protocol == &PROTOCOL_SSH2()) { }
82 0 0 if ($type == &SSH2_MSG_DISCONNECT())
88 1 4 if ($type == &SSH_MSG_DISCONNECT())
93 0 4 if ($type == $debug) { }
0 4 elsif ($type == $ignore) { }
107 0 9 unless (defined &Net::SSH::Perl::Packet::_crc32)
109 0 0 if $@
113 4 5 if $incoming->length < 12
116 0 5 unless defined $len
118 0 5 if $incoming->length < 4 + $pad_len
125 0 5 if (my $cipher = $ssh->receive_cipher)
135 0 5 unless $crc == $stored_crc
140 0 5 if (my $comp = $ssh->compression)
159 0 0 if ($kex)
163 0 0 if $authlen = $ciph && $ciph->authlen
165 0 0 $mac && $mac->enabled ? :
166 0 0 $ciph && $ciph->enabled ? :
167 0 0 $mac && $mac->enabled && $mac->etm || $authlen ? :
171 0 0 unless ($ssh->{'session'}{'_last_packet_length'})
172 0 0 if $incoming->length < $block_size
175 0 0 if ($authlen) { }
0 0 elsif ($aadlen) { }
181 0 0 $ciph && $ciph->enabled ? :
189 0 0 if ($plen < 5 or $plen > 262144)
194 0 0 $aadlen ? :
195 0 0 if $need % $block_size
197 0 0 if $aadlen and $incoming->length < $aadlen + $need + $maclen + $authlen or not $aadlen and $incoming->length < $need + $block_size + $maclen
202 0 0 if ($mac and $mac->enabled) { }
0 0 elsif ($authlen) { }
203 0 0 if ($mac->etm) { }
221 0 0 if ($mac and $mac->enabled) { }
222 0 0 unless ($mac->etm)
223 0 0 $ciph && $ciph->enabled ? :
228 0 0 unless $macbuf eq $stored_mac
231 0 0 $ciph && $ciph->enabled ? :
0 0 if $mac->etm
234 0 0 $ciph && $ciph->enabled ? :
241 0 0 unless $padlen >= 4
248 0 0 if ($comp and $comp->enabled)
263 1 0 if ($pack->type != $type)
264 0 1 if ($pack->type == &SSH2_MSG_GLOBAL_REQUEST()) { }
279 0 5 if ($pack->{'ssh'}->protocol == &PROTOCOL_SSH2()) { }
292 1 4 unless (defined &Net::SSH::Perl::Packet::_crc32)
296 0 5 if ($buffer->length >= &MAX_PACKET_SIZE() - 30)
302 0 5 if (my $comp = $ssh->compression)
320 0 5 $cipher ? :
334 0 0 if ($kex)
338 0 0 if $authlen = $ciph && $ciph->authlen
340 0 0 $ciph && $ciph->enabled ? :
341 0 0 $mac && $mac->enabled && $mac->etm || $authlen ? :
344 0 0 if ($comp and $comp->enabled)
352 0 0 if $padlen < 4
353 0 0 $ciph ? :
358 0 0 unless $mac and $mac->etm
360 0 0 $ciph && $ciph->enabled ? :
361 0 0 if $mac and $mac->etm
364 0 0 if ($mac and $mac->enabled)
365 0 0 $mac->etm ? :
371 0 0 if $mac and $mac->enabled
381 0 11 if @_
391 10 4 if $meth eq "DESTROY"
393 4 0 if ($pack->{'data'}->can($meth)) { }