line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::SEC; |
2
|
|
|
|
|
|
|
|
3
|
12
|
|
|
12
|
|
115033
|
use strict; |
|
12
|
|
|
|
|
35
|
|
|
12
|
|
|
|
|
371
|
|
4
|
12
|
|
|
12
|
|
70
|
use warnings; |
|
12
|
|
|
|
|
23
|
|
|
12
|
|
|
|
|
296
|
|
5
|
12
|
|
|
12
|
|
62
|
use Carp; |
|
12
|
|
|
|
|
20
|
|
|
12
|
|
|
|
|
1248
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $SVNVERSION = (qw$Id: SEC.pm 1926 2023-05-31 12:05:13Z willem $)[2]; |
8
|
|
|
|
|
|
|
our $VERSION; |
9
|
|
|
|
|
|
|
$VERSION = '1.21'; |
10
|
|
|
|
|
|
|
|
11
|
12
|
|
|
12
|
|
89
|
use base qw(Exporter DynaLoader); |
|
12
|
|
|
|
|
25
|
|
|
12
|
|
|
|
|
2372
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
eval { __PACKAGE__->bootstrap($VERSION) }; |
14
|
|
|
|
|
|
|
warn "\n\n$@\n" if $@; |
15
|
|
|
|
|
|
|
|
16
|
12
|
|
|
12
|
|
5460
|
use Net::DNS 1.01 qw(:DEFAULT); |
|
12
|
|
|
|
|
1001800
|
|
|
12
|
|
|
|
|
8518
|
|
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
|
7554
|
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
|
47
|
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
|
67
|
my $a = shift; |
88
|
3
|
|
|
|
|
5
|
my $b = shift; |
89
|
3
|
|
100
|
|
|
11
|
my $r = shift || []; ## 0.17 API |
90
|
|
|
|
|
|
|
|
91
|
3
|
|
|
|
|
11
|
local $SIG{__DIE__}; |
92
|
3
|
|
|
|
|
7
|
my ($x) = grep { !$_->isa('Net::DNS::RR::DNSKEY') } @$a, @$b; |
|
12
|
|
|
|
|
41
|
|
93
|
3
|
100
|
|
|
|
190
|
croak sprintf( 'unexpected %s object in key list', ref $x ) if $x; |
94
|
|
|
|
|
|
|
|
95
|
1
|
|
|
|
|
2
|
my %index = map { ( $_->privatekeyname => 1 ) } @$b; |
|
2
|
|
|
|
|
83
|
|
96
|
1
|
|
|
|
|
70
|
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__ |