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