line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::RR::SSHFP; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
5
|
|
|
|
|
|
|
our $VERSION = (qw$Id: SSHFP.pm 1896 2023-01-30 12:59:25Z willem $)[2]; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
9
|
use base qw(Net::DNS::RR); |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
118
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Net::DNS::RR::SSHFP - DNS SSHFP resource record |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
6
|
use integer; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
10
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
40
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
97
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
6
|
use constant BABBLE => defined eval { require Digest::BubbleBabble }; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
437
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _decode_rdata { ## decode rdata from wire-format octet string |
24
|
1
|
|
|
1
|
|
2
|
my ( $self, $data, $offset ) = @_; |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
3
|
my $size = $self->{rdlength} - 2; |
27
|
1
|
|
|
|
|
15
|
@{$self}{qw(algorithm fptype fpbin)} = unpack "\@$offset C2 a$size", $$data; |
|
1
|
|
|
|
|
5
|
|
28
|
1
|
|
|
|
|
29
|
return; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _encode_rdata { ## encode rdata as wire-format octet string |
33
|
5
|
|
|
5
|
|
8
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
5
|
|
|
|
|
7
|
return pack 'C2 a*', @{$self}{qw(algorithm fptype fpbin)}; |
|
5
|
|
|
|
|
18
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _format_rdata { ## format rdata portion of RR string. |
40
|
3
|
|
|
3
|
|
5
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
3
|
|
|
|
|
7
|
$self->_annotation( $self->babble ) if BABBLE; |
43
|
3
|
|
|
|
|
8
|
my @fprint = split /(\S{64})/, $self->fp; |
44
|
3
|
|
|
|
|
8
|
my @rdata = ( $self->algorithm, $self->fptype, @fprint ); |
45
|
3
|
|
|
|
|
10
|
return @rdata; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub _parse_rdata { ## populate RR from rdata in argument list |
50
|
2
|
|
|
2
|
|
5
|
my ( $self, @argument ) = @_; |
51
|
|
|
|
|
|
|
|
52
|
2
|
|
|
|
|
25
|
for (qw(algorithm fptype)) { $self->$_( shift @argument ) } |
|
4
|
|
|
|
|
13
|
|
53
|
2
|
|
|
|
|
5
|
$self->fp(@argument); |
54
|
2
|
|
|
|
|
6
|
return; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub algorithm { |
59
|
8
|
|
|
8
|
1
|
25
|
my ( $self, @value ) = @_; |
60
|
8
|
|
|
|
|
12
|
for (@value) { $self->{algorithm} = 0 + $_ } |
|
3
|
|
|
|
|
11
|
|
61
|
8
|
|
100
|
|
|
37
|
return $self->{algorithm} || 0; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub fptype { |
66
|
8
|
|
|
8
|
1
|
1110
|
my ( $self, @value ) = @_; |
67
|
8
|
|
|
|
|
14
|
for (@value) { $self->{fptype} = 0 + $_ } |
|
3
|
|
|
|
|
6
|
|
68
|
8
|
|
100
|
|
|
33
|
return $self->{fptype} || 0; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub fp { |
73
|
11
|
|
|
11
|
1
|
1536
|
my ( $self, @value ) = @_; |
74
|
11
|
100
|
|
|
|
45
|
return unpack "H*", $self->fpbin() unless scalar @value; |
75
|
4
|
100
|
|
|
|
8
|
my @hex = map { /^"*([\dA-Fa-f]*)"*$/ || croak("corrupt hex"); $1 } @value; |
|
4
|
|
|
|
|
255
|
|
|
3
|
|
|
|
|
15
|
|
76
|
3
|
|
|
|
|
18
|
return $self->fpbin( pack "H*", join "", @hex ); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub fpbin { |
81
|
17
|
|
|
17
|
1
|
726
|
my ( $self, @value ) = @_; |
82
|
17
|
|
|
|
|
33
|
for (@value) { $self->{fpbin} = $_ } |
|
3
|
|
|
|
|
7
|
|
83
|
17
|
|
100
|
|
|
83
|
return $self->{fpbin} || ""; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub babble { |
88
|
5
|
|
|
5
|
1
|
835
|
return BABBLE ? Digest::BubbleBabble::bubblebabble( Digest => shift->fpbin ) : ''; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
2
|
|
|
2
|
1
|
654
|
sub fingerprint { return &fp; } ## historical |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
1; |
96
|
|
|
|
|
|
|
__END__ |