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