File Coverage

blib/lib/Crypt/PK.pm
Criterion Covered Total %
statement 21 21 100.0
branch 4 6 66.6
condition n/a
subroutine 4 4 100.0
pod n/a
total 29 31 93.5


line stmt bran cond sub pod time code
1             package Crypt::PK;
2              
3 16     16   72 use strict;
  16         20  
  16         552  
4 16     16   60 use warnings;
  16         18  
  16         879  
5             our $VERSION = '0.088_004';
6              
7 16     16   64 use Carp;
  16         17  
  16         2540  
8              
9             sub _ssh_parse {
10 11     11   24 my $raw = shift;
11 11 50       38 return unless defined $raw;
12 11         23 my $len = length($raw);
13 11         22 my @parts = ();
14 11         21 my $i = 0;
15 11         18 while (1) {
16 45 100       84 last unless $i + 4 <= $len;
17 34         66 my $part_len = unpack("N4", substr($raw, $i, 4));
18 34 50       59 last unless $i + 4 + $part_len <= $len;
19 34         64 push @parts, substr($raw, $i + 4, $part_len);
20 34         38 $i += $part_len + 4;
21             }
22 11         46 return @parts;
23             }
24              
25             1;
26              
27             =pod
28              
29             =head1 NAME
30              
31             Crypt::PK - [internal only]
32              
33             =head1 SYNOPSIS
34              
35             Do not use this module directly.
36              
37             Use a concrete public-key module such as L,
38             L, or L.
39              
40             =head1 DESCRIPTION
41              
42             Internal base/helper namespace for public-key modules.
43              
44             Do not use this module directly. Use a concrete implementation such as
45             L, L, L, L,
46             L, L, L, or
47             L.
48              
49             =cut