line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::SEC; |
2
|
|
|
|
|
|
|
|
3
|
12
|
|
|
12
|
|
120528
|
use strict; |
|
12
|
|
|
|
|
29
|
|
|
12
|
|
|
|
|
404
|
|
4
|
12
|
|
|
12
|
|
78
|
use warnings; |
|
12
|
|
|
|
|
35
|
|
|
12
|
|
|
|
|
327
|
|
5
|
12
|
|
|
12
|
|
61
|
use Carp; |
|
12
|
|
|
|
|
24
|
|
|
12
|
|
|
|
|
1443
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $SVNVERSION = (qw$Id: SEC.pm 1938 2023-09-11 09:28:02Z willem $)[2]; |
8
|
|
|
|
|
|
|
our $VERSION; |
9
|
|
|
|
|
|
|
$VERSION = '1.21_01'; |
10
|
|
|
|
|
|
|
|
11
|
12
|
|
|
12
|
|
110
|
use base qw(Exporter DynaLoader); |
|
12
|
|
|
|
|
32
|
|
|
12
|
|
|
|
|
2957
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
eval { __PACKAGE__->bootstrap($VERSION) }; |
14
|
|
|
|
|
|
|
warn "\n\n$@\n" if $@; |
15
|
|
|
|
|
|
|
|
16
|
12
|
|
|
12
|
|
5852
|
use Net::DNS 1.01 qw(:DEFAULT); |
|
12
|
|
|
|
|
1109672
|
|
|
12
|
|
|
|
|
9530
|
|
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
|
8171
|
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
|
45
|
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
|
69
|
my $a = shift; |
88
|
3
|
|
|
|
|
5
|
my $b = shift; |
89
|
3
|
|
100
|
|
|
15
|
my $r = shift || []; ## 0.17 API |
90
|
|
|
|
|
|
|
|
91
|
3
|
|
|
|
|
14
|
local $SIG{__DIE__}; |
92
|
3
|
|
|
|
|
10
|
my ($x) = grep { !$_->isa('Net::DNS::RR::DNSKEY') } @$a, @$b; |
|
12
|
|
|
|
|
42
|
|
93
|
3
|
100
|
|
|
|
201
|
croak sprintf( 'unexpected %s object in key list', ref $x ) if $x; |
94
|
|
|
|
|
|
|
|
95
|
1
|
|
|
|
|
3
|
my %index = map { ( $_->privatekeyname => 1 ) } @$b; |
|
2
|
|
|
|
|
89
|
|
96
|
1
|
|
|
|
|
75
|
return @$r = grep { !$index{$_->privatekeyname} } @$a; |
|
2
|
|
|
|
|
73
|
|
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__ |