| 1 | package Crypt::PK; | ||||||||||
| 2 | |||||||||||
| 3 | 19 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 19 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 19 | our $VERSION = '0.091'; | |||||||||
| 6 | |||||||||||
| 7 | 19 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 11 | ▶ | sub _ssh_parse { | ||||||||
|
Subroutine
_ssh_parse: called CC=4 SCAR=13.9
| |||||||||||
| 10 | 11 | my $raw = shift; | |||||||||
| 11 | 11 | ▶ | return unless defined $raw; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 11 | my $len = length($raw); | |||||||||
| 13 | 11 | my @parts = (); | |||||||||
| 14 | 11 | my $i = 0; | |||||||||
| 15 | 11 | while (1) { | |||||||||
| 16 | 45 | ▶ | last unless $i + 4 <= $len; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 34 | my $part_len = unpack("N4", substr($raw, $i, 4)); | |||||||||
| 18 | 34 | ▶ | last unless $i + 4 + $part_len <= $len; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 34 | push @parts, substr($raw, $i + 4, $part_len); | |||||||||
| 20 | 34 | $i += $part_len + 4; | |||||||||
| 21 | } | ||||||||||
| 22 | 11 | return @parts; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 19 | 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 instead. | ||||||||||
| 38 | |||||||||||
| 39 | =head1 SEE ALSO | ||||||||||
| 40 | |||||||||||
| 41 | =over | ||||||||||
| 42 | |||||||||||
| 43 | =item * L<CryptX> | ||||||||||
| 44 | |||||||||||
| 45 | =item * L<Crypt::PK::RSA>, L<Crypt::PK::ECC>, L<Crypt::PK::DSA>, L<Crypt::PK::DH> | ||||||||||
| 46 | |||||||||||
| 47 | =item * L<Crypt::PK::Ed25519>, L<Crypt::PK::Ed448>, L<Crypt::PK::X25519>, L<Crypt::PK::X448> | ||||||||||
| 48 | |||||||||||
| 49 | =back | ||||||||||
| 50 | |||||||||||
| 51 | =cut | ||||||||||