libcryptx-perl/lib/Crypt/PK.pm

34 lines
509 B
Perl
Raw Permalink Normal View History

2018-03-22 15:51:09 +01:00
package Crypt::PK;
use strict;
use warnings;
2018-03-22 15:54:03 +01:00
our $VERSION = '0.058_002';
2018-03-22 15:51:09 +01:00
use Carp;
sub _ssh_parse {
my $raw = shift;
return unless defined $raw;
my $len = length($raw);
my @parts = ();
my $i = 0;
while (1) {
last unless $i + 4 <= $len;
my $part_len = unpack("N4", substr($raw, $i, 4));
last unless $i + 4 + $part_len <= $len;
push @parts, substr($raw, $i + 4, $part_len);
$i += $part_len + 4;
}
return @parts;
}
1;
2018-03-22 15:54:03 +01:00
=pod
2018-03-22 15:51:09 +01:00
=head1 NAME
Crypt::PK - [internal only]
2018-03-22 15:54:03 +01:00
=cut