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