line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::SEC; |
2
|
|
|
|
|
|
|
|
3
|
12
|
|
|
12
|
|
118463
|
use strict; |
|
12
|
|
|
|
|
30
|
|
|
12
|
|
|
|
|
382
|
|
4
|
12
|
|
|
12
|
|
119
|
use warnings; |
|
12
|
|
|
|
|
24
|
|
|
12
|
|
|
|
|
303
|
|
5
|
12
|
|
|
12
|
|
62
|
use Carp; |
|
12
|
|
|
|
|
26
|
|
|
12
|
|
|
|
|
1276
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $SVNVERSION = (qw$Id: SEC.pm 1939 2023-09-12 13:34:55Z willem $)[2]; |
8
|
|
|
|
|
|
|
our $VERSION; |
9
|
|
|
|
|
|
|
$VERSION = '1.22'; |
10
|
|
|
|
|
|
|
|
11
|
12
|
|
|
12
|
|
111
|
use base qw(Exporter DynaLoader); |
|
12
|
|
|
|
|
28
|
|
|
12
|
|
|
|
|
2402
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
eval { __PACKAGE__->bootstrap($VERSION) }; |
14
|
|
|
|
|
|
|
warn "\n\n$@\n" if $@; |
15
|
|
|
|
|
|
|
|
16
|
12
|
|
|
12
|
|
5502
|
use Net::DNS 1.01 qw(:DEFAULT); |
|
12
|
|
|
|
|
1035065
|
|
|
12
|
|
|
|
|
8525
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our @EXPORT = ( @Net::DNS::EXPORT, qw(algorithm digtype key_difference) ); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 NAME |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Net::DNS::SEC - DNSSEC extensions to Net::DNS |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 SYNOPSIS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
use Net::DNS::SEC; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 DESCRIPTION |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Net::DNS::SEC is installed as an extension to an existing Net::DNS |
32
|
|
|
|
|
|
|
installation providing packages to support DNSSEC as specified in |
33
|
|
|
|
|
|
|
RFC4033, RFC4034, RFC4035 and related documents. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
It also provides support for SIG0 which is useful for dynamic updates. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Implements cryptographic signature generation and verification functions |
38
|
|
|
|
|
|
|
using RSA, DSA, ECDSA, and Edwards curve algorithms. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
The extended features are made available by replacing Net::DNS by |
41
|
|
|
|
|
|
|
Net::DNS::SEC in the use declaration. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 UTILITY FUNCTIONS |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 algorithm |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
$mnemonic = algorithm( 5 ); |
51
|
|
|
|
|
|
|
$numeric = algorithm( 'RSA-SHA1' ); |
52
|
|
|
|
|
|
|
print "algorithm mnemonic\t", $mnemonic, "\n"; |
53
|
|
|
|
|
|
|
print "algorithm number:\t", $numeric, "\n"; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
algorithm() provides conversions between an algorithm code number and |
56
|
|
|
|
|
|
|
the corresponding mnemonic. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
6
|
|
|
6
|
1
|
7869
|
sub algorithm { return &Net::DNS::RR::DS::algorithm; } |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 digtype |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
$mnemonic = digtype( 2 ); |
66
|
|
|
|
|
|
|
$numeric = digtype( 'SHA-256' ); |
67
|
|
|
|
|
|
|
print "digest type mnemonic\t", $mnemonic, "\n"; |
68
|
|
|
|
|
|
|
print "digest type number:\t", $numeric, "\n"; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
digtype() provides conversions between a digest type number and the |
71
|
|
|
|
|
|
|
corresponding mnemonic. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
2
|
|
|
2
|
1
|
46
|
sub digtype { return &Net::DNS::RR::DS::digtype; } |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 key_difference |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
@result = key_difference( \@a, \@b ); |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Fills @result with all keys in array @a that are not in array @b. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub key_difference { |
87
|
3
|
|
|
3
|
1
|
68
|
my $a = shift; |
88
|
3
|
|
|
|
|
6
|
my $b = shift; |
89
|
3
|
|
100
|
|
|
14
|
my $r = shift || []; ## 0.17 API |
90
|
|
|
|
|
|
|
|
91
|
3
|
|
|
|
|
12
|
local $SIG{__DIE__}; |
92
|
3
|
|
|
|
|
10
|
my ($x) = grep { !$_->isa('Net::DNS::RR::DNSKEY') } @$a, @$b; |
|
12
|
|
|
|
|
43
|
|
93
|
3
|
100
|
|
|
|
211
|
croak sprintf( 'unexpected %s object in key list', ref $x ) if $x; |
94
|
|
|
|
|
|
|
|
95
|
1
|
|
|
|
|
2
|
my %index = map { ( $_->privatekeyname => 1 ) } @$b; |
|
2
|
|
|
|
|
93
|
|
96
|
1
|
|
|
|
|
72
|
return @$r = grep { !$index{$_->privatekeyname} } @$a; |
|
2
|
|
|
|
|
70
|
|
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
######################################## |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
foreach (qw(DS CDS RRSIG)) { |
103
|
|
|
|
|
|
|
Net::DNS::RR->new( type => $_ ); # pre-load to access class methods |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
1; |
107
|
|
|
|
|
|
|
__END__ |